Class HasResourceCondition
Condition that checks if a character has at least a required amount of a specified resource attribute (e.g., Mana, Health). Also implements IResourceCost for ability resource cost aggregation and overrides GetTooltipContribution() for tooltip display.
[Serializable]
public class HasResourceCondition : BaseCondition, ICondition, IResourceCost
- Inheritance
-
HasResourceCondition
- Implements
- Inherited Members
Fields
RequiredAmount
The minimum amount of the resource required to pass the condition.
public int RequiredAmount
Field Value
Template
The resource attribute template to check (e.g., Mana, Health).
public CharacterAttributeTemplate Template
Field Value
Methods
Evaluate(ICharacter, EventData)
Evaluates whether the character (or event target) has at least the required amount of the specified resource.
public override bool Evaluate(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character to check, or the fallback if no event target is present.
eventDataEventDataOptional event data that may provide a different character to check.
Returns
- bool
True if the character has at least the required amount of the resource; 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.