Easiest way to check if entire party is at full HP and MP?

Hi there,

I'm trying to create a little conditional branch that checks if all the active party's members are at full HP and MP, before determining what the next action will be.

What's the quickest way of doing this?

Don't mind using a script, in fact that may be preferable.
Is this something you will do in battle, and are you only interested in battle members? Or do you want all members?

Using members in the command below will check ALL members when you're out of battle, but only battlers when you're in battle. Using allMembers will check ALL members, whether you're in battle or not, and using battleMembers will only check battlers, whether you're in battle or not.

$gameParty.members().every(function(actor) {return actor.hpRate() === 1 && actor.mpRate() === 1});

That will be true if all the actors have full hp and full mp. Put it in the Script line of your conditional branch.
JavaScript:
var condition = true;
for(i=1; i<=gameParty.members().length; i++) {
    var member = gameParty.members()[i];
    if((member.hp!==member.mhp)||(member.mp!==member.mmp)) {
        condition = false;
    }
}
if(condition==true) {
   //what happens if everybody is at full HP and MP
}
First we set up a condition variable to true.
Then, we check for every active party member if their HP isn't equal to their max HP, or if their MP isn't equal to their max MP. If that's the case, the condition variable is turned to false, otherwise it's untouched.
If, once every party member has been processed, the condition variable is still true, you input the commands for what you want to do.
@CHKNRAVE

It's $gameParty, not gameParty. $gameParty.members() returns an array that starts at 0, not 1, so your loop would need to be
Code:
for (i = 0; i < $gameParty.members().length; i++)

as if you had 5 party members and you called $gameParty.members()[5] you would get an out of bounds error.

Original thread: https://forums.rpgmakerweb.com/threads/easiest-way-to-check-if-entire-party-is-at-full-hp-and-mp.130786/