AbilityManager - digocorbellini/EGaDS-Open-Project GitHub Wiki

Description

AbilityManager is a component attached to the player. The class holds and manages the abilities the player has.

Constants

  • KeyCode[] TRIGGERED_ABILITY_KEY_CODES: Defines the hotkey for each triggered ability slot
  • KeyCode[] PASSIVE_ABILITY_KEY_CODES: Defines the hotkey for each passive ability slot

Properties

  • IList<TriggeredAbility> TriggeredAbilities: The list of triggered abilities the player holds
  • IList<PassiveAbility> PassiveAbilities: The list of passive abilities the player holds
  • float SpeedMultiplier: The total multiplier applied to left-right movement speed in tiles per second.
  • float FallSpeedMultiplier: The total multiplier applied to maximum fall speed in tiles per second.
  • float WallSlideMultiplier: The total multiplier applied to wall slide speed in tiles per second
  • float JumpHeightAddend: The total number of tiles added to jump height.
  • int AirJumpAddend: The total number of air jumps.

Methods

  • bool AcquireFocus(Ability ability):
    Called by abilities to acquire the focus on themselves. When this is set, calls to AbilityUpdate() and AbilityFixedUpdate() of all other abilities will be blocked. See Focus for more info.

  • UnacquireFocus(Ability ability):
    Called by abilities to unaquire focus on themselves. AbilityUpdate() and AbilityFixedUpdate() methods of other abilities will begin to be called again. See Focus for more info.

  • bool AddAbility(Ability ability, int slotIndex):
    Adds ability at slotIndex. The type of ability will be used to infer which list it will be added to. Returns false if unable to add the ability.

  • TriggeredAbility RemoveTriggeredAbility(int slotIndex):
    Removes and returns the ability at slotIndex of the triggered ability list.

  • PassiveAbility RemovePassiveAbility(int slotIndex):
    Removes and returns the ability at slotIndex of the triggered ability list.

  • List<TriggeredAbility> SetTriggeredAbilityCount(int count):
    Sets the number of triggered ability slots and returns any abilities removed.

  • List<PassiveAbility> SetPassiveAbilityCount(int count):
    Sets the number of passive ability slots and returns any abilities removed.

⚠️ **GitHub.com Fallback** ⚠️