Class Ability
- Namespace
- AO
- Assembly
- CoreAssembly.dll
public abstract class Ability
- Inheritance
-
Ability
- Inherited Members
- Extension Methods
Fields
AppliedEffect
The effect applied to a target. Only set if there is a single target
public AEffect AppliedEffect
Field Value
CooldownRemaining
How much cooldown is remaining in seconds.
public float CooldownRemaining
Field Value
MaxCooldown
Tha max cooldown used to display. Will often just be set to Cooldown, but can be overridden if needed.
public float MaxCooldown
Field Value
Player
The player who owns the ability
public Player Player
Field Value
Properties
CancelableInterrupt
The interrupt value passed to the AppliedEffect when canceled. Depends on EffectIsCancelable being true.
public virtual bool CancelableInterrupt { get; }
Property Value
Cooldown
Maximum cooldown on ability activation.
public virtual float Cooldown { get; }
Property Value
DrawAimingIndicators
Whether to draw the aiming indicator while aiming this ability (if applicable).
public virtual bool DrawAimingIndicators { get; }
Property Value
Effect
The effect to apply on ability activation. This is the recommended way to use abilities.
public virtual Type Effect { get; }
Property Value
EffectIsCancelable
If true, the ability will remain activatable while monitoring the AppliedEffect. If activated, AppliedEffect will be removed with interrupt == CancelableInterrupt.
public virtual bool EffectIsCancelable { get; }
Property Value
Icon
The texture to display in the default UI
public virtual Texture Icon { get; }
Property Value
MaxDistance
The maximum distance to choose targets. Each targetting mode will use this differently.
public virtual float MaxDistance { get; }
Property Value
MaxTargets
The maximum number of allowed targets. Each targetting mode will use this differently.
public virtual int MaxTargets { get; }
Property Value
MonitorEffectDuration
If true the ability system will monitor the duration of AppliedEffect, as a secondary countdown before the cooldown is applied.
public virtual bool MonitorEffectDuration { get; }
Property Value
TargettingEffect
The effect to apply on ability activation. This is the recommended way to use abilities.
public virtual Type TargettingEffect { get; }
Property Value
TargettingMode
How the ability should choose targets.
public virtual TargettingMode TargettingMode { get; }
Property Value
Methods
CanBeginTargeting()
Called when we are trying to get into a targeting mode. Here is where you might check for resources like bullets and deny targeting if the player has no ammo. This will be called multiple times so keep it a pure function; i.e. don't deduct resources. Popping up a message with something like Notifications.Show() to tell the user why they can't begin targeting is encouraged.
public virtual bool CanBeginTargeting()
Returns
CanTarget(Player)
Called for every potential target, determines if the player is a valid target. Eg. You could filter targets based on teams here.
public abstract bool CanTarget(Player player)
Parameters
player
Player
Returns
CanUse()
Called each frame from the ability system to determine if the ability can be used.
public abstract bool CanUse()
Returns
IsOnCooldown()
public bool IsOnCooldown()
Returns
OnTryActivate(AbilityActivationInfo)
Called on ability activation. You can do whatever you want here, but we recommend using Effect instead.
public virtual bool OnTryActivate(Player.AbilityActivationInfo info)
Parameters
Returns
OnTryActivate(List<Player>, Vector2, float)
Called on ability activation. You can do whatever you want here, but we recommend using Effect instead.
public virtual bool OnTryActivate(List<Player> targetPlayers, Vector2 direction, float magnitude)