melia icon indicating copy to clipboard operation
melia copied to clipboard

Skill Interruption

Open Terotrous opened this issue 1 year ago • 3 comments

What happens if you get knocked down, frozen, or incapacitated in some other way while in the middle of using a skill? Does it stop the skill? If so, we need a way to handle this. (Actually, we should probably handle this anyway even if the official doesn't).

Can probably investigate this using Friend Duels on official.

Terotrous avatar Jul 28 '24 22:07 Terotrous

As you said, and as was previously discussed on Discord, I believe as well that we should be able to cancel a skill entirely and immediately, regardless of how officials handle such cases. Unfortunately we didn't really account for this initially, so we might have to make some changes.

Since we're extensively using tasks in the skill handlers, the first thing that comes to mind would be cancellation tokens, though I feel like that would be a bit unwieldy and a detriment to the code readability. An alternative might be to simply include manual cancellation checks, but that could become similarly chaotic in some handlers. In both of these cases you also always have to remember to pass tokens and/or do checks, which is error prone.

I'm considering scrapping the task approach in favor of something more hand-crafted, that would also be able to handle additional features, such as cancellations. Tasks and await make for some very simple code structures, but they also come with a lot of baggage and potential issues 🤔

exectails avatar May 21 '25 22:05 exectails

Annoyingly though, I think it's probably somewhat skill dependent. For example, for Shield Lob, if I've already thrown the shield, then I get frozen, the shield probably keeps going, whereas for something like Bash, if I get frozen the skill immediately stops. It may be as simple as "if this skill has created a pad, the pad persists", but I'm not 100% confident to say it's that simple.

Terotrous avatar May 22 '25 00:05 Terotrous

You're right, we absolutely wouldn't be able to rely on pads being the solution. Especially because we don't know whether some pads might need to get cancelled with the skill as well. Ultimately the skill needs to be in control over what happens. But in the absolute worst case we could always fall back on our current approach. That doesn't go away after all.

exectails avatar May 22 '25 07:05 exectails