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

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,410
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
6,947
Reaction score
4,789
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,338
Reaction score
3,375
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
6,947
Reaction score
4,789
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,410
Reaction score
1,106
First Language
French
Thank you everyone.
 

Latest Threads

Latest Posts

Latest Profile Posts

Now that I have linklists on large trees and cars, is there any theme that would interest you?
Debugging multiplayer issues... I'm having fun, right?
yay_streaming.jpg

For just starting streaming on the 10th... Definitely not the worst. :LZScheeze:

Granted I need 333.34 hours a month on average to achieve money. So I don't really expect that, but it sure has helped my game dev go much faster.
Proud on how this map turned out.

FnmhDLIXgAAOvIC
I just finally fixed a huge problem that wouldn’t let my game load and would crash it.. I thought that I was gonna have to trash the project and start over lol

Forum statistics

Threads
128,328
Messages
1,193,648
Members
168,813
Latest member
jasper1hu
Top