Skip to content

Struct: DamageData ​

  • Namespace: Global
  • Assembly: Dew.Core.dll
csharp
public struct DamageData

Fields ​

NameDeclarationDescription
elementalpublic ElementalType? elemental
sourcepublic DamageData.SourceType sourceSource type of this damage.

Properties ​

NameDeclarationDescription
actorpublic readonly Actor actor { get; }
amplificationMultiplierpublic readonly float amplificationMultiplier { get; }Damage multiplier for amplications. Amplications are multiplicatively combined. This value will be multiplied to the damage after flatModifier.
attackEffectStrengthpublic readonly float attackEffectStrength { get; }Attack effect strength (0~1). If this value is above 0, this damage will trigger attack effects.
attackEffectTypepublic readonly AttackEffectType attackEffectType { get; }
attributespublic readonly DamageAttribute attributes { get; }
currentAmountpublic float currentAmount { get; }Amount of processed damage with current modifications.
damageToShieldMultiplierpublic readonly float damageToShieldMultiplier { get; }
directionpublic readonly Vector3? direction { get; }Direction of this damage.
flatModifierpublic readonly float flatModifier { get; }Flat damage modifier. This value will be added to the final damage before any other multipliers.
isBlockedByImmunitypublic readonly bool isBlockedByImmunity { get; }Is this damage currently blocked by immunity?
originalAmountpublic readonly float originalAmount { get; }Original amount of damage.
originPositionpublic readonly Vector3? originPosition { get; }Origin position of this damage.
overrideElementalStackspublic readonly int? overrideElementalStacks { get; }
procCoefficientpublic readonly float procCoefficient { get; }Proc coefficient of damage.
reductionMultiplierpublic readonly float reductionMultiplier { get; }Damage multiplier for reductions. Reductions are multiplicatively combined. This value will be multiplied to the damage after flatModifier.

Methods ​

AddFlatAmount(float) ​

Add a flat amount to this damage.

csharp
public DamageData AddFlatAmount(float amount)

Parameters:

NameTypeDescription
amountfloatThe amount to add. Must be a positive number or zero.

Returns: DamageData

ApplyAmplification(float) ​

Amplify this damage by the value specified, stacking multiplicatively.e.g. One Amplication by 0.5 will cause 50% increase in damage.Two Amplifications by 0.5 will cause 125% increase in damage.

csharp
public DamageData ApplyAmplification(float value)

Parameters:

NameTypeDescription
valuefloatAmplification value. Must be a positive number or zero.

Returns: DamageData

ApplyDamageToShieldMultiplier(float) ​

csharp
public DamageData ApplyDamageToShieldMultiplier(float multiplier)

Parameters:

NameTypeDescription
multiplierfloat

Returns: DamageData

ApplyRawMultiplier(float) ​

Apply raw multiplier to this damage's original amount.

csharp
public DamageData ApplyRawMultiplier(float multiplier)

Parameters:

NameTypeDescription
multiplierfloat

Returns: DamageData

ApplyReduction(float) ​

Reduce this damage by the value specified, stacking multiplicatively.e.g. One Reduction by 0.5 will cause 50% decrease in damage.Two Reductions by 0.5 will cause 75% decrease in damage.

csharp
public DamageData ApplyReduction(float value)

Parameters:

NameTypeDescription
valuefloatReduction value. This value will be clamped between 0 and 1.

Returns: DamageData

ApplyStrength(float) ​

Apply the given multiplier to the damage and the proc coefficient.

csharp
public DamageData ApplyStrength(float multiplier)

Parameters:

NameTypeDescription
multiplierfloat

Returns: DamageData

BlockWithImmunity() ​

Block this damage with damage immunity. Note this will be ignored ifIgnoreDamageImmunityis set to true.

csharp
public DamageData BlockWithImmunity()

Returns: DamageData

Dispatch(Entity, ReactionChain) ​

csharp
public void Dispatch(Entity victim, ReactionChain chain = default)

Parameters:

NameTypeDescription
victimEntity
chainReactionChain

DoAttackEffect(AttackEffectType, float) ​

csharp
public DamageData DoAttackEffect(AttackEffectType type, float strength = 1)

Parameters:

NameTypeDescription
typeAttackEffectType
strengthfloat

Returns: DamageData

HasAttr(DamageAttribute) ​

Does this damage has specific attribute?

csharp
public bool HasAttr(DamageAttribute attr)

Parameters:

NameTypeDescription
attrDamageAttribute

Returns: bool

IsAmountModifiedBy(Actor) ​

csharp
public bool IsAmountModifiedBy(Actor actor)

Parameters:

NameTypeDescription
actorActor

Returns: bool

IsAmountModifiedBy(Type) ​

csharp
public bool IsAmountModifiedBy(Type actorType)

Parameters:

NameTypeDescription
actorTypeSystem.Type

Returns: bool

SetActor(Actor) ​

csharp
public DamageData SetActor(Actor actor)

Parameters:

NameTypeDescription
actorActor

Returns: DamageData

SetAmountModifiedBy(Actor) ​

csharp
public DamageData SetAmountModifiedBy(Actor actor)

Parameters:

NameTypeDescription
actorActor

Returns: DamageData

SetAmountModifiedBy(Type) ​

csharp
public DamageData SetAmountModifiedBy(Type actorType)

Parameters:

NameTypeDescription
actorTypeSystem.Type

Returns: DamageData

SetAmountOrigin(FinalDamageData) ​

If amount of this damage originates from other damage, you can specify it here to make it inherit its modifier flags and attributes.

csharp
public DamageData SetAmountOrigin(FinalDamageData damage)

Parameters:

NameTypeDescription
damageFinalDamageData

Returns: DamageData

SetAmountOrigin(FinalHealData) ​

If amount of this damage originates from other heal, you can specify it here to make it inherit its modifier flags and isCrit.

csharp
public DamageData SetAmountOrigin(FinalHealData heal)

Parameters:

NameTypeDescription
healFinalHealData

Returns: DamageData

SetAttr(DamageAttribute) ​

Add special attribute for this damage.

csharp
public DamageData SetAttr(DamageAttribute attr)

Parameters:

NameTypeDescription
attrDamageAttribute

Returns: DamageData

SetDirection(Quaternion) ​

csharp
public DamageData SetDirection(Quaternion rot)

Parameters:

NameTypeDescription
rotUnityEngine.Quaternion

Returns: DamageData

SetDirection(Vector3) ​

csharp
public DamageData SetDirection(Vector3 dir)

Parameters:

NameTypeDescription
dirUnityEngine.Vector3

Returns: DamageData

SetElemental(ElementalType?) ​

csharp
public DamageData SetElemental(ElementalType? type)

Parameters:

NameTypeDescription
typeElementalType?

Returns: DamageData

SetOriginPosition(Vector3) ​

csharp
public DamageData SetOriginPosition(Vector3 pos)

Parameters:

NameTypeDescription
posUnityEngine.Vector3

Returns: DamageData

SetOverrideElementalStacks(int) ​

Set this to override number of elemental stacks this damage applies.

csharp
public DamageData SetOverrideElementalStacks(int stacks)

Parameters:

NameTypeDescription
stacksint

Returns: DamageData

SetSourceType(SourceType) ​

csharp
public DamageData SetSourceType(DamageData.SourceType type)

Parameters:

NameTypeDescription
typeDamageData.SourceType

Returns: DamageData

SubtractFlatAmount(float) ​

Subtract a flat amount from this damage.

csharp
public DamageData SubtractFlatAmount(float amount)

Parameters:

NameTypeDescription
amountfloatThe amount to subtract. Must be a positive number or zero.

Returns: DamageData

Maintained by the Shape of Dreams Modding Community