Table of Contents

Class ConsumeResourceAction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Action that consumes a specified amount of a resource attribute from a character. Useful for per-event resource costs (e.g., channeled abilities consuming mana per tick).

[Serializable]
public sealed class ConsumeResourceAction : BaseAction, IAction, IAbortableAction
Inheritance
ConsumeResourceAction
Implements
Inherited Members

Fields

AmountValue

The value provider that determines how much of the resource to consume.

[Tooltip("The value provider that determines how much of the resource to consume.")]
[SerializeReference]
public IIntValueProvider AmountValue

Field Value

IIntValueProvider

ResourceTemplateID

The character attribute template representing the resource to consume (e.g., Mana, Stamina).

[Tooltip("The resource attribute to consume.")]
[TemplateReference(typeof(CharacterAttributeTemplate))]
public int ResourceTemplateID

Field Value

int

Methods

Execute(ICharacter, EventData)

Executes the action, consuming the specified resource from the target character. Prefer TryExecute(ICharacter, EventData) for fail-fast chains (set StopChainOnFailure to abort follow-up actions when the resource is insufficient).

public override void Execute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter
eventData EventData

TryExecute(ICharacter, EventData)

Attempts to consume the configured resource. Returns false when the template/amount configuration is invalid or when the target lacks sufficient resource.

public bool TryExecute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter
eventData EventData

Returns

bool