Class StateBuffTemplate
Buff template that enables CharacterFlags on apply and disables them on remove. Used for crowd-control effects such as Frozen, Stunned, and Mesmerized. Flags are additive per stack: each stack enables the same flag (idempotent via bitwise OR), but removal only clears the flag when the last stack (and base) are removed.
[CreateAssetMenu(fileName = "New State Buff Template", menuName = "FishMMO/Character/Buff/State Buff", order = 2)]
public class StateBuffTemplate : BaseBuffTemplate, ICachedObject, ITooltip
- Inheritance
-
ObjectScriptableObjectStateBuffTemplate
- 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.nameObject.hideFlags
Fields
Flag
The character flag to enable while this buff is active (e.g., IsFrozen, IsStunned, IsMesmerized).
[Tooltip("The CharacterFlag to enable while this buff is active.")]
public CharacterFlags Flag
Field Value
Methods
OnApply(Buff, ICharacter)
Enables the configured CharacterFlag on the target.
public override void OnApply(Buff buff, ICharacter target)
Parameters
buffBuffThe buff instance being applied.
targetICharacterThe character receiving the buff.
OnApplyStack(Buff, ICharacter)
Stacking is idempotent for flags — the flag is already enabled. No additional action needed on stack add.
public override void OnApplyStack(Buff buff, ICharacter target)
Parameters
buffBuffThe buff instance being stacked.
targetICharacterThe character receiving the stack.
OnRemove(Buff, ICharacter)
Disables the configured CharacterFlag on the target.
public override void OnRemove(Buff buff, ICharacter target)
Parameters
buffBuffThe buff instance being removed.
targetICharacterThe character losing the buff.
OnRemoveStack(Buff, ICharacter)
Stack removal does not disable the flag until the final removal via OnRemove.
public override void OnRemoveStack(Buff buff, ICharacter target)
Parameters
buffBuffThe buff instance being unstacked.
targetICharacterThe character losing the stack.
SecondaryTooltip(TooltipBuilder)
Appends a secondary tooltip describing the state effect.
public override void SecondaryTooltip(TooltipBuilder builder)
Parameters
builderTooltipBuilderThe tooltip builder to populate.