Class BaseAbilityTemplate
Abstract base ScriptableObject for ability templates, providing common fields, activation conditions, and tooltip logic. Ability requirements (resources, faction, archetype, attributes) are defined as ECA conditions on the ActivationConditions list rather than as hardcoded fields.
public abstract class BaseAbilityTemplate : CachedScriptableObject<BaseAbilityTemplate>, ICachedObject, ITooltip
- Inheritance
-
ObjectScriptableObjectBaseAbilityTemplate
- 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
ActivationConditions
Conditions that must be met to activate this ability. Use ECA conditions such as HasResourceCondition, HasRequiredAttribute, HasFactionCondition, and IsArchetypeCondition to define activation requirements. Resource conditions implementing IResourceCost are aggregated for total cost validation.
[Header("Activation Conditions")]
[Tooltip("Conditions that must be met to activate this ability (resource costs, attribute requirements, faction, archetype, etc.).")]
[SerializeReference]
public List<BaseCondition> ActivationConditions
Field Value
ActivationTime
Time required to activate the ability.
[Min(0)]
public float ActivationTime
Field Value
Remarks
Clamped at zero in the inspector. An ability's activation window is
ceil(ActivationTime / TickDelta) assigned to an unsigned tick counter, so a
negative value authored here does not mean "instant" — it produces a negative ceiling
that wraps to a cast of roughly four billion ticks that never finishes. Zero is a
legitimate value and means instant; anything below it is only ever a typo.
Cooldown
Cooldown time for the ability.
public float Cooldown
Field Value
Description
Description of the ability.
public string Description
Field Value
LifeTime
Lifetime of the ability effect.
public float LifeTime
Field Value
Price
Crafting price of the ability (in-game currency).
public int Price
Field Value
Speed
Speed of the ability effect.
public float Speed
Field Value
Properties
Icon
The icon representing the ability (loaded at runtime on client).
public Sprite Icon { get; }
Property Value
- Sprite
Name
The name of the ability (from the ScriptableObject name).
public string Name { get; }
Property Value
Methods
AppendConditions(TooltipContent, List<BaseCondition>)
Writes a condition list as resource costs and requirements.
public static void AppendConditions(TooltipContent content, List<BaseCondition> conditions)
Parameters
contentTooltipContentThe content being assembled.
conditionsList<BaseCondition>The conditions to describe.
Remarks
Shared by every template and event that carries conditions, so a resource cost reads the same wherever it is written. Conditions implementing IResourceCost are costs; everything else with wording is a requirement.
BuildTooltip(TooltipContent)
Writes this template's own description: what it is, what it costs, what it needs.
public virtual void BuildTooltip(TooltipContent content)
Parameters
contentTooltipContentThe content being assembled.
Remarks
Only the template itself. A base ability that a player will craft effects onto is described by AbilitySummary, which knows about the effects bundled into the template as well as the ones the player chose — this override serves the plain templates that are not abilities, such as an ability-type override event.
OnLoad(string, string, int)
Called when the ability template is loaded into cache. Loads the icon sprite on the client.
public override void OnLoad(string typeName, string resourceName, int resourceID)
Parameters
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe resource ID.
OnUnload(string, string, int)
Called when the ability template is unloaded from cache. Releases the icon sprite on the client.
public override void OnUnload(string typeName, string resourceName, int resourceID)