MV Trying to apply a state if ennemies are affected by another one (AOE)

Hi !

I'm using Yanfly's plugin and i am struggling with a skill.

I have a state "Water" and a state "Freeze". Let's say that i apply "Water" to all ennemis with a Surf

Now, with my skill "Blizzard" i want to freeze my ennemies affected by "Water". But, when i do it, it will not apply it somehow

my code is:

<Target Action>

<Whole Action>

if target.isStateAffected(15)

add state 14: target, show

wait: 20

else

wait: 20

end

</Whole Action>

</Target Action>

This works like a charm when it comes to mono target, but doesn't work with multiple target. What i am missing ?

Thanks in advance for your time !
Your notetags are wrong. You can't nest notetags like that. You have to finish one before you start the other:
<target action>
</target action>
<whole action>
</whole action>
Your notetags are wrong. You can't nest notetags like that. You have to finish one before you start the other:
<target action>
</target action>
<whole action>
</whole action>
Hi, thanks for your quick answer, it resolved a part of my skill. Now it does works when i use my "Surf" skill into "Blizzard" skill, all enemies are frozen. Good

But now, i applied "Water" on 2 Enemies but 3 of them didn't have the state on them. I casted "Blizzard" on them and all of them got frozen. What i would like is that only thoose 2 enemies with "Water" state on them would be frozen and not the 3 others.

I don't know if there is a way to check each enemy to scan who is affected by "Water" and who's not..
I think you actually need to use target action, not whole. Doing target action executes the commands against each enemy individually, whereas whole evaluates it once for the entire troop. So I think that would check the first enemy of the troop to have the state then apply it to all of them.
I think you actually need to use target action, not whole. Doing target action executes the commands against each enemy individually, whereas whole evaluates it once for the entire troop. So I think that would check the first enemy of the troop to have the state then apply it to all of them.
Ok, i think i understood it better. I seperated my Whole Action sequence (for animations, camera blablabla) then i wrote a Target Action in order to check/apply the state. I guess i will do the same for my AOE dmg. I have others like this that will do Crit if ennemies are affected by a certain state and i don't want it to crit if some of them are not affected with that state.
The only problem will be that dmg will appear one by one after my animation, making it a bit smoothless but it is fine.

I think we can sey it is done 🙂
Thank you so much for your help and have a great week!
I mean, you could also not use action sequence commands and instead eval it inside your setup action.

Code:
Eval: $gameTroop.aliveMembers().forEach(enemy => enemy.isStateAffected(15) ? enemy.addState(14) : 0);

but I don't think it makes a difference in this situation.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-apply-a-state-if-ennemies-are-affected-by-another-one-aoe.156221/