RMMZ Check if a large-healing spell actually heals anyone?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,412
Reaction score
1,106
First Language
French
I'm using Visustella. Is it possible to check if a large-healing spell recovers at least 1 HP for at least 1 character?

For a single-healing one, I know this works:

<JS Pre-Damage>
if (b.hpRate()==1) ( whatever you want );
</JS Pre-Damage>

But is there a way to "extend" it to the full party?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,086
Reaction score
4,895
First Language
English
Primarily Uses
RMMV
Code:
if ($gameParty.aliveMembers().some(actor => actor.hp<actor.mhp))

You could replace that with the same hpRate() reference you use above, if you prefer the consistency, I just figured have the computer do insignificantly fewer operations :stickytongue:
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,356
Reaction score
3,405
First Language
EN
Primarily Uses
RMMZ
Multi-target actions are applied once per individual target, so you might also want to use a different tag, e.g. <JS Post-Start Action>.

Note that by default someone with 0% REC (Recovery Effect Sp-param) will receive 0 healing, regardless of their current HP. Similarly with element rates, the PDR/MDR Sp-params, and any plugin features that alter damage. If you want to account for all that, rather than just checking "at full HP?", I think you'd have to compare each target's HP before & after apply.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,086
Reaction score
4,895
First Language
English
Primarily Uses
RMMV
If you want to account for all that, rather than just checking "at full HP?", I think you'd have to compare each target's HP before & after apply.
Good points.
 

CrocPirate

Veteran
Veteran
Joined
Sep 1, 2020
Messages
83
Reaction score
105
First Language
English
Primarily Uses
RMMZ
If you are using a Custom Action Sequence, you can check by using a variable. In the BattleCore plugin, under the Mechanics Settings you can assign a variable to track how much healing a skill does.
Healing.png
The variable is reset to 0 at the start of the next action.

So if you want to check if the skill recovers at least 1 HP, after the Action Effect make a conditional branch checking if the variable is greater or equal to 1.
Healing2.png
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,412
Reaction score
1,106
First Language
French
Thank you everyone.
 

Latest Threads

Latest Posts

Latest Profile Posts

All the artists on here always share their art, and I wanted to partake in the sharing. I wanted to show off the album art for my game's soundtrack while also showing off this song. I wanted to take a break from all the pianos/strings/jazz. I experimented with some side-chaining techniques to modulate the dub-step like synth.
Crazy idea to help people be more productive. We all upload a photo of someone who is good at nagging, cajoling, guilting, etc. you into doing what you should be doing. Then, after you have posted X amount of times in a defined period, that photo pops up with the text of "Shouldn't you be working on your game?" Just for fun.:wink:
Avery wrote on MouseWorks's profile.
That is a really cute avatar concept that you have there! I like it :3
Well, here's a screenshot of just another game that might never be completed...

quicktrip_xp01.jpg
Fake FullScreen (Download):

Forum statistics

Threads
128,507
Messages
1,195,108
Members
169,083
Latest member
riluohuangsha
Top