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.