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,888
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,355
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,888
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

Time to open a new practice session.
I learned a lot about screwdrivers today while trying and failing to remove the hard drive from an old computer I intend to turn in for disposal. I really hate that there are so many different sizes of screws and none of my screwdrivers are the right size. This would make for an evil mini-game in a modern/futuristic RPG.
Should I make a new Twitter, or is it just this bad now? I didn't pay attention to it for like 3 years. And now my new posts have extremely low views compared to my old tweets. Or did I really get that much momentum from releasing my game and then drop it? :hswt:
Started moving house today. Putting everything in boxes. Listening to Mac DeMarco's new album. Feelin' groovy.
It's finally in a packageable state. You can play start to end, half-a-minute ordeal. I just need to fix some minor bugs and it's golden.
I'm so excited for this.
1675461673946.png
(please don't mind the windows overlay XD)

Forum statistics

Threads
128,475
Messages
1,194,861
Members
169,025
Latest member
chuvoso2
Top