reznok / GMCAbilitySystem

An Unreal Engine plugin that adds an ability system to the General Movement Component plugin
MIT License
28 stars 13 forks source link

Made ability cooldown only apply when calling CommitAbilityCostAndCooldown()... #26

Closed LeoFabre closed 4 months ago

LeoFabre commented 4 months ago

... or CommitAbilityCooldown() (fixes issue #25)

LeoFabre commented 4 months ago

I've implemented a CommitAbilityCooldown() method and a CommitAbilityCostAndCooldown() which are respectively alternatives to GAS' CommitCooldown() and CommitAbility(), the latter with a longer name for the sake of clarity and to respect how CommitAbilityCost() is named.

‼️This introduces a breaking change, though : All abilities will now NOT apply their cooldown if none of the new methods are called.

This is default GAS behavior, but if you want me to add a bApplyCooldownAtAbilityBegin property that is set to true by default, let me know.

LeoFabre commented 4 months ago

Actually I think it's best to add that boolean. Let me fix that real quick. Also, I had to redo my fork and forgot to remove the SetCooldownForAbility in BeginAbility, so I'll just wrap it in an if() and it'll be all good.

LeoFabre commented 4 months ago

Done ! Let me know if you don't like it.

reznok commented 4 months ago

LGTM. I would like to eventually handle cooldowns similar to GAS and do them as Effects so that they can be properly synced in the case of mispredictions, but this design wouldn't change. That would just change the float timer part of it. Thanks!

LeoFabre commented 4 months ago

You're very welcome 👌