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
NeutralPlayersOnly
With ApplyToNeutral: a neutral target passes only if it is a player character. Wildlife, neutral NPCs and pets read as neutral too, and a heal meant for a stranger must not mend a wolf mid-fight.
[Tooltip("With Apply To Neutral: only neutral PLAYERS pass (not wildlife, neutral NPCs or pets).")]
public bool NeutralPlayersOnly
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.
Passes(FactionAllianceLevel, FactionAllianceLevel, bool)
The rule with the aggression toggle taken into account: hostile reach (ApplyToEnemy) reads the level the
toggle widens (allianceLevel, a neutral reads as Enemy while either side's aggression is on), and
the neutral and ally reach reads the standing without it (standing).
public bool Passes(FactionAllianceLevel allianceLevel, FactionAllianceLevel standing, bool defenderIsPlayer)
Parameters
allianceLevelFactionAllianceLevelstandingFactionAllianceLeveldefenderIsPlayerbool
Returns
Remarks
With a single level, turning aggression on made every neutral player an Enemy to a heal or cleanse that reaches neutral players, so Lesser Heal and Dispel Magic stopped landing on them. Damage that reaches enemies and neutrals passes either way; damage that reaches enemies only still widens to neutrals with the toggle.
Passes(FactionAllianceLevel, bool)
The rule for a target other than the initiator, as a pure function of how the two stand and whether the target is a player character.
public bool Passes(FactionAllianceLevel allianceLevel, bool defenderIsPlayer)
Parameters
allianceLevelFactionAllianceLeveldefenderIsPlayerbool