ID:272135
 
Basically a while ago I asked if there was a simpler way of handling and counting down status effects than using the following code for each and every status effect.
if(statuseffect)
statuseffectdur--
if(!statuseffectdur) statuseffect=0

As you probably guessed, it is not too efficient especially if there is 50 different effects and lots of things running through that code (even if they only run through it when they need to).

The answer to this question I got what "use datums to represent effects". Maybe I should have asked the person to clarify at the time but... I seriously can't figure out a way of doing this.
The only way I can really think is to have a datum that represents each effect, that stores a list of people who are effected by the effect, the effects power and duration. (Which doesn't seem like much of a better way to be, because there could still potentially be a lot of things looping through an even larger amount of things)

So... Can anyone think of a better, easier way of doing this, and if so, how? (Because at the moment I am tempted to just use an object to represent each status effect with variables to measure the effects power and duration that will be slapped in the effected persons contents, and then have a proc loop through these objects, counting down the effect and doing whatever needs to be done with that status effect).
I created a library to do something along those lines. It won't necessarily work with what you want to do in your game, but if nothing else it'll work as an example of HOW to do that.

http://www.byond.com/developer/Foomer/EffectsSystem