Problems with damage and status effect

A really versatile method I can’t recommend enough is through actor components.

When event happens, we dynamically create and attach an actor component to target actor. This components can deal damage, heal, shows particles, count time and handle anything related to this effect. When the timer expires, the component destroys itself.

Some examples:


The official vid I learnt it from:

This approach allows you build modular, easily scalable systems where the functionality is encapsulated within the component - so you do not need to burden the Player, NPC, Enemies or world entities with all possible combinations of what could happen to them.

You instead spawn a desired effect on them and it goes away on its own.