Skill Depending on Max and Current HP

Payday4515

Red Mage
Member
Joined
Nov 15, 2017
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm wanting to make a skill similar to the Minus Strike ability from the Final Fantasy games to where the attack strength depends on the difference between your Max HP and Current HP.
For example: 9999 is my max hp but I'm at 3000 so it does 6999 total.
I'm unsure how exactly I'd make the formula for this. Can someone help me with the formula, please?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
Include the user's max HP (I believe this is a.mhp but it might be a.maxhp) and the user's current HP (a.hp) somewhere logical in the damage formula.

For example, your formula could be a.atk * 4 * (1 + (a.mhp - a.hp) / a.mhp) - b.def * 2 This formula will increase your initial damage (before the reduction for the target's defense) by up to 100% based on the user's missing HP.

I forget whether precision is important in damage formulas like this in VX Ace, so if you notice that the above formula's damage does not seem to increase based on the user's missing HP, try this instead: (a.atk * 4.00 * ((100.00 + (((a.mhp * 100.00) - (a.hp * 100.00)) / a.mhp)) / 100.00)) - (b.def * 2) This formula is mathematically the same as above, but never attempts to multiply the "a.atk * 4" part by an integer value which could just round to "1".
 

Payday4515

Red Mage
Member
Joined
Nov 15, 2017
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Include the user's max HP (I believe this is a.mhp but it might be a.maxhp) and the user's current HP (a.hp) somewhere logical in the damage formula.

For example, your formula could be a.atk * 4 * (1 + (a.mhp - a.hp) / a.mhp) - b.def * 2 This formula will increase your initial damage (before the reduction for the target's defense) by up to 100% based on the user's missing HP.

I forget whether precision is important in damage formulas like this in VX Ace, so if you notice that the above formula's damage does not seem to increase based on the user's missing HP, try this instead: (a.atk * 4.00 * ((100.00 + (((a.mhp * 100.00) - (a.hp * 100.00)) / a.mhp)) / 100.00)) - (b.def * 2) This formula is mathematically the same as above, but never attempts to multiply the "a.atk * 4" part by an integer value which could just round to "1".
I'll give both formulas a try, thank you so much.
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
If you want just the basic Minus Strike, it's a.mhp - a.hp (user's max minus current). Wave gave a way to incorporate the difference percentage if you want to have Attack and Defense influence the damage (aka increase damage for a regular formula). Alternatively, I could use 1.0 - a.hp_rate as hp_rate is hp/mhp (meaning that 200/1000 is a 0.2 hp_rate thus the difference would be 0.8 aka 800/1000.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top