Corgi Engine  v9.1
MoreMountains.CorgiEngine.DamageResistance Class Reference

Used by the DamageResistanceProcessor, this class defines the resistance versus a certain type of damage. More...

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

Public Types

enum  DamageModifierModes { DamageModifierModes.Multiplier, DamageModifierModes.Flat }
 
enum  KnockbackModifierModes { KnockbackModifierModes.Multiplier, KnockbackModifierModes.Flat }
 

Public Member Functions

virtual float ProcessDamage (float damage, DamageType type, bool damageApplied)
 When getting damage, goes through damage reduction and outputs the resulting damage More...
 
virtual Vector2 ProcessKnockback (Vector2 knockback, DamageType type)
 Processes the knockback input value and returns it potentially modified by damage resistances More...
 

Public Attributes

float Priority = 0
 The priority of this damage resistance. This will be used to determine in what order damage resistances should be evaluated. Lowest priority means evaluated first. More...
 
string Label = ""
 The label of this damage resistance. Used for organization, and to activate/disactivate a resistance by its label. More...
 
DamageTypeModes DamageTypeMode = DamageTypeModes.BaseDamage
 Whether this resistance impacts base damage or typed damage. More...
 
DamageType TypeResistance
 In TypedDamage mode, the type of damage this resistance will interact with. More...
 
DamageModifierModes DamageModifierMode = DamageModifierModes.Multiplier
 the way to reduce (or increase) received damage. Multiplier will multiply incoming damage by a multiplier, flat will subtract a constant value from incoming damage. More...
 
float DamageMultiplier = 0.25f
 In multiplier mode, the multiplier to apply to incoming damage. 0.5 will reduce it in half, while a value of 2 will create a weakness to the specified damage type, and damages will double. More...
 
float FlatDamageReduction = 10f
 In flat mode, the amount of damage to subtract every time that type of damage is received. More...
 
bool ClampDamage = false
 whether or not incoming damage of the specified type should be clamped between a min and a max More...
 
Vector2 DamageModifierClamps = new Vector2(0f,10f)
 the values between which to clamp incoming damage More...
 
bool PreventCharacterConditionChange = false
 whether or not condition change for that type of damage is allowed or not More...
 
bool PreventMovementModifier = false
 whether or not movement modifiers are allowed for that type of damage or not More...
 
bool ImmuneToKnockback = false
 if this is true, knockback force will be ignored and not applied More...
 
KnockbackModifierModes KnockbackModifierMode = KnockbackModifierModes.Multiplier
 the way to reduce (or increase) received knockback. Multiplier will multiply incoming knockback intensity by a multiplier, flat will subtract a constant value from incoming knockback intensity. More...
 
float KnockbackMultiplier = 1f
 In multiplier mode, the multiplier to apply to incoming knockback. 0.5 will reduce it in half, while a value of 2 will create a weakness to the specified damage type, and knockback intensity will double. More...
 
float FlatKnockbackMagnitudeReduction = 10f
 In flat mode, the amount of knockback to subtract every time that type of damage is received. More...
 
bool ClampKnockback = false
 whether or not incoming knockback of the specified type should be clamped between a min and a max More...
 
float KnockbackMaxMagnitude = 10f
 the values between which to clamp incoming knockback magnitude More...
 
MMFeedbacks OnDamageReceived
 This feedback will only be triggered if damage of the matching type is received. More...
 
bool InterruptibleFeedback = false
 whether or not this feedback can be interrupted (stopped) when that type of damage is interrupted More...
 
bool AlwaysInterruptFeedbackBeforePlay = false
 if this is true, the feedback will always be preventively stopped before playing More...
 
bool TriggerFeedbackIfDamageIsZero = false
 whether this feedback should play if damage received is zero More...
 

Protected Member Functions

virtual void Awake ()
 On awake we initialize our feedback More...
 

Detailed Description

Used by the DamageResistanceProcessor, this class defines the resistance versus a certain type of damage.

Member Enumeration Documentation

◆ DamageModifierModes

Enumerator
Multiplier 
Flat 

◆ KnockbackModifierModes

Enumerator
Multiplier 
Flat 

Member Function Documentation

◆ Awake()

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

On awake we initialize our feedback

◆ ProcessDamage()

virtual float MoreMountains.CorgiEngine.DamageResistance.ProcessDamage ( float  damage,
DamageType  type,
bool  damageApplied 
)
virtual

When getting damage, goes through damage reduction and outputs the resulting damage

Parameters
damage
type
damageApplied
Returns
Exceptions
ArgumentOutOfRangeException

◆ ProcessKnockback()

virtual Vector2 MoreMountains.CorgiEngine.DamageResistance.ProcessKnockback ( Vector2  knockback,
DamageType  type 
)
virtual

Processes the knockback input value and returns it potentially modified by damage resistances

Parameters
damage
type
damageApplied
Returns
Exceptions
ArgumentOutOfRangeException

Member Data Documentation

◆ AlwaysInterruptFeedbackBeforePlay

bool MoreMountains.CorgiEngine.DamageResistance.AlwaysInterruptFeedbackBeforePlay = false

if this is true, the feedback will always be preventively stopped before playing

◆ ClampDamage

bool MoreMountains.CorgiEngine.DamageResistance.ClampDamage = false

whether or not incoming damage of the specified type should be clamped between a min and a max

◆ ClampKnockback

bool MoreMountains.CorgiEngine.DamageResistance.ClampKnockback = false

whether or not incoming knockback of the specified type should be clamped between a min and a max

◆ DamageModifierClamps

Vector2 MoreMountains.CorgiEngine.DamageResistance.DamageModifierClamps = new Vector2(0f,10f)

the values between which to clamp incoming damage

◆ DamageModifierMode

DamageModifierModes MoreMountains.CorgiEngine.DamageResistance.DamageModifierMode = DamageModifierModes.Multiplier

the way to reduce (or increase) received damage. Multiplier will multiply incoming damage by a multiplier, flat will subtract a constant value from incoming damage.

◆ DamageMultiplier

float MoreMountains.CorgiEngine.DamageResistance.DamageMultiplier = 0.25f

In multiplier mode, the multiplier to apply to incoming damage. 0.5 will reduce it in half, while a value of 2 will create a weakness to the specified damage type, and damages will double.

◆ DamageTypeMode

DamageTypeModes MoreMountains.CorgiEngine.DamageResistance.DamageTypeMode = DamageTypeModes.BaseDamage

Whether this resistance impacts base damage or typed damage.

◆ FlatDamageReduction

float MoreMountains.CorgiEngine.DamageResistance.FlatDamageReduction = 10f

In flat mode, the amount of damage to subtract every time that type of damage is received.

◆ FlatKnockbackMagnitudeReduction

float MoreMountains.CorgiEngine.DamageResistance.FlatKnockbackMagnitudeReduction = 10f

In flat mode, the amount of knockback to subtract every time that type of damage is received.

◆ ImmuneToKnockback

bool MoreMountains.CorgiEngine.DamageResistance.ImmuneToKnockback = false

if this is true, knockback force will be ignored and not applied

◆ InterruptibleFeedback

bool MoreMountains.CorgiEngine.DamageResistance.InterruptibleFeedback = false

whether or not this feedback can be interrupted (stopped) when that type of damage is interrupted

◆ KnockbackMaxMagnitude

float MoreMountains.CorgiEngine.DamageResistance.KnockbackMaxMagnitude = 10f

the values between which to clamp incoming knockback magnitude

◆ KnockbackModifierMode

KnockbackModifierModes MoreMountains.CorgiEngine.DamageResistance.KnockbackModifierMode = KnockbackModifierModes.Multiplier

the way to reduce (or increase) received knockback. Multiplier will multiply incoming knockback intensity by a multiplier, flat will subtract a constant value from incoming knockback intensity.

◆ KnockbackMultiplier

float MoreMountains.CorgiEngine.DamageResistance.KnockbackMultiplier = 1f

In multiplier mode, the multiplier to apply to incoming knockback. 0.5 will reduce it in half, while a value of 2 will create a weakness to the specified damage type, and knockback intensity will double.

◆ Label

string MoreMountains.CorgiEngine.DamageResistance.Label = ""

The label of this damage resistance. Used for organization, and to activate/disactivate a resistance by its label.

◆ OnDamageReceived

MMFeedbacks MoreMountains.CorgiEngine.DamageResistance.OnDamageReceived

This feedback will only be triggered if damage of the matching type is received.

◆ PreventCharacterConditionChange

bool MoreMountains.CorgiEngine.DamageResistance.PreventCharacterConditionChange = false

whether or not condition change for that type of damage is allowed or not

◆ PreventMovementModifier

bool MoreMountains.CorgiEngine.DamageResistance.PreventMovementModifier = false

whether or not movement modifiers are allowed for that type of damage or not

◆ Priority

float MoreMountains.CorgiEngine.DamageResistance.Priority = 0

The priority of this damage resistance. This will be used to determine in what order damage resistances should be evaluated. Lowest priority means evaluated first.

◆ TriggerFeedbackIfDamageIsZero

bool MoreMountains.CorgiEngine.DamageResistance.TriggerFeedbackIfDamageIsZero = false

whether this feedback should play if damage received is zero

◆ TypeResistance

DamageType MoreMountains.CorgiEngine.DamageResistance.TypeResistance

In TypedDamage mode, the type of damage this resistance will interact with.


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