After refactoring major parts of the actual game logic (using potions, casting spells, inflicting status effects like "burn" or "frozen"), I'm reimplementing the combat system.
At the moment, most actions like attacking, using a potion or a spell, or even interacting with the environment (e.g. moving a barrier) is executed with a slight delay: The animation is started immediately, the actual action (as ItemEvent, SpellEvent etc.) is sent to a delay system. It will delay the event some milliseconds and finally forward it to the actual system that is handling the event.
Example: The player presses an action button. An ActionEvent is sent from the Input- to the ActionSystem to check e.g. whether the actor can do anything (he might be dead, stunned or just temporary not allowed to attack..). If commited, the action's animation is triggered (e.g. melee attack animation if using a sword). A combat event is generated and forwarded to the delay system. The animation will be played and after some time, the delay system will finally forward the combat event to the combat system.
At last: Damage, experience and possibly inflicted effects (a firesword might inflict "burn" to its target) will be propagated.
Later, the Hud can display "+5 EXP" or reduce the player's health bar. Also the AI can be notified about "player X damaged you with Y dmg" or "you received 'burn' by player X".
At the moment I'm very very excited about writing the later AI. But I'll stick at improving and unit testing my system at its current point.
Stay tuned