KhymChanur: Instead of timed and decreasing conditions for monsters and the player, like being stunned/confused/bleeding, how about these get moved into the standard ".flags" field, with some more flagsets to keep track of them? To set the flag FLAG_FOOBAR for a certain duration, you'd do the macro/call flag_set_timed(monst, FLAG_FOOBAR, value, duration), which would do flag_set(monst.flags, FLAG_FOOBAR, value) and flag_set(monst.timed_flags, FLAG_FOOBAR, duration). The main loop in src/dungeon.c would, every 10 game turns, for each monster iterate through monst.timed_flags, decrement the counter for each flag, and remove that flag from monst.flags and monst.timed_flags when the counter reached 0. There would also be a monst.decreasing_flags, for which flags the coresponding flag in monst.flags would be decremented and remvoed when 0.
Doing it this way, it would be very easy for modules and addons to do timed/decreasing flags. It would also allow us to remove from the T-Engine's player structure player_type such timed fields as protevil, protundead, and blessed, things which are specific to the ToME module and should be removed from the T-Engine if possible.
ToME Wiki