TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.DamageResistance Class Reference

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

Inheritance diagram for MoreMountains.TopDownEngine.DamageResistance:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  DamageModifierModes { Multiplier , Flat }
enum  KnockbackModifierModes { Multiplier , 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.
virtual Vector3 ProcessKnockback (Vector3 knockback, DamageType type)
 Processes the knockback input value and returns it potentially modified by damage resistances.

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.
string Label = ""
 The label of this damage resistance. Used for organization, and to activate/disactivate a resistance by its label.
DamageTypeModes DamageTypeMode = DamageTypeModes.BaseDamage
 Whether this resistance impacts base damage or typed damage.
DamageType TypeResistance
 In TypedDamage mode, the type of damage this resistance will interact with.
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.
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.
float FlatDamageReduction = 10f
 In flat mode, the amount of damage to subtract every time that type of damage is received.
bool ClampDamage = false
 whether or not incoming damage of the specified type should be clamped between a min and a max
Vector2 DamageModifierClamps = new Vector2(0f,10f)
 the values between which to clamp incoming damage
bool PreventCharacterConditionChange = false
 whether or not condition change for that type of damage is allowed or not
bool PreventMovementModifier = false
 whether or not movement modifiers are allowed for that type of damage or not
bool ImmuneToKnockback = false
 if this is true, knockback force will be ignored and not applied
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.
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.
float FlatKnockbackMagnitudeReduction = 10f
 In flat mode, the amount of knockback to subtract every time that type of damage is received.
bool ClampKnockback = false
 whether or not incoming knockback of the specified type should be clamped between a min and a max
float KnockbackMaxMagnitude = 10f
 the values between which to clamp incoming knockback magnitude
MMFeedbacks OnDamageReceived
 This feedback will only be triggered if damage of the matching type is received.
bool InterruptibleFeedback = false
 whether or not this feedback can be interrupted (stopped) when that type of damage is interrupted
bool AlwaysInterruptFeedbackBeforePlay = false
 if this is true, the feedback will always be preventively stopped before playing
bool TriggerFeedbackIfDamageIsZero = false
 whether this feedback should play if damage received is zero

Protected Member Functions

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

Detailed Description

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

Member Enumeration Documentation

◆ DamageModifierModes

◆ KnockbackModifierModes

Member Function Documentation

◆ Awake()

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

On awake we initialize our feedback.

◆ ProcessDamage()

virtual float MoreMountains.TopDownEngine.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 Vector3 MoreMountains.TopDownEngine.DamageResistance.ProcessKnockback ( Vector3 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.TopDownEngine.DamageResistance.AlwaysInterruptFeedbackBeforePlay = false

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

◆ ClampDamage

bool MoreMountains.TopDownEngine.DamageResistance.ClampDamage = false

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

◆ ClampKnockback

bool MoreMountains.TopDownEngine.DamageResistance.ClampKnockback = false

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

◆ DamageModifierClamps

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

the values between which to clamp incoming damage

◆ DamageModifierMode

DamageModifierModes MoreMountains.TopDownEngine.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.TopDownEngine.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.TopDownEngine.DamageResistance.DamageTypeMode = DamageTypeModes.BaseDamage

Whether this resistance impacts base damage or typed damage.

◆ FlatDamageReduction

float MoreMountains.TopDownEngine.DamageResistance.FlatDamageReduction = 10f

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

◆ FlatKnockbackMagnitudeReduction

float MoreMountains.TopDownEngine.DamageResistance.FlatKnockbackMagnitudeReduction = 10f

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

◆ ImmuneToKnockback

bool MoreMountains.TopDownEngine.DamageResistance.ImmuneToKnockback = false

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

◆ InterruptibleFeedback

bool MoreMountains.TopDownEngine.DamageResistance.InterruptibleFeedback = false

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

◆ KnockbackMaxMagnitude

float MoreMountains.TopDownEngine.DamageResistance.KnockbackMaxMagnitude = 10f

the values between which to clamp incoming knockback magnitude

◆ KnockbackModifierMode

KnockbackModifierModes MoreMountains.TopDownEngine.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.TopDownEngine.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.TopDownEngine.DamageResistance.Label = ""

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

◆ OnDamageReceived

MMFeedbacks MoreMountains.TopDownEngine.DamageResistance.OnDamageReceived

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

◆ PreventCharacterConditionChange

bool MoreMountains.TopDownEngine.DamageResistance.PreventCharacterConditionChange = false

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

◆ PreventMovementModifier

bool MoreMountains.TopDownEngine.DamageResistance.PreventMovementModifier = false

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

◆ Priority

float MoreMountains.TopDownEngine.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.TopDownEngine.DamageResistance.TriggerFeedbackIfDamageIsZero = false

whether this feedback should play if damage received is zero

◆ TypeResistance

DamageType MoreMountains.TopDownEngine.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:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/Health/DamageResistance.cs