Table of Contents

Class StatScaledValue

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Value provider that scales a character attribute's final value by a configurable factor. Reads the initiator's (or event target's) attribute and returns (int)(Attribute.FinalValue * ScaleFactor).

[Serializable]
public sealed class StatScaledValue : IIntValueProvider
Inheritance
StatScaledValue
Implements
Inherited Members

Fields

AttributeTemplateID

The character attribute to read the value from (e.g., Strength, Intelligence).

[Tooltip("The character attribute to scale from (e.g., Strength, Intelligence).")]
[TemplateReference(typeof(CharacterAttributeTemplate))]
public int AttributeTemplateID

Field Value

int

ScaleFactor

The multiplier applied to the attribute's final value.

[Tooltip("The multiplier applied to the attribute's final value.")]
public float ScaleFactor

Field Value

float

SourceSelector

Selector that determines which character's attribute to read. When unset, reads from the current event target (or initiator if no target). Uses the first selected target that has an ICharacter component.

[Tooltip("Selector that picks the source character whose attribute is read. When unset, uses the current event target or initiator.")]
[SerializeReference]
public TargetSelector SourceSelector

Field Value

TargetSelector

Methods

Describe()

Names the attribute it scales from, since the value itself depends on who is casting.

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

initiator ICharacter

The character initiating the action (used for stat lookups, etc.).

eventData EventData

The event data for the current execution (used for RNG, target info, etc.).

Returns

int

The computed integer value.