Corgi Engine  v8.8
MoreMountains.CorgiEngine.SuperHipsterBrosHealth Class Reference

Manages the health of the SuperHipsterBros character More...

Inheritance diagram for MoreMountains.CorgiEngine.SuperHipsterBrosHealth:
MoreMountains.CorgiEngine.Health MoreMountains.Tools.MMMonoBehaviour MoreMountains.Tools.MMEventListener< HealthDeathEvent >

Public Member Functions

override void Damage (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null)
 Called when the player takes damage More...
 
virtual void Grow (float growthFactor)
 Doubles the size of the character More...
 
virtual void Shrink (float shrinkFactor)
 Shrinks the size of the character More...
 
virtual void ResetScale (float growthFactor)
 Resets the size of the character More...
 
override void Kill ()
 Kills the character, sending it in the air More...
 
- Public Member Functions inherited from MoreMountains.CorgiEngine.Health
delegate void OnHitDelegate ()
 
delegate void OnHitZeroDelegate ()
 
delegate void OnReviveDelegate ()
 
delegate void OnDeathDelegate ()
 
virtual void InitializeCurrentHealth ()
 Initializes health to either initial or current values More...
 
virtual void StoreInitialPosition ()
 
virtual bool CanTakeDamageThisFrame ()
 Returns true if this Health component can be damaged this frame, and false otherwise More...
 
virtual void Revive ()
 Revive this object. More...
 
virtual void InterruptAllDamageOverTime ()
 Interrupts all damage over time, regardless of type More...
 
virtual void StopAllDamageOverTime ()
 Interrupts all damage over time, even the non interruptible ones (usually on death) More...
 
virtual void InterruptAllDamageOverTimeOfType (DamageType damageType)
 Interrupts all damage over time of the specified type More...
 
virtual void DamageOverTime (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null, int amountOfRepeats=0, float durationBetweenRepeats=1f, bool interruptible=true, DamageType damageType=null)
 Applies damage over time, for the specified amount of repeats (which includes the first application of damage, makes it easier to do quick maths in the inspector, and at the specified interval). Optionally you can decide that your damage is interruptible, in which case, calling InterruptAllDamageOverTime() will stop these from being applied, useful to cure poison for example. More...
 
virtual float ComputeDamageOutput (float damage, List< TypedDamage > typedDamages=null, bool damageApplied=false)
 Returns the damage this health should take after processing potential resistances More...
 
virtual Vector2 ComputeKnockbackForce (Vector2 knockbackForce, List< TypedDamage > typedDamages=null)
 Determines a new knockback force by processing it through resistances More...
 
virtual bool CanGetKnockback (List< TypedDamage > typedDamages)
 Returns true if this Health can get knockbacked, false otherwise More...
 
virtual void GetHealth (float health, GameObject instigator)
 Called when the character gets health (from a stimpack for example) More...
 
virtual void SetHealth (float newHealth, GameObject instigator)
 Sets the health of the character to the one specified in parameters More...
 
virtual void ResetHealthToMaxHealth ()
 Resets the character's health to its max value More...
 
virtual void UpdateHealthBar (bool show)
 Updates the character's health bar progress. More...
 
virtual void DamageDisabled ()
 Prevents the character from taking any damage More...
 
virtual void DamageEnabled ()
 Allows the character to take damage More...
 
virtual void EnablePostDamageInvulnerability ()
 Prevents the character from taking any damage More...
 
virtual void DisablePostDamageInvulnerability ()
 Allows the character to take damage More...
 
virtual IEnumerator DisablePostDamageInvulnerability (float delay)
 Allows the character to take damage More...
 
virtual IEnumerator DamageEnabled (float delay)
 makes the character able to take damage again after the specified delay More...
 
void OnMMEvent (HealthDeathEvent deathEvent)
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< HealthDeathEvent >
void OnMMEvent (T eventType)
 

Protected Member Functions

override void Initialization ()
 Grabs useful components, enables damage and gets the inital color More...
 
- Protected Member Functions inherited from MoreMountains.CorgiEngine.Health
virtual void Start ()
 On Awake, we initialize our health More...
 
virtual void InitializeSpriteColor ()
 Stores the inital color of the Character's sprite. More...
 
virtual void ResetSpriteColor ()
 Restores the original sprite color More...
 
virtual void DestroyObject ()
 Destroys the object, or tries to, depending on the character's settings More...
 
virtual IEnumerator DamageOverTimeCo (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null, int amountOfRepeats=0, float durationBetweenRepeats=1f, bool interruptible=true, DamageType damageType=null)
 A coroutine used to apply damage over time More...
 
virtual void ComputeCharacterConditionStateChanges (List< TypedDamage > typedDamages)
 Goes through resistances and applies condition state changes if needed More...
 
virtual void ComputeCharacterMovementMultipliers (List< TypedDamage > typedDamages)
 Goes through the resistance list and applies movement multipliers if needed More...
 
virtual void OnEnable ()
 When the object is enabled (on respawn for example), we restore its initial health levels More...
 
virtual void OnDisable ()
 Cancels all running invokes on disable More...
 

Protected Attributes

Vector3 _initialScale
 
- Protected Attributes inherited from MoreMountains.CorgiEngine.Health
CharacterHorizontalMovement _characterHorizontalMovement
 
Vector3 _initialPosition
 
Color _initialColor
 
Renderer _renderer
 
Character _character
 
CorgiController _controller
 
MMHealthBar _healthBar
 
Collider2D _collider2D
 
bool _initialized = false
 
AutoRespawn _autoRespawn
 
Animator _animator
 
CharacterPersistence _characterPersistence = null
 
MaterialPropertyBlock _propertyBlock
 
bool _hasColorProperty = false
 
GameObject _thisObject
 
List< InterruptiblesDamageOverTimeCoroutine_interruptiblesDamageOverTimeCoroutines
 
List< InterruptiblesDamageOverTimeCoroutine_damageOverTimeCoroutines
 

Additional Inherited Members

- Public Attributes inherited from MoreMountains.CorgiEngine.Health
float CurrentHealth
 the current health of the character More...
 
bool TemporarilyInvulnerable = false
 If this is true, this object can't take damage at the moment. More...
 
bool PostDamageInvulnerable = false
 If this is true, this object is in post damage invulnerability state. More...
 
float InitialHealth = 10
 the initial amount of health of the object More...
 
float MaximumHealth = 10
 the maximum amount of health of the object More...
 
bool Invulnerable = false
 if this is true, this object can't take damage More...
 
bool ImmuneToDamage = false
 whether or not this Health object can be damaged, you can play with this on top of Invulnerable, which will be turned on/off temporarily for temporary invulnerability. ImmuneToDamage is more of a permanent solution. More...
 
MMFeedbacks DamageFeedbacks
 the MMFeedbacks to play when the character gets hit More...
 
bool FeedbackIsProportionalToDamage = false
 if this is true, the damage value will be passed to the MMFeedbacks as its Intensity parameter, letting you trigger more intense feedbacks as damage increases More...
 
bool FlickerSpriteOnHit = true
 should the sprite (if there's one) flicker when getting damage ? More...
 
Color FlickerColor = new Color32(255, 20, 20, 255)
 the color the sprite should flicker to More...
 
bool ImmuneToKnockback = false
 whether or not this object can get knockback More...
 
bool ImmuneToKnockbackIfZeroDamage = false
 whether or not this object is immune to damage knockback if the damage received is zero More...
 
MMFeedbacks DeathFeedbacks
 the MMFeedbacks to play when the character dies More...
 
bool DestroyOnDeath = true
 if this is not true, the object will remain there after its death More...
 
float DelayBeforeDestruction = 0f
 the time (in seconds) before the character is destroyed or disabled More...
 
bool CollisionsOffOnDeath = true
 if this is true, collisions will be turned off when the character dies More...
 
bool GravityOffOnDeath = false
 if this is true, gravity will be turned off on death More...
 
int PointsWhenDestroyed
 the points the player gets when the object's health reaches zero More...
 
bool RespawnAtInitialLocation = false
 if this is set to false, the character will respawn at the location of its death, otherwise it'll be moved to its initial position (when the scene started) More...
 
bool ApplyDeathForce = true
 whether or not to apply a force on death More...
 
Vector2 DeathForce = new Vector2(0, 10)
 the force applied when the character dies More...
 
bool ResetForcesOnDeath = false
 whether or not the controller's forces should be set to 0 on death More...
 
bool ResetColorOnRevive = true
 if this is true, color will be reset on revive More...
 
string ColorMaterialPropertyName = "_Color"
 the name of the property on your renderer's shader that defines its color More...
 
bool UseMaterialPropertyBlocks = false
 if this is true, this component will use material property blocks instead of working on an instance of the material. More...
 
Character AssociatedCharacter
 the Character this Health should impact, if left empty, will pick one on the same game object More...
 
Health MasterHealth
 another Health component (usually on another character) towards which all health will be redirected More...
 
bool OnlyDamageMaster = true
 if this is true, when using a MasterHealth, this Health won't take damage, and all damage will be redirected. If this is false, this Health will be able to die when its own Health is consumed More...
 
bool KillOnMasterHealthDeath = false
 if this is true, when using a MasterHealth, if the MasterHealth dies, this Health will also die More...
 
DamageResistanceProcessor TargetDamageResistanceProcessor
 a DamageResistanceProcessor this Health will use to process damage when it's received More...
 
bool Initialized => _initialized
 
CorgiController AssociatedController => _controller
 
OnDeathDelegate OnDeath
 
OnHitDelegate OnHit
 
OnHitZeroDelegate OnHitZero
 
OnReviveDelegate OnRevive
 
- Properties inherited from MoreMountains.CorgiEngine.Health
float LastDamage [get, set]
 
Vector3 LastDamageDirection [get, set]
 

Detailed Description

Manages the health of the SuperHipsterBros character

Member Function Documentation

◆ Damage()

override void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.Damage ( float  damage,
GameObject  instigator,
float  flickerDuration,
float  invincibilityDuration,
Vector3  damageDirection,
List< TypedDamage typedDamages = null 
)
virtual

Called when the player takes damage

Parameters
damageThe damage applied.
instigatorThe damage instigator.

Reimplemented from MoreMountains.CorgiEngine.Health.

◆ Grow()

virtual void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.Grow ( float  growthFactor)
virtual

Doubles the size of the character

◆ Initialization()

override void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.Initialization ( )
protectedvirtual

Grabs useful components, enables damage and gets the inital color

Reimplemented from MoreMountains.CorgiEngine.Health.

◆ Kill()

override void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.Kill ( )
virtual

Kills the character, sending it in the air

Reimplemented from MoreMountains.CorgiEngine.Health.

◆ ResetScale()

virtual void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.ResetScale ( float  growthFactor)
virtual

Resets the size of the character

◆ Shrink()

virtual void MoreMountains.CorgiEngine.SuperHipsterBrosHealth.Shrink ( float  shrinkFactor)
virtual

Shrinks the size of the character

Member Data Documentation

◆ _initialScale

Vector3 MoreMountains.CorgiEngine.SuperHipsterBrosHealth._initialScale
protected

The documentation for this class was generated from the following file: