In order to give the game some more flair, we decided that some units could have special abilities. Clerics, for example, in some media have the ability to heal themselves and their allies.
This was achieved by making an abstract class named ‘Ability’,which had an ‘aim’ function and a ‘use’ function. The aim function was used to highlight which cells this ability can be targetted on, in most cases this was a case of which cells are within the ability’s range, however some abilities could only be cast on the user, and the ‘True Shot’ can only target cells that the user cannot see.
The use function, after verifying that a valid cell had been targetted, would have an effect unique to the ability, it could be that it adjusted the health of a unit, or made the user invisible until their next turn.
This system wasn’t done as well as it could have been, as most of the abilities had their numbers (such as the range, or how long the ability lasts) hard-coded into them. If I were to make this system again I would create constructors for each ability that had each appropriate value send into them. This way the abilities could be adjusted or added to without the need to understand the code.