Table of Contents

Class HasResourceCondition

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

int

Template

The resource attribute template to check (e.g., Mana, Health).

public CharacterAttributeTemplate Template

Field Value

CharacterAttributeTemplate

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

initiator ICharacter

The character to check, or the fallback if no event target is present.

eventData EventData

Optional 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

string

Remarks

The base implementation returns null. Aggregators (BaseAbilityTemplate) skip null/whitespace contributions, so most conditions need not override.