So I attempted to make a variant of Unstable Affliction from Yanfly Tips & Tricks. Following the tutorial here, I was able to come up with this:
The intended effect works fine. If anyone dispels the effect, it will be transferred to them instead. However, it has an unintended effect where if anyone kills the target, they are also considered a "dispeller" since the system removes the control effect on the actor's death.
What would I have to do to prevent this? I tried adding: "&& target.hp >= 1" in front of "if (dispeller)," but it didn't seem to like that, as battles would not load.
JavaScript:
<JS On Erase State>
const dispeller = BattleManager._subject;
if (dispeller) {
const stateId = 28;
$gameTemp.requestAnimation([dispeller], 57);
dispeller.addState(stateId);
}
</JS On Erase State>
The intended effect works fine. If anyone dispels the effect, it will be transferred to them instead. However, it has an unintended effect where if anyone kills the target, they are also considered a "dispeller" since the system removes the control effect on the actor's death.
What would I have to do to prevent this? I tried adding: "&& target.hp >= 1" in front of "if (dispeller)," but it didn't seem to like that, as battles would not load.