I'm developing a Pokémon/classic Final Fantasy inspired game, in the sense that game play consists in many creatures, possessing many moves with different effects (attacking, healing, buffing, debuffing, etc) taking turns fighting each other.
I'm having some doubts on how to implement the movement system, especially the part of how to organize the code responsible for the effects of the move.
Some important characteristics of the system:
- Creatures should be able to learn and forget moves
- All moves can be learned by more than one creature
I have come up with some ideas, but none seem very good. Is there any known standard in the industry for doing this, or any known optimal solutions?
Here are the ideas I had:
- Every move inherits from an abstract class Move, overriding an execute() method.
A MoveProcessor class, containing a method executeMove(), called every time any move is made, receiving the move id code. Something like:
switch(moveCode){ case 1: //Attack code break; case 2: //Heal code break; //... }
I am developing in Unity and C#, but answers need not be specific to said platform and language.
Please note that this is not a duplicate of Modeling what moves a pokemon can learn or Storing data for a pokemon-like game, since those questions ask about storing move information, not implementation.