I have written a client<>server based multiplayer game and have finished the basics (it's a flash client written in actionscript 3). The next step will be implementing a system which will allow me to easily add abilities to the game.
The problem here is that an ability can do so many things. Eg. player A uses ability "repair" on player B, the following will have to happen:
- Player A sends message to server informing about the action
- Player A is now showing a "repair casted" animation on its own ship
- The server has to inform all players near that ship A now has the "repair casted" animation
- The server has to increase the "health" of player B because it has been repaired by player A
- The server has to inform all nearby players that player B now has a different health value
- The server has to inform all nearby players that player B should show the "being repaired" animation
That's just an example, a lot of things have to happen for 1 simple ability. I could go into every object and add lines of code just for this spell. However, that would become a mess when I need to add a lot (~50) abilities. Also notice that some abilities do whole other things than others, some will have to show animations, some won't. Some will have to damage, some will have to increase statistics, etc.
So, how is such "ability system" usually handled both client and server side?