Class BaseCondition
Abstract base class for all ECA conditions. Serialized inline via [SerializeReference] on Trigger assets. Derive from this class and add [Serializable] to create concrete conditions.
Concrete classes implement Evaluate(ICharacter, EventData) with their plain pass/fail logic. Framework code (TriggerExecution, TargetSelector, CompositeCondition) should call Check(ICharacter, EventData) instead — it wraps Evaluate(ICharacter, EventData) and applies the universal Invert flag.
[Serializable]
public abstract class BaseCondition : ICondition
- Inheritance
-
BaseCondition
- Implements
- Derived
- Inherited Members
Fields
Combine
How per-target results are combined when TargetSelector yields multiple targets.
[Tooltip("Combine mode for multi-target evaluation when TargetSelector is set.")]
public ConditionTargetCombine Combine
Field Value
Invert
When true, the final result of Check(ICharacter, EventData) is logically negated. Apply this at the condition's boundary rather than open-coding inversion inside each derived class — every condition type gets the flag uniformly, and per-target Combine semantics still hold (Invert flips the aggregate, not each per-target evaluation).
[Tooltip("If true, negate this condition's final result (after multi-target Combine).")]
public bool Invert
Field Value
TargetSelector
Optional selector that picks one or more targets for this condition. When set, the condition is evaluated once per selected target and the results combined per Combine. When unset, the condition runs against the current event data (reading TargetCharacter or falling back to the initiator).
[Tooltip("Optional selector for this condition. When unset the condition runs against the current event target.")]
[SerializeReference]
public TargetSelector TargetSelector
Field Value
Methods
Check(ICharacter, EventData)
Evaluates the condition and applies Invert to the result. Framework code (TriggerExecution, TargetSelector, CompositeCondition, Ability activation checks) should call this method rather than Evaluate(ICharacter, EventData) directly so the inversion semantics stay consistent everywhere.
public bool Check(ICharacter initiator, EventData eventData = null)
Parameters
initiatorICharacterThe character initiating the check.
eventDataEventDataOptional event data for the condition.
Returns
- bool
True when the condition (after optional inversion) is satisfied.
Evaluate(ICharacter, EventData)
Evaluates the condition's raw pass/fail logic. Must be implemented by derived classes. Derived classes should NOT apply Invert themselves — the framework calls Check(ICharacter, EventData), which wraps this method and applies Invert uniformly.
public abstract bool Evaluate(ICharacter initiator, EventData eventData = null)
Parameters
initiatorICharacterThe character initiating the check.
eventDataEventDataOptional event data for the condition.
Returns
- bool
True if the underlying check passes; otherwise, false.
GetTooltipContribution()
Returns a short, designer-facing tooltip line describing this condition's effect,
or null when the condition has nothing to contribute. Override on concrete
conditions that should appear in ability/quest/dialogue tooltips (e.g. attribute
requirements, faction membership). Returning null or whitespace omits the
line entirely.
public virtual string GetTooltipContribution()
Returns
Remarks
The base implementation returns null. Aggregators
(BaseAbilityTemplate) skip null/whitespace contributions, so most
conditions need not override.