@carloscosta, Yes I do have master lists for all of those and one line control for pausing, resuming, cleansing timers and transitions, and scrubbing entire scenes. For instance, ui:skillScene() - removes all of the above
The code above was originally referenced as an example of how I cleanse one object when it dies and remove it's reference from master lists. The code was an excerpt from a larger section of even crazier code. I chose to share the snippet I did because it's the most human readable in that it uses simple names instead of abbreviations from my imagination. The objects might be the same type, but they have many other objects and events associated with them that also have to be cleansed so it's not just a simple timer removal until the very last step.
In my world, each object has it's own AI loop which interacts with other objects and AI loops and physics and timers with delays so when an object dies it might be interacting with a dozen other objects and be in the middle of multiple physics events. It might also be under the influence of several timers with delays. Each one of the attributes of the object that dies might be having interactions with other attributes of other objects. If one object dies and another object is still "thinking" of any aspect of it, I get crashes and memory leaks, so I'm constantly making checks, scrubbing an cleansing hundreds of objects.
I also have to track whether an object is alive so I don't try to kill it twice. If an object is dying slowly from say hunger and poison and then something else kills it right before it was going to die, I might end up in a situation where one object dies 3 times in the same millisecond while it's also interacting with delayed timers. Actually, before I can even call the "death" function I have to run a "pre-Death" function to unlink the object from other objects and events (basically, tell everyone else to ignore the object). Thus, my code ends up with a lot of redundancies to guard against unanticipated and novels events. The creatures I've been describing don't move along a path or a grid, in fact, the whole system is very open ended and unpredictable which means - yes, even more if/then checks - so many that they may not even seem abnormal until someone points them out to me
Eventually, I circle through the code and cull as many conditional statements as possible - and then I think of another AI enhancement and they return!