ID:792575
 
Action RPG Framework by Forum_account
A framework for developing action RPGs.
56 fans · Created May 23 2012
Resolved
It's not exactly like this code you linked to, but now it will be based off of world.time so there aren't any spawns or sleeps associated with using cooldowns.
Applies to:
Status: Resolved (4)

This issue has been resolved.
This should give you the idea of what I'm thinking of.

The current cooldown system uses spawn() to clear a cooldown state. What Jtgibson's ActionLock system does is set the value of cooldowns to (world.time + duration). Whenever you check if the cooldown is finished, you compare it with the current world.time, so you don't need to spawn() anything off.

I think you could also allow for setting a cooldown's duration to -1 to make it permanent instead of relying on time.
I had gone back and forth on that. Since you'll use procs to check and clear cooldowns it doesn't matter how they work. I didn't like using spawn since it could cause problems if you cleared a cooldown early.

I'll probably make this change in the next update since I'm using cooldowns for more things, like limiting how often enemies check for a target.
Forum_account resolved issue with message:
It's not exactly like this code you linked to, but now it will be based off of world.time so there aren't any spawns or sleeps associated with using cooldowns.