Class HasRequiredAttribute
Condition that checks if a character has a required value for a specified attribute, with optional inversion.
[Serializable]
public class HasRequiredAttribute : BaseCondition, ICondition
- Inheritance
-
HasRequiredAttribute
- Implements
- Inherited Members
Fields
RequiredValue
The minimum value the character's attribute must have to pass the condition.
[Tooltip("The minimum FinalValue the character's attribute must have.")]
public int RequiredValue
Field Value
Template
[Header("Stat Requirements")]
[Tooltip("The name of the attribute (e.g., 'Strength', 'Health', 'Mana').")]
public CharacterAttributeTemplate Template
Field Value
Methods
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 override bool Evaluate(ICharacter initiator, EventData eventData)
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 override string GetTooltipContribution()
Returns
Remarks
The base implementation returns null. Aggregators
(BaseAbilityTemplate) skip null/whitespace contributions, so most
conditions need not override.