Hello there. I know I've mentioned this before, but I thought to bring it up again.
I have a weapon called "Brave Sword" and two skills called "Sol" and "Luna".
-Brave Sword grants the user 4 strikes (2 strikes if the user's speed is less than the enemy's speed).
-"Sol" and "Luna" are two skills that, by default, strike two twice (once is user's speed is less than the enemy's speed).
I'm using Yanfly's AutoPassiveStates and I'm wanting to modify the two skills whenever equipped with Brave Sword, here is the action sequence for Sol and Luna provided below:
Code:
<target action>
if (user.isStateAffected(48))
if (user.agi >= target.agi)
motion swing: user, sword
motion wait: user
action animation: target
motion wait: user
action animation: target
wait for animation
action effect: target
motion wait: user
death break
wait for animation
action effect: target
motion wait: user
death break
motion swing: user, sword
motion wait: user
action animation: target
motion wait: user
action animation: target
wait for animation
action effect: target
motion wait: user
death break
wait for animation
action effect: target
motion wait: user
death break
else
motion swing: user, sword
motion wait: user
action animation: target
motion wait: user
action animation: target
wait for animation
action effect: target
motion wait: user
death break
wait for animation
action effect: target
motion wait: user
death break
end
else
if (user.agi >= target.agi)
motion swing: user, sword
motion wait: user
action animation: target
motion wait: user
action animation: target
wait for animation
action effect: target
motion wait: user
death break
wait for animation
action effect: target
motion wait: user
death break
else
motion swing: user, sword
motion wait: user
action animation: target
wait for animation
action effect: target
motion wait: user
death break
end
</target action>
My issue lies after the first "end". I put a Passive State on the Brave Sword weapon where anybody who has access to "Sol" and "Luna" while equipped with the weapon can perform the action.
The top part all the way to the first "end" works perfectly, but for the ones who don't have Brave Sword equipped are somehow attacking twice and then follow up with attacking once, when their speed is lower than the enemy's speed.
The "else" above the "if (user.agi >= target.agi)" is supposed to be conditional, like "if user isn't affected by State 'X'. If they're equipped with a weapon other Brave Sword and the speed is lower, they should only attack once and that's it.
Is there something I did wrong here? It works perfectly for user's who have Brave Weapon whether speed is lower or higher, but the ones without Brave Weapon are not following the sequence I was intending.
And here I made a pretty detailed version of the problem, so I will just link it here.
https://forums.rpgmakerweb.com/inde...ed-on-brave-sword-equipped.82960/#post-766989