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
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
BuildTooltip(TooltipBuilder, List<ITooltip>)
Populates the tooltip builder with this ability's tooltip lines. Includes name, description, stats, conditions, and price. When a combine list is provided, aggregates stats and descriptions from combined events/templates.
public virtual void BuildTooltip(TooltipBuilder builder, List<ITooltip> combineList = null)
Parameters
builderTooltipBuilderThe tooltip builder to populate.
combineListList<ITooltip>Optional list of tooltips to combine (for ability crafting).
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)
Parameters
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe resource ID.
Tooltip()
Returns the tooltip string for the ability.
public virtual string Tooltip()