Class GameplayAbility
This interfaces defines Gameplay Abilities. Gameplay Abilities represent "things" that players can cast, etc. E.g. a IGameplayAbility might represent a fireball ability which the player casts and which damages a target
Inheritance
Implements
Namespace: GameplayAbilitySystem.Abilities
Assembly: Assembly-CSharp-firstpass.dll
Syntax
public class GameplayAbility : ScriptableObject, IGameplayAbility
Properties
| Improve this Doc View SourceAbilityLogic
Defines what the ability actually does
Declaration
public AbstractAbilityActivation AbilityLogic { get; }
Property Value
| Type | Description |
|---|---|
| AbstractAbilityActivation |
GameplayCooldowns
Cooldowns associated with this ability
Declaration
public List<GameplayCooldown> GameplayCooldowns { get; }
Property Value
| Type | Description |
|---|---|
| List<GameplayCooldown> |
GameplayCost
Cost of using this ability
Declaration
public IGameplayCost GameplayCost { get; }
Property Value
| Type | Description |
|---|---|
| IGameplayCost |
OnGameplayAbilityCancelled
This is called whenever this ability is cancelled. This event does not pass on details of which IGameplayAbilitySystem was responsible for using this ability.
Declaration
public GenericAbilityEvent OnGameplayAbilityCancelled { get; }
Property Value
| Type | Description |
|---|---|
| GenericAbilityEvent |
OnGameplayAbilityCommitted
This is called whenever this ability is commited. This event does not pass on details of which IGameplayAbilitySystem was responsible for using this ability.
Declaration
public GenericAbilityEvent OnGameplayAbilityCommitted { get; }
Property Value
| Type | Description |
|---|---|
| GenericAbilityEvent |
OnGameplayAbilityEnded
This is called whenever this ability ends. This event does not pass on details of which IGameplayAbilitySystem was responsible for using this ability.
Declaration
public GenericAbilityEvent OnGameplayAbilityEnded { get; }
Property Value
| Type | Description |
|---|---|
| GenericAbilityEvent |
Tags
Tags that this ability has/provides
Declaration
public IAbilityTags Tags { get; }
Property Value
| Type | Description |
|---|---|
| IAbilityTags |
Methods
| Improve this Doc View SourceAbilityOffCooldown(IGameplayAbilitySystem)
Checks to see if the IGameplayAbilitySystem is off cooldown on the target IGameplayAbilitySystem
Declaration
public bool AbilityOffCooldown(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem | The target IGameplayAbilitySystem |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ActivateAbility(IGameplayAbilitySystem)
Activates this ability on the target IGameplayAbilitySystem
Declaration
public virtual void ActivateAbility(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem | The target IGameplayAbilitySystem |
ApplyCooldown(IGameplayAbilitySystem)
Applies cooldown. Cooldown is applied even if the ability is already on cooldown
Declaration
protected void ApplyCooldown(IGameplayAbilitySystem abilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | abilitySystem |
ApplyCost()
Applies the ability cost, decreasing the specified cost resource from the player. If player doesn't have the required resource, the resource goes to negative (or clamps to 0)
Declaration
protected void ApplyCost()
ApplyGameplayEffectToTarget(GameplayEffect, AbilitySystemComponent)
Declaration
protected void ApplyGameplayEffectToTarget(GameplayEffect effect, AbilitySystemComponent target)
Parameters
| Type | Name | Description |
|---|---|---|
| GameplayEffect | effect | |
| AbilitySystemComponent | target |
CommitAbility(IGameplayAbilitySystem)
Commits the IGameplayAbilitySystem on the target IGameplayAbilitySystem
Declaration
public bool CommitAbility(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem | The target IGameplayAbilitySystem |
Returns
| Type | Description |
|---|---|
| System.Boolean |
EndAbility(IGameplayAbilitySystem)
Ends this ability on the target IGameplayAbilitySystem
Declaration
public void EndAbility(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem | The target IGameplayAbilitySystem |
GetAbilityCooldownTags()
The cooldown tags associated with this IGameplayAbility
Declaration
public List<GameplayTag> GetAbilityCooldownTags()
Returns
| Type | Description |
|---|---|
| List<GameplayTag> |
IsAbilityActivatable(IGameplayAbilitySystem)
Check if this ability can be activated by IGameplayAbilitySystem
Declaration
public virtual bool IsAbilityActivatable(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem | The target IGameplayAbilitySystem |
Returns
| Type | Description |
|---|---|
| System.Boolean |
PlayerHasResourceToCast(IGameplayAbilitySystem)
Checks to see if the target IGameplayAbilitySystem has the required resources to cast this ability
Declaration
public bool PlayerHasResourceToCast(IGameplayAbilitySystem AbilitySystem)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameplayAbilitySystem | AbilitySystem |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the target IGameplayAbilitySystem has required resources, false otherwise |