Class ApplyDamageAction
Action that applies damage to a target character using a configurable value provider and a given damage attribute type.
Runs on the server, and on the client that OWNS the initiator — see MayPredict(ICharacter, EventData). The caster draws its own number immediately through PredictedCombatEvents rather than waiting half a round trip for the server's report; the server's report then confirms it, or the prediction is greyed out when none arrives. Observers still wait to be told.
[Serializable]
public class ApplyDamageAction : BaseAction, IAction
- Inheritance
-
ApplyDamageAction
- Implements
- Inherited Members
Fields
DamageAttributeTemplate
The attribute template associated with this damage type (e.g., 'Physical', 'Fire'). Used to determine the element or type of damage applied.
[Tooltip("The attribute template associated with this damage type (e.g., 'Physical', 'Fire').")]
public DamageAttributeTemplate DamageAttributeTemplate
Field Value
DamageValue
The value provider that determines the amount of damage to apply.
[Tooltip("The value provider that determines the amount of damage to apply.")]
[SerializeReference]
public IIntValueProvider DamageValue
Field Value
Methods
Execute(ICharacter, EventData)
Applies damage to the target character using the computed value and attribute template. Runs on the server and on the client that owns the initiator — see the note on the class.
public override void Execute(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action.
eventDataEventDataThe event data containing the target information.
GetTooltipContribution()
Says how much damage of what kind, in the ability's own colour.
public override string GetTooltipContribution()
Returns
- string
The wording, or null when neither the amount nor the type is known.
Remarks
This was null, inherited from BaseAction — so the single most
important thing an offensive ability does was absent from its tooltip. A "Lesser Fire
Damage" effect described itself with nothing but its name.
The colour comes from the damage type's own DisplayColor, which is data the
content already carries and which the floating combat numbers already use, so a fire
effect reads as fire in both places.