MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers
21 stars 3 forks source link

[REQUEST] Native cooldown support for active skills #364

Open Darxo opened 1 month ago

Darxo commented 1 month ago

Is your feature request related to a problem? Please describe. Several bigger mods which introduce or change active skills, will introduce the concept of cooldowns. Most commonly by making skills only usable once per turn. But some times they want a multiple turn cooldown on it. Every mod/skill doing that needs to implement the cooldown system by themselves.

Another use case would be one skill which puts other active skills on a character on a cooldown. For example a spell could put all attack skills on the enemy on a cooldown.

Describe the solution you'd like

Additional context This system does not automatically apply the cooldown and is not meant to do that. So there is not yet a CooldownOnUse = 2 variable or something similar. That has to be implemented by the mods using this system. Or maybe MSU will ship such a second variable aswell

With such a backend adjustment every mod can cross compatibly apply or reduce cooldowns for any other possible skills.

LordMidas commented 1 month ago

I agree Cooldown functionality is useful. I started preparing a branch for this in MSU a long time ago but then I realized that Cooldown is something that is a very niche use case for skills so I thought the functionality isn't that useful and the skills that need it can just implement it themselves on a case to case basis.

However, if we want this functionality for all skills then we must discuss what is better:

  1. Adding Cooldown functionality to base skill just because "a few" skills may use it.
  2. Adding a helper function that you can call for a skill that adds a "hook" on the skill to add cooldown functionality for skills where you need it (e.g. how you did for sling skills in Reforged). This would look like ::MSU.enableCooldown(_skillObject).