Abilities that get more effective vs low health enemies?

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
36
Reaction score
2
First Language
English
Primarily Uses
RMMV
Is there a way (or a script that allows for it) to make an attack that become more effective vs enemies with low HP?
I have three types in mind:

1. An ability that does more damage.
2. An Execute that can instantly kills an enemy that's below a certain percentage threshold.
3. An abilitiy that has a higher chance to inflict status effects.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
14,242
Reaction score
15,318
First Language
English
Primarily Uses
RMVXA

I've moved this thread to ACE Support. Thank you.



All of these can be done via the damage formula most likely. Use b.hp to call the enemies HP and b.mhp to call their max HP. Fro there you'll have to work out the math so that it does what you want, as no one knows your stats in your game but you.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
4,015
Reaction score
4,927
First Language
EN, FR
Primarily Uses
RMMZ
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,455
Reaction score
621
First Language
Italian
Primarily Uses
RMVXA
I agree with what @bgillisp said. Just to make things easier for you I am going to provide a rough skeleton for those formulae. Keep in mind that I will be using D as "Damage Formula". This represents a whole formula, to be more accurate, it represents the whole skill formula. If I were to use it to refer to the basic auto-attack formula it would represent the whole (a.atk*4 - b.def*2). Remember to change it later on. X is the value of the multiplier you want to use, change that one as well, as it has been said, nobody knows those values in your game but you.
Code:
Math.floor(D * (1 + X * (1 - b.hp/b.mhp)))
This can be done in a different way, for example setting up a minimum health percentage to trigger the skill. The overall skeleton is the same, but you have to change the part after X in it.
Code:
X * (threshold - Math.min(threshold, b.hp/b.mhp))
This is just an example, if you set a proper threshold and then change X accordingly you have what you are looking for.
Code:
(b.hp/b.mhp < X) ? (b.addState(1); b.mhp * 8) : D
Code:
var r = (b.hp/b.mhp < X ? A + B : A); b.addState(ID) if (Math.random() < r); D
In this formula A represents the normal chance to apply the status effect while B represents the extra chance. ID is your state id.

EDIT: Since this is for MV I changed the formulae into MV ones.
 
Last edited:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,027
First Language
Tagalog
Primarily Uses
RMVXA
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).

or just simply b.hp_rate
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,455
Reaction score
621
First Language
Italian
Primarily Uses
RMVXA
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).
This will actually give you either 1 (when b.hp is equal to b.mhp) or 0 (whenever b.hp is less than b.mhp). You have to use either b.hp_rate or call a to_f method on either b.hp or b.mhp.
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
36
Reaction score
2
First Language
English
Primarily Uses
RMMV
[move]ACE Support[/move]

All of these can be done via the damage formula most likely. Use b.hp to call the enemies HP and b.mhp to call their max HP. Fro there you'll have to work out the math so that it does what you want, as no one knows your stats in your game but you.

This is an MV post, not Ace. I should have specified that.

Edit:
To be fair, I didn't think I'd need to given that I posted it under MV.
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
36
Reaction score
2
First Language
English
Primarily Uses
RMMV
[mod]Moving to MV Support.[/mod]
Your 'Primarily Uses' says Ace, so you can understand where the confusion came from.

Oh, crap. Sorry, I forgot to change that.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
14,242
Reaction score
15,318
First Language
English
Primarily Uses
RMVXA
And you also posted under game mechanics design originally and how do I questions are not a discussion of a mechanic
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
36
Reaction score
2
First Language
English
Primarily Uses
RMMV
And you also posted under game mechanics design originally and how do I questions are not a discussion of a mechanic

Okay, good to know for future reference.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,455
Reaction score
621
First Language
Italian
Primarily Uses
RMVXA
I changed the formulae skeletons I posted in my previous post into MV ones. I might have still missed something when editing them, but if I did not they should work.
 

Latest Threads

Latest Posts

Latest Profile Posts

My hand hurts from holding the pen for so many hours none stop...:kaocry:
Froggo32 wrote on Soulrender's profile.
I have to ask, who's on your pfp? The character really reminds me of Edgeworth from Ace Attorney lol. I'm really curious.

I'm trying to port L10nMV.js into XP, may probably (because this is my toy project in hobby) coming to XP, VX, VXA.

Learn more about L10nMV.js : https://github.com/Creta5164/L10nMV.js
L10nMV.js forum post : https://forums.rpgmakerweb.com/inde...r-game-without-modifying-your-project.120813/
Here's a gif of the reflection. Ace has some pretty cool sprite effects.
cYtUgp8.gif

Forum statistics

Threads
123,172
Messages
1,154,579
Members
161,533
Latest member
Chaos_Prince87
Top