Open Darxo opened 1 year ago
I did a prototypical implementation just now and I realised that one third of the vanilla skills, which cause interruption, will require a very ugly hooking style. They do it as one of three random effects, The function does not return which effect was chosen.
A good way to tackle this seems to be hooking the setCurrentMovementType
function
Is your feature request related to a problem? Please describe. There is a group of vanilla effects
It is currently incredibly hard to add effects to the first category without hooking dozens of vanilla effects. And it is annoying to remember all the effects that need to be removed if designing a new skill that pushes/pulls, etc.
Describe the solution you'd like Introduce a new virtual
function onInterrupted
in theskill.nut
that is empty Introduce a newfunction onInterrupted
in theskill_container.nut
that calls theonInterrupted
on all skills Introduce a newfunction interrupt
in theactor.nut
which will call theonInterrupted
in its skill containerHook the respective functions of every skill that currently causes an interruption and manually call an additional
interrupt
on the targeting actor.Hook the shieldwall, spearwall and riposte effects, and overwrite the
function onInterrupted
in them with one that callsthis.removeSelf()
and optionally a nice combat log alongsideAdditional context Since we can't edit out the vanilla code lines where they manually remove the mentioned effects, that will now happen twice. But since
removeSelf
only setsIsGarbage
to true that should not be a big issue.This framework will allow many mods to seamlessly add new interruptable effects aswell as new skills that interrupt a targeted actor