TankGameOrg / engine

1 stars 2 forks source link

Added cooldown player actions #9

Closed TrevorBrunette closed 5 months ago

TrevorBrunette commented 5 months ago

Adds an action type that can be used on a player element that implements a cooldown mechanism. The cooldown is given as a function of the game state so it can be made static (e.g., always 5 minutes) or dynamic (e.g., 5 minutes when 10+ players are alive, 10 minutes when fewer than 10 players are alive).

BryanFriestad commented 5 months ago

This would replace the PlayerRules in the Ruleset.java file? Then you just give it the same parameters, plus one for the cooldown function? That way each action can have a unique (and dynamic) cool down function?

Can this be implemented for council actions as well? I'm thinking there may be a need to have cooldowns for those too

BryanFriestad commented 5 months ago

That could be a separate issue I suppose

TrevorBrunette commented 5 months ago

This would replace the PlayerRules in the Ruleset.java file?

Yes. It is already a drop-in replacement as you desire.

Can this be implemented for council actions as well?

Yes, since council actions are also defined with PlayerActionRules.