Table of Contents

Class AttributeBuffTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Buff template that grants bonus attributes to a character while active. Applies additive modifiers on apply/stack and removes them symmetrically on remove/unstack.

[CreateAssetMenu(fileName = "New Attribute Buff Template", menuName = "FishMMO/Character/Buff/Attribute Buff", order = 1)]
public class AttributeBuffTemplate : BaseBuffTemplate, ICachedObject, ITooltip
Inheritance
Object
ScriptableObject
AttributeBuffTemplate
Implements
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

BonusAttributes

List of bonus attributes applied by this buff.

public List<BuffAttributeTemplate> BonusAttributes

Field Value

List<BuffAttributeTemplate>

Methods

OnApply(Buff, ICharacter)

Applies the bonus attributes to the target when the buff is applied.

public override void OnApply(Buff buff, ICharacter target)

Parameters

buff Buff

The buff instance being applied.

target ICharacter

The character receiving the buff.

OnApplyStack(Buff, ICharacter)

Restates the buff's contribution at the stack count this application leaves behind.

public override void OnApplyStack(Buff buff, ICharacter target)

Parameters

buff Buff
target ICharacter

Remarks

Buff.AddStack calls this BEFORE incrementing Stacks, so the count after the operation is Stacks + 1 and the multiplier is Stacks + 2. The base class would have routed this to OnApply(Buff, ICharacter), which was correct only while modifiers accumulated; a ledger entry is restated rather than added to, so the hook has to know the post-operation count.

OnRemove(Buff, ICharacter)

Removes the bonus attributes from the target when the buff is removed.

public override void OnRemove(Buff buff, ICharacter target)

Parameters

buff Buff

The buff instance being removed.

target ICharacter

The character losing the buff.

OnRemoveStack(Buff, ICharacter)

Restates the buff's contribution after losing one stack.

public override void OnRemoveStack(Buff buff, ICharacter target)

Parameters

buff Buff
target ICharacter

Remarks

Buff.RemoveStack decrements after this returns, so the post-operation count is Stacks - 1 and the multiplier is Stacks. At the last stack that is zero, which releases the entry outright.

SecondaryTooltip(TooltipBuilder)

Appends a secondary tooltip describing the bonus attributes granted by this buff.

public override void SecondaryTooltip(TooltipBuilder builder)

Parameters

builder TooltipBuilder

The tooltip builder to populate.