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
263
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

Uploaded a new Video today where I play Minecraft "The Bridge" please check it out & let me know what you think of it!
I normally only post these every 24 hours, but same-sex marriage is coming to Rune Factory 5 and I just wanted to share it with the world! https://www.xseedgames.com/2021/09/23/rune-factory-5-localization-blog-2/
Today was wild. In the day I worked in my project (and realized I have almost 100 hours wich is a happy surprise), and now i'm having to calm my boyfriend down because of chris pratt Mario.
Mr_Petue wrote on GamchiSamwise's profile.
hey pepe, why do you have a gun on your head? where is wojak?
Still alive! Totally did not finish in time for the Jam (boy that's late) but tl;dr of the last half a year is Work term -> Covid Lockdown -> Sick... again -> Full time Employment. Game stuff has been on hiatus but got a new graphics tablet so hopefully updates again soon. =D

Forum statistics

Threads
115,320
Messages
1,088,921
Members
149,970
Latest member
TuxedoedPenguin
Top