[Solved] Way to check if entire party is at full HP/MP, etc.

RCXGaming

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
589
Reaction score
1,274
First Language
English
Primarily Uses
RMVXA
I've been curious about how you pull off a check to see if everyone in the party (active or reserve, it doesn't matter) has full HP or MP.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,788
Reaction score
1,849
First Language
Spanish
Primarily Uses
RMVXA
Code:
$game_party.all_members.collect {|actor| actor.hp / actor.mhp}.all? {|ratio| ratio == 1.0}

returns true if everyone's HP matches their max HP.
 

RCXGaming

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
589
Reaction score
1,274
First Language
English
Primarily Uses
RMVXA
Code:
$game_party.all_members.collect {|actor| actor.hp / actor.mhp}.all? {|ratio| ratio == 1.0}

returns true if everyone's HP matches their max HP.

Very nice. That was a pretty quick answer, too.
 

cremnophobia

Veteran
Veteran
Joined
Dec 10, 2013
Messages
233
Reaction score
102
Primarily Uses
That can be shortened and simplified to:
Ruby:
$game_party.all_members.all? { |actor| actor.hp == actor.mhp }
 

Latest Threads

Latest Profile Posts

After a little test with the parallax mapping, found it lags like a cat on a leash. Instead of the original idea to parallax map the entirety of the ship, I guess I'll settle for editing the tilesets. Probably should have done that first. :kaosigh:
So I kinda came back and learned how to mod other RPG Maker games so... Hello everyone!
Captura-de-pantalla-475.png
Version 1.0.1 done! Now finally free time... oh
Capture.PNG
I'm Really proud of how my game over screen looks!
UldJFr1.png
I felt inspired by a piece of art I saw. So I made this.

Wanderer Doge.png

Forum statistics

Threads
123,280
Messages
1,155,444
Members
161,674
Latest member
Luxheo
Top