Table of Contents

Class TargetAllianceCondition

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

bool

ApplyToEnemy

Whether the condition applies to enemies (default: true).

public bool ApplyToEnemy

Field Value

bool

ApplyToNeutral

Whether the condition applies to neutral targets.

public bool ApplyToNeutral

Field Value

bool

ApplyToSelf

Whether the condition applies when the initiator targets themselves.

public bool ApplyToSelf

Field Value

bool

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

bool

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

initiator ICharacter

The character initiating the action or condition.

eventData EventData

Event 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

allianceLevel FactionAllianceLevel
standing FactionAllianceLevel
defenderIsPlayer bool

Returns

bool

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

allianceLevel FactionAllianceLevel
defenderIsPlayer bool

Returns

bool