Class ChargeStageValue
A value chosen by how far a staged charge was held (ChargeStages): one entry per stage.
[Serializable]
public sealed class ChargeStageValue : IIntValueProvider
- Inheritance
-
ChargeStageValue
- Implements
- Inherited Members
Remarks
The stage is read from the ability object the event belongs to (ChargeStage), or from the ability itself on a spawn chain (ChargeStage). Anything without a stage reads as stage 1, so the provider is safe on an ordinary ability too.
Fields
PerStage
The value at each stage, from stage 1.
[Tooltip("The value at each charge stage, from stage 1. A stage past the end uses the last entry.")]
public int[] PerStage
Field Value
- int[]
Methods
Describe()
Describes the value in words, without a character or an event to compute it against.
public string Describe()
Returns
- string
The description, or null when the value is only knowable at execution time.
Remarks
A tooltip is written long before anything is cast, so it cannot call GetValue(ICharacter, EventData) — there is no initiator, no target and no RNG stream. A provider that knows its own numbers can still say what they are ("18 - 24"), and one that cannot returns null so the caller writes nothing rather than a placeholder.
On the interface rather than in a switch statement somewhere in the UI, because a new provider should have to answer this to compile.
GetValue(ICharacter, EventData)
Computes and returns the integer value for the current execution context.
public int GetValue(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action (used for stat lookups, etc.).
eventDataEventDataThe event data for the current execution (used for RNG, target info, etc.).
Returns
- int
The computed integer value.
IndexOf(byte, int)
The array index for stage in a table of length entries.
public static int IndexOf(byte stage, int length)
Parameters
Returns
StageOf(EventData)
The charge stage an event was cast at, from 1 (1 when it carries none).
public static byte StageOf(EventData eventData)
Parameters
eventDataEventData