Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Native cooldown support for active skills #364

Open
Darxo opened this issue Jun 7, 2024 · 1 comment
Open

[REQUEST] Native cooldown support for active skills #364

Darxo opened this issue Jun 7, 2024 · 1 comment
Labels
feature request A feature requested by the community

Comments

@Darxo
Copy link

Darxo commented Jun 7, 2024

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

  • Introduce a simple but unique (because MSU doesn't wanna accidentally overwrite commonly used names) private cooldown variable in skill.nut. E.g. MSU_CurrentCooldown = 0, which is the current active cooldown.
  • If this is != 0 then the function isUsable will always return false
  • that variable will be decremented onTurnStarted() up to a minimum of 0
  • a new setter and getter will help manipulate this value

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.

@Darxo Darxo added the feature request A feature requested by the community label Jun 7, 2024
@LordMidas
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature requested by the community
Projects
None yet
Development

No branches or pull requests

2 participants