Table of Contents

Class CharacterAttributeTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll
[CreateAssetMenu(fileName = "New Character Attribute", menuName = "FishMMO/Character/Attribute/Character Attribute", order = 1)]
public class CharacterAttributeTemplate : CachedScriptableObject<CharacterAttributeTemplate>, ICachedObject, ITooltip
Inheritance
Object
ScriptableObject
CharacterAttributeTemplate
Implements
Derived
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.MemberwiseClone()
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
Extension Methods

Fields

ChildTypes

Set of child attribute types (attributes this one depends on for formulas).

public CharacterAttributeTemplate.CharacterAttributeSet ChildTypes

Field Value

CharacterAttributeTemplate.CharacterAttributeSet

ClampFinalValue

If true, the final value of this attribute is clamped between MinValue and MaxValue.

public bool ClampFinalValue

Field Value

bool

DependantTypes

Set of dependant attribute types (additional dependencies for complex relationships).

public CharacterAttributeTemplate.CharacterAttributeSet DependantTypes

Field Value

CharacterAttributeTemplate.CharacterAttributeSet

Description

A description of the attribute, used for tooltips and UI.

public string Description

Field Value

string

Formulas

Dictionary of formulas defining how each child attribute affects this attribute.

public CharacterAttributeTemplate.CharacterAttributeFormulaDictionary Formulas

Field Value

CharacterAttributeTemplate.CharacterAttributeFormulaDictionary

InitialValue

The initial (base) value for this attribute when a character is created.

public int InitialValue

Field Value

int

IsPercentage

If true, this attribute is treated as a percentage (e.g., 0-100%).

public bool IsPercentage

Field Value

bool

IsResourceAttribute

If true, this attribute is a resource (e.g., health, mana) that can be consumed or regenerated.

public bool IsResourceAttribute

Field Value

bool

MaxValue

The maximum value this attribute can have (used for clamping).

public int MaxValue

Field Value

int

MinValue

The minimum value this attribute can have (used for clamping).

public int MinValue

Field Value

int

ParentTypes

Set of parent attribute types (attributes that depend on this one).

public CharacterAttributeTemplate.CharacterAttributeSet ParentTypes

Field Value

CharacterAttributeTemplate.CharacterAttributeSet

Properties

Icon

Attributes carry no icon of their own; the bars and rows that show them supply theirs.

public Sprite Icon { get; }

Property Value

Sprite

Remarks

Declared because ITooltip asks for one. An attribute is describable — the resource bars and the character sheet hover it — and it could not satisfy the interface without this, which is why it was the one producer left outside the tooltip system.

InitialValueAsPct

Returns the initial value as a percentage (InitialValue * 0.01f).

public float InitialValueAsPct { get; }

Property Value

float

Name

The display name of the attribute (from the ScriptableObject's name).

public string Name { get; }

Property Value

string

Methods

BuildTooltip(TooltipContent)

Describes the attribute: what it is and the range it lives in.

public void BuildTooltip(TooltipContent content)

Parameters

content TooltipContent

The content being assembled.

FormatValue(int)

Formats a value in this attribute's own unit, signed.

public string FormatValue(int value)

Parameters

value int

The value to format, in this attribute's own unit.

Returns

string

The value with its sign and its unit suffix.

Remarks

Every tooltip that writes one of these values — an attribute's own sheet numbers, the bonus an AttributeBuffTemplate grants, a modifier a CompositeBuffTemplate carries — goes through here, because the value alone is ambiguous in a way that is easy to author and impossible to notice. A percentage attribute's value is in percentage POINTS (InitialValueAsPct divides by 100), so a movement-speed buff authored as 30 means "+30%"; printed raw it reads as "30", which is a plausible-looking number and wrong by two orders of magnitude.

The sign is always written, so a modifier is legible as a modifier rather than as an absolute value that happens to sit in a "Bonus Attributes" block.