Class ActiveAbility
The base class for active (on-use) abilities.
Inherited Members
Namespace: Exiled.CustomRoles.API.Features
Assembly: Exiled.CustomRoles.dll
Syntax
public abstract class ActiveAbility : CustomAbility
Properties
| Improve this Doc View SourceActivePlayers
Gets all players actively using this ability.
Declaration
[YamlIgnore]
public HashSet<Player> ActivePlayers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<Player> |
AllActiveAbilities
Gets a System.Collections.Generic.Dictionary<TKey, TValue> containing all players with active abilities, and the abilities they have access to.
Declaration
public static Dictionary<Player, HashSet<ActiveAbility>> AllActiveAbilities { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<Player, System.Collections.Generic.HashSet<ActiveAbility>> |
CanUseOverride
Gets or sets an action to override the behavior of CanUseAbility(Player, out String, Boolean).
Declaration
[YamlIgnore]
public virtual Func<bool> CanUseOverride { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Boolean> |
Cooldown
Gets or sets how long must go between ability uses.
Declaration
public abstract float Cooldown { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Duration
Gets or sets how long the ability lasts.
Declaration
public abstract float Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
LastUsed
Gets the last time this ability was used.
Declaration
[YamlIgnore]
public Dictionary<Player, DateTime> LastUsed { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<Player, System.DateTime> |
SelectedPlayers
Gets all players who have this ability selected.
Declaration
[YamlIgnore]
public HashSet<Player> SelectedPlayers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<Player> |
Methods
| Improve this Doc View SourceAbilityAdded(Player)
Declaration
protected override void AbilityAdded(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player |
Overrides
| Improve this Doc View SourceAbilityEnded(Player)
Called when the abilities duration has ended.
Declaration
protected virtual void AbilityEnded(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player the ability has ended for. |
AbilityRemoved(Player)
Declaration
protected override void AbilityRemoved(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player |
Overrides
| Improve this Doc View SourceAbilityUsed(Player)
Called when the ability is used.
Declaration
protected virtual void AbilityUsed(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player using the ability. |
CanUseAbility(Player, out String, Boolean)
Checks to see if the ability is usable by the player.
Declaration
public virtual bool CanUseAbility(Player player, out string response, bool selectedOnly = false)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The player to check. |
System.String | response | The response to send to the player. |
System.Boolean | selectedOnly | Whether to disallow usage if the ability is not selected. |
Returns
Type | Description |
---|---|
System.Boolean | True if the ability is usable. |
Check(Player)
Checks if the specified player is using the ability.
Declaration
public override bool Check(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the player is actively using the ability. |
Overrides
| Improve this Doc View SourceCheck(Player, CheckType)
Checks if the specified Player meets certain check criteria.
Declaration
public virtual bool Check(Player player, CheckType type)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player to check. |
CheckType | type | The CheckType type of check to preform. |
Returns
Type | Description |
---|---|
System.Boolean | The results of the check. Active: Checks if the ability is currently active for the player. Selected: Checks if the player has the ability selected. Available: Checks if the player has the ability. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | This should never happen unless Joker fucks up. |
EndAbility(Player)
Ends the ability.
Declaration
public void EndAbility(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player the ability is ended for. |
SelectAbility(Player)
Selects the ability.
Declaration
public void SelectAbility(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player to select the ability. |
Selected(Player)
Called when the ability is selected.
Declaration
protected virtual void Selected(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player selecting the ability. |
ShowMessage(Player)
Called when the ability is successfully used.
Declaration
[Obsolete("The Keypress Activator will already do this, you do not need to call this unless you are overwriting the keypress activator.", true)]
protected virtual void ShowMessage(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player using the ability. |
UnSelectAbility(Player)
Un-Selects the ability.
Declaration
public void UnSelectAbility(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player to un-select the ability. |
Unselected(Player)
Called when the ability is un-selected.
Declaration
protected virtual void Unselected(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player un-selecting the ability. |
UseAbility(Player)
Uses the ability.
Declaration
public void UseAbility(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The Player using the ability. |