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

Link this component to a Health component, and it'll be able to process incoming damage through resistances, handling damage reduction/increase, condition changes, movement multipliers, feedbacks and more. More...

Inheritance diagram for MoreMountains.CorgiEngine.DamageResistanceProcessor:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Member Functions

virtual void SortDamageResistanceList ()
 A method used to reorder the list of resistances, based on priority by default. Don't hesitate to override this method if you'd like your resistances to be handled in a different order More...
 
virtual float ProcessDamage (float damage, List< TypedDamage > typedDamages, bool damageApplied)
 Processes incoming damage through the list of resistances, and outputs the final damage value More...
 
virtual void SetResistanceByLabel (string searchedLabel, bool active)
 Enables or disables a resistance matching the searched label More...
 
virtual void InterruptDamageOverTime (DamageType damageType)
 When interrupting all damage over time of the specified type, stops their associated feedbacks if needed More...
 
virtual bool CheckPreventCharacterConditionChange (DamageType typedDamage)
 Checks if any of the resistances prevents the character from changing condition, and returns true if that's the case, false otherwise More...
 
virtual bool CheckPreventKnockback (List< TypedDamage > typedDamages)
 Returns true if the resistances on this processor make it immune to knockback, false otherwise More...
 
virtual Vector2 ProcessKnockbackForce (Vector2 knockback, List< TypedDamage > typedDamages)
 Processes the input knockback force through the various resistances More...
 
virtual bool CheckPreventMovementModifier (DamageType typedDamage)
 Checks if any of the resistances prevents the character from changing condition, and returns true if that's the case, false otherwise More...
 

Public Attributes

bool AutoFillDamageResistanceList = true
 If this is true, this component will try to auto-fill its list of damage resistances from the ones found in its children. More...
 
bool IgnoreDisabledResistances = true
 If this is true, disabled resistances will be ignored by the auto fill. More...
 
bool IgnoreUnknownDamageTypes = false
 If this is true, damage from damage types that this processor has no resistance for will be ignored. More...
 
List< DamageResistanceDamageResistanceList
 the list of damage resistances this processor will handle. Auto filled if AutoFillDamageResistanceList is true More...
 

Protected Member Functions

virtual void Awake ()
 On awake we initialize our processor More...
 
virtual void Initialization ()
 Auto finds resistances if needed and sorts them More...
 

Detailed Description

Link this component to a Health component, and it'll be able to process incoming damage through resistances, handling damage reduction/increase, condition changes, movement multipliers, feedbacks and more.

Member Function Documentation

◆ Awake()

virtual void MoreMountains.CorgiEngine.DamageResistanceProcessor.Awake ( )
protectedvirtual

On awake we initialize our processor

◆ CheckPreventCharacterConditionChange()

virtual bool MoreMountains.CorgiEngine.DamageResistanceProcessor.CheckPreventCharacterConditionChange ( DamageType  typedDamage)
virtual

Checks if any of the resistances prevents the character from changing condition, and returns true if that's the case, false otherwise

Parameters
typedDamage
Returns

◆ CheckPreventKnockback()

virtual bool MoreMountains.CorgiEngine.DamageResistanceProcessor.CheckPreventKnockback ( List< TypedDamage typedDamages)
virtual

Returns true if the resistances on this processor make it immune to knockback, false otherwise

Parameters
typedDamage
Returns

◆ CheckPreventMovementModifier()

virtual bool MoreMountains.CorgiEngine.DamageResistanceProcessor.CheckPreventMovementModifier ( DamageType  typedDamage)
virtual

Checks if any of the resistances prevents the character from changing condition, and returns true if that's the case, false otherwise

Parameters
typedDamage
Returns

◆ Initialization()

virtual void MoreMountains.CorgiEngine.DamageResistanceProcessor.Initialization ( )
protectedvirtual

Auto finds resistances if needed and sorts them

◆ InterruptDamageOverTime()

virtual void MoreMountains.CorgiEngine.DamageResistanceProcessor.InterruptDamageOverTime ( DamageType  damageType)
virtual

When interrupting all damage over time of the specified type, stops their associated feedbacks if needed

Parameters
damageType

◆ ProcessDamage()

virtual float MoreMountains.CorgiEngine.DamageResistanceProcessor.ProcessDamage ( float  damage,
List< TypedDamage typedDamages,
bool  damageApplied 
)
virtual

Processes incoming damage through the list of resistances, and outputs the final damage value

Parameters
damage
typedDamages
damageApplied
Returns

◆ ProcessKnockbackForce()

virtual Vector2 MoreMountains.CorgiEngine.DamageResistanceProcessor.ProcessKnockbackForce ( Vector2  knockback,
List< TypedDamage typedDamages 
)
virtual

Processes the input knockback force through the various resistances

Parameters
knockback
typedDamages
Returns

◆ SetResistanceByLabel()

virtual void MoreMountains.CorgiEngine.DamageResistanceProcessor.SetResistanceByLabel ( string  searchedLabel,
bool  active 
)
virtual

Enables or disables a resistance matching the searched label

Parameters
searchedLabel
active

◆ SortDamageResistanceList()

virtual void MoreMountains.CorgiEngine.DamageResistanceProcessor.SortDamageResistanceList ( )
virtual

A method used to reorder the list of resistances, based on priority by default. Don't hesitate to override this method if you'd like your resistances to be handled in a different order

Member Data Documentation

◆ AutoFillDamageResistanceList

bool MoreMountains.CorgiEngine.DamageResistanceProcessor.AutoFillDamageResistanceList = true

If this is true, this component will try to auto-fill its list of damage resistances from the ones found in its children.

◆ DamageResistanceList

List<DamageResistance> MoreMountains.CorgiEngine.DamageResistanceProcessor.DamageResistanceList

the list of damage resistances this processor will handle. Auto filled if AutoFillDamageResistanceList is true

◆ IgnoreDisabledResistances

bool MoreMountains.CorgiEngine.DamageResistanceProcessor.IgnoreDisabledResistances = true

If this is true, disabled resistances will be ignored by the auto fill.

◆ IgnoreUnknownDamageTypes

bool MoreMountains.CorgiEngine.DamageResistanceProcessor.IgnoreUnknownDamageTypes = false

If this is true, damage from damage types that this processor has no resistance for will be ignored.


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