palom

Villager
Member
Joined
Aug 23, 2017
Messages
8
Reaction score
0
First Language
spanish
Primarily Uses
RMVXA
I have a doubt, I want to make an attack with a "False Swipe" style, this attack will deal fixed damage (150 for example), but if that skill will kill the opponent it let it with 1 HP instead.

I was trying to lurk for a damage formula, but I didn't found it.

Thank you
 

CrocPirate

Veteran
Veteran
Joined
Sep 1, 2020
Messages
48
Reaction score
29
First Language
English
Primarily Uses
RMMZ
I would imagine the damage formula would look something like this:

b.hp >= 151 ? 150 : b.hp - 1
 

palom

Villager
Member
Joined
Aug 23, 2017
Messages
8
Reaction score
0
First Language
spanish
Primarily Uses
RMVXA
I tested it and it works!!!! Thank you very much.
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
262
Reaction score
367
First Language
French, German
Primarily Uses
RMMZ
Alternate formula: Math.min(150, b.hp - 1)

It gives you the smaller number between 150 and HP-1.
 

palom

Villager
Member
Joined
Aug 23, 2017
Messages
8
Reaction score
0
First Language
spanish
Primarily Uses
RMVXA
Alternate formula: Math.min(150, b.hp - 1)

It gives you the smaller number between 150 and HP-1.
Thanks, I'll save that formula too
 

Latest Threads

Latest Profile Posts

I might not participate in the Boss Battle contest after all... I have more important things to do, like Wishful Wanda. And of course the Dark Deception spinoff I plan to pitch, Demon Slayer.
Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.
A lot to learn to make a game. Can I handle it?

Forum statistics

Threads
115,171
Messages
1,087,803
Members
149,723
Latest member
krinalle
Top