I'm currently working on a isometric Diablo style game and I want to start implementing the combat. The combat the basic magic, melee and ranged variety with players being able to add modifiers to attacks. While I have the image in my head, I cant figure out a sound implementation method. I have some ideas and would like to hear peoples opinions on them.The "engine" I've built is Entity-Component system.
The implementation for ranged and magic is a lot more clear in my head: create entity with collision, movement and any special (timers, AI etc.) components. My collision component stores function pointers to resolver functions that just apply different effects (heal, damage etc.), so when collision does happen I just go through the vector and call them one by one. If its a special projectile, like a bomb, it would trigger a different function that creates an explosion entity.
My problem with melee is that movement of the weapon. Should I just define a set path of motion for the entity that is create and have it follow the path or somehow tie it into the animation? Aside from that it should be the same, right?
I know this is very hand-wavy and unclear, but I've been struggling with it for a week. If anyone can offer advice, suggestions or a specific methodology it would be great.