In my turn based RPG/Puzzle game I planned to have different Special effects, which enemies, weapons and armory can have.
So for example an enemy can have a “poison” effect, which has a certain probability to poison the Player. Or an armor Piece can have the effect “uncover” which lays open one puzzle Piece at the very start of the round (so not each turn of the Player, but each round, one round is started by generating a new puzzle).
Also there are Special effects which affect the “luck” value of the Player which tells how recent he finds Gold.
Now the Problem is: I want to handle These effects quite equally so that I can assign the effects to whatever can have such an effect and to create new effects quickly. But: The effects are triggered at different times of the game, or even not triggered but just read out (luck value). So there are effects which are triggered at every attack, at the end of every turn or at the start of every round etc.
I am looking now for a solution to implement these effects in such a way that they are all of the same base class, but triggered at the correct time.
I thought about having an enum which tells at which time the effect should be triggered (like ROUND_START, ATTACK, PROPERTY etc) but that seems pretty inflexible.
The other way I could think of is Register them to different Events in the game’s Event System. But I am really unsure if this is the way to go, as I do not use the Event System for everything and I would then need to do this.
Do you have any suggestions on this Problem?