force death state with petrified and other

Oh, then this should probably work, as it only kills everyone if all living members are petrified:

Code:
var party = $gameParty.aliveMembers();
var petrified = 0;
for (i in party) if (party[i].isStateAffected(2)) petrified++;
if (petrified == party.length) for (i in party) party[i].addState(1);

That said, I still highly recommend changing your petrify state to a number after 3, in which case you'd change value in isStateAffected.
could you explain the implication of using states 2 and 3? even if I do not use guard ?

thanks anyway I figured it out 🙂
I mean, I suppose you can use that number if you want, it's just generally considered a best practice not to. This is because, while I don't think anything in the core engine code expects state 2 to be guard specifically, the possibility exists that I've overlooked something, or that some other plugin you may be using expected it to be that. And if either is the case, it may cause unintended side effects.

Overall, you're probably fine using it, but that's not a 100% guarantee.

Original thread: https://forums.rpgmakerweb.com/threads/force-death-state-with-petrified-and-other.116073/