I'm applying a State to the Attack Skill when it is used if certain conditions are met:
It works. If the character is in the front row (State 4), and attacking with a missile weapon, they get a penalty to their HIT (State 7). It then turns off afterwards.
Except...if the character makes multiple attacks with their action--either because I set the Skill Repeat greater than 1, or because they have the Attack Times + trait, the state only applies on every other attack. It works on attacks 1, 3, 5, 7, 9, but not attacks, 2, 4, 6, or 8.
Has anyone run into this? Any ideas of if there is a fix?
Code:
<Before Eval>
if (user.isStateAffected(4) && user.attackMotion() === 'missile') {
user.addState(7); }
</Before Eval>
<After Eval>
user.removeState(7);
</After Eval>
It works. If the character is in the front row (State 4), and attacking with a missile weapon, they get a penalty to their HIT (State 7). It then turns off afterwards.
Except...if the character makes multiple attacks with their action--either because I set the Skill Repeat greater than 1, or because they have the Attack Times + trait, the state only applies on every other attack. It works on attacks 1, 3, 5, 7, 9, but not attacks, 2, 4, 6, or 8.
Has anyone run into this? Any ideas of if there is a fix?