Table of Contents

Class ConsumableTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Abstract base class for consumable item templates, defining type, charge cost, and cooldown behavior. Provides logic for consuming items and applying cooldowns.

public abstract class ConsumableTemplate : BaseItemTemplate, ICachedObject, ITooltip
Inheritance
Object
ScriptableObject
ConsumableTemplate
Implements
Derived
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

ActivationTime

The time required to activate this consumable (in seconds). A value of 0 means instant activation.

public float ActivationTime

Field Value

float

ChargeCost

The number of charges consumed per use.

public uint ChargeCost

Field Value

uint

ConsumableType

The type of consumable (e.g., potion, scroll).

public ConsumableType ConsumableType

Field Value

ConsumableType

Cooldown

The cooldown duration (in seconds) applied after consumption.

public float Cooldown

Field Value

float

Methods

CanConsume(IPlayerCharacter, Item, uint)

Determines if the specified character can consume the given item. Checks for valid character, item, stackable status, sufficient charges, and cooldown.

public bool CanConsume(IPlayerCharacter character, Item item, uint currentTick)

Parameters

character IPlayerCharacter

The player character attempting to consume.

item Item

The item to be consumed.

currentTick uint

The current network tick for cooldown evaluation.

Returns

bool

True if the item can be consumed, false otherwise.

Invoke(IPlayerCharacter, Item, uint)

Attempts to consume the item, applying cooldown and reducing charges as needed. Destroys the item if charges are depleted.

public virtual bool Invoke(IPlayerCharacter character, Item item, uint currentTick)

Parameters

character IPlayerCharacter

The player character consuming the item.

item Item

The item to be consumed.

currentTick uint

The current network tick for cooldown creation.

Returns

bool

True if the item was successfully consumed, false otherwise.