Submissions from 2017-10-24 to 2017-10-25 (1 total)

Got some good refactoring done so it will be easier to create abilities going forward. Here are the highlights:

  • There is now an AbilityBase class that can be derived from. It provides an interface for Begin(), Finish(), Abort(), and SetTarget(),
  • MovementAbility and AttackAbility are 2 concrete implementations of this class.
  • Multiple configurations of these abilities can be created as assets (ScriptableObjects).
  • The Player class was refactored to just have an array of AbilityBases and a reference to current ability. All actions (i.e selecting a target position) are forwarded to the current ability. This cleans up the spaghetti code that was beginning to form in the class.
    • The simple array is just a placeholder until I work out some proper UI. Right now, the "Attack" button is a misnomer and just iterates through the ability list.

Here is a GIF of creating a new instance of the AttackAbility that represents a Ranged Attack:


Going forward, I envision that things like the UI Icon and animation will be configured in the AbilityBase class. Meanwhile, things like Damage, Energy Cost, etc. will be configured in AttackAbility. More disparate abilities (buffs, using an item?) will require new concrete AbilityBase implementations, but it should all be pretty extensible and configurable. Neat!