I swear, i'm starting to become really annoying, sorry for opening so many threads.
Let's get to the point: I made this code for the Basic attack:
In short, this should apply State 5 when the attack lands, and only if the user is affected by State 36.
This doesn't happen though: i tested the code in a fight with an actor that had the Status 36 and an actor that doesn't, and the Status has always the chance to being applied, even if the attack missed or the user isn't affected by State 36.
I guess the problem is with the IF Statements? Again, thanks in advance!
Let's get to the point: I made this code for the Basic attack:
Code:
<target action>
action effect
if (target.result().evaded)
{
}
else
{
if (target.result().missed)
{
}
else
{
if(user.isStateAffected(36))
{
if ((Math.random() * 100)+1 < 15+Math.floor((user.param(5) - 10) / 2))
{
add state 5: target
}
end
}
end
}
end
}
end
</target action>
In short, this should apply State 5 when the attack lands, and only if the user is affected by State 36.
This doesn't happen though: i tested the code in a fight with an actor that had the Status 36 and an actor that doesn't, and the Status has always the chance to being applied, even if the attack missed or the user isn't affected by State 36.
I guess the problem is with the IF Statements? Again, thanks in advance!