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 Posts

Latest Profile Posts

Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!
Just found out that mint tea made from chocolate mint tastes a bit like hot cocoa with candy cane stirred in. As I'm allergic to chocolate this makes me very happy.
It's special day for me tomorrow so time to vanish for 24 hours lol.
So Deltarune Chapter 2 is supposed to release today... if it's out already, has anyone played it? And I can't because I have a stinking Mac and not a Windows PC.

Forum statistics

Threads
115,139
Messages
1,087,543
Members
149,646
Latest member
Kamikayson
Top