Class TargetAllianceCondition
Condition that checks the alliance relationship between the initiator and the target (defender). Allows configuration for which alliance types (self, enemy, neutral, ally) the condition applies to.
[Serializable]
public sealed class TargetAllianceCondition : BaseCondition, ICondition
- Inheritance
-
TargetAllianceCondition
- Implements
- Inherited Members
Fields
ApplyToAllies
Whether the condition applies to allies.
public bool ApplyToAllies
Field Value
ApplyToEnemy
Whether the condition applies to enemies (default: true).
public bool ApplyToEnemy
Field Value
ApplyToNeutral
Whether the condition applies to neutral targets.
public bool ApplyToNeutral
Field Value
ApplyToSelf
Whether the condition applies when the initiator targets themselves.
public bool ApplyToSelf
Field Value
Methods
Evaluate(ICharacter, EventData)
Evaluates whether the condition applies based on the alliance relationship between initiator and target.
public override bool Evaluate(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action or condition.
eventDataEventDataEvent data containing the target character.
Returns
- bool
True if the alliance relationship matches the allowed types; otherwise, false.
Remarks
This method checks the target's alliance level (enemy, neutral, ally, or self) and returns true if the corresponding flag is enabled.