Class AbilityTemplate
ScriptableObject template for defining an ability, including prefabs, triggers, event lists, and requirements.
[CreateAssetMenu(fileName = "New Ability", menuName = "FishMMO/Character/Ability/Ability", order = 1)]
public class AbilityTemplate : BaseAbilityTemplate, ICachedObject, ITooltip
- Inheritance
-
ObjectScriptableObjectAbilityTemplate
- Implements
- Derived
- 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
- Extension Methods
Fields
AbilityObjectPrefab
The prefab for the ability object (visual or functional representation).
public GameObject AbilityObjectPrefab
Field Value
- GameObject
AbilitySpawnTarget
The spawn target type for the ability (where the ability effect appears).
public AbilitySpawnTarget AbilitySpawnTarget
Field Value
AdditionalEventSlots
Additional event slots for the ability (for extensibility).
public byte AdditionalEventSlots
Field Value
HitCount
The number of times the ability can hit (e.g., for multi-hit abilities).
public int HitCount
Field Value
IntentOverride
Forces this ability's AI intent instead of deriving it from the action graph.
[Header("AI")]
[Tooltip("Leave as None. Only set this when the AI misreads what the ability does — it replaces the derived intent entirely.")]
public AIAbilityIntent IntentOverride
Field Value
Remarks
Leave at None for the normal case. AIAbilityClassifier reads the ECA actions the ability already carries and works out whether it heals, damages, controls or taunts, so archetypes never name specific abilities.
The override exists for the two cases classification cannot get right on its own: a custom action type it has never heard of, and a buff whose beneficial-or-detrimental nature the attribute-sign heuristic reads backwards. Setting it replaces the derived value entirely rather than adding to it.
OnDestroyEvents
[Tooltip("Ability Events to execute when the ability object is destroyed.")]
public List<AbilityOnDestroyEvent> OnDestroyEvents
Field Value
OnHitEvents
[Tooltip("Ability Events to execute when the ability object collides or hits a character.")]
public List<AbilityOnHitEvent> OnHitEvents
Field Value
OnPreSpawnEvents
[Tooltip("Ability Events to execute before the primary ability object is spawned.")]
public List<AbilityOnPreSpawnEvent> OnPreSpawnEvents
Field Value
OnSpawnEvents
[Tooltip("Ability Events to execute when the primary ability object is spawned.")]
public List<AbilityOnSpawnEvent> OnSpawnEvents
Field Value
OnTickEvents
[Header("Event-Condition-Action (ECA) Triggers")]
[Tooltip("Ability Events to execute when the ability object 'ticks' (e.g., moves, applies continuous effects).")]
public List<AbilityOnTickEvent> OnTickEvents
Field Value
RequiresTarget
Whether the ability requires a target to be used.
public bool RequiresTarget
Field Value
Type
The type of the ability (e.g., offensive, defensive, utility).
public AbilityType Type
Field Value
Methods
BuildTooltip(TooltipContent)
Describes the ability as it would exist with only the effects this template ships with.
public override void BuildTooltip(TooltipContent content)
Parameters
contentTooltipContentThe content being assembled.
Remarks
Composed rather than read off the fields. The template's own numbers are not the ability's numbers: the events bundled into it contribute cast time, cooldown, speed and lifetime too, and a tooltip that ignored them advertised a fireball with none of the speed its bundled movement effect supplies. AbilitySummary is the one place that composition happens.
GetAllAbilityEventIDs()
Returns a cached list of all unique event IDs from all event lists on this template.
public List<int> GetAllAbilityEventIDs()