Hello everyone, I have a passive state that's supposed to check the battle party's ATK when the condition is fulfilled, then automatically apply to the battle ally with the highest ATK.
I see there's the whole 'i' loop stuff, but that's not really in my expertise - combined with getting the highest atk ally's id, etc.
The state in question does something akin to:
"When attacked, 20% chance to grant the ally with the highest ATK parameter Energized, increasing TP Regen+10% and ATK+10% for 3 turns."
So I'd imagine it'd be something like:
Bonus question, how can I check if anyone is inflicted with the state so the passive doesn't trigger again until it wears off?
Thank you ahead of time!
I see there's the whole 'i' loop stuff, but that's not really in my expertise - combined with getting the highest atk ally's id, etc.
The state in question does something akin to:
"When attacked, 20% chance to grant the ally with the highest ATK parameter Energized, increasing TP Regen+10% and ATK+10% for 3 turns."
So I'd imagine it'd be something like:
JavaScript:
<Custom React Effect>
if (Math.random() <= 0.2){
[thing to check current party's atk, then get id of ally with highest parameter]{
target.startAnimation(x); //show buff anim
target.addState(y); //add energized state
}
}
</Custom React Effect>
Bonus question, how can I check if anyone is inflicted with the state so the passive doesn't trigger again until it wears off?
Thank you ahead of time!