Hello! I have a few skills in my game that, when an ally hits an enemy under a certain state, an ally performs a followup attack. It works perfectly, except when the followup is triggered by a multi-hit skill. When a multi-hit skill is casted, the followup casts after the first instance of damage and then completely stops the multi-hit skill. This is the code I'm using for one of the states
I'm using Yanfly's Buffs and States core to check if the attacker is not actor 8 (the character who applies this specific state), and the skill type is not 5 (so followup attacks don't trigger each other), and the check for switch 21 is so that the followup attack only triggers once per turn.
How can I change this so that the code waits for all actions to complete before casting? I've tried lots of different things and I'm at my wits end.
JavaScript:
<Custom Respond Effect>
if (user.actorId() != 8 && this.item().stypeId != 5 && !$gameSwitches.value(21)) {
$gameActors.actor(8).forceAction(60, target.index());
BattleManager.forceAction($gameActors.actor(8));
}
</Custom Respond Effect>
I'm using Yanfly's Buffs and States core to check if the attacker is not actor 8 (the character who applies this specific state), and the skill type is not 5 (so followup attacks don't trigger each other), and the check for switch 21 is so that the followup attack only triggers once per turn.
How can I change this so that the code waits for all actions to complete before casting? I've tried lots of different things and I'm at my wits end.
I'm gonna explain how I have the states set up, just to make sure I'm doing it correctly.