HP-to-6 problem

The MM

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
4
First Language
French
Primarily Uses
So, I have nearly finished a tiny game, but one skill poses problems.


The skill is named HEX, and it is meant to set the target's HP to 6.


I've tried a bunch of ways, but I always hit a few walls when trying to make it work.


- Another of the skills in the game, Nova Barrier, causes its user to take 1% of all magic damage. Since HEX is a magic attack, I ended up in situation where it would do nothing.


- You could just guard it, causing the skill to only deal "around" 50% of the character's current HP. And unlike Nova Barrier, Guarding is available to everyone.


I've tried a bunch of ways to make it work, but using a formula with "b.hp = 6; [...]" requires me to give damage to the skill that would kill the purpose of bring the target's HP to 6.


Is there a way to do the skill that would bring the target's HP where I want it while displaying the popup and ignoring magic damage rate as well as guarding..?


Thanks in advance for your answers.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Try this:


Damage formula:


b.hp - 6


That should make it so that you always have 6 HP when finished, as the damage it will do is your current HP minus 6.


Edit: Though, a warning, this might heal the person if they have less than 6 HP. May need a tweak to avoid that, unless that is your intended behavior.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
temp = b.mhp - b.hp - 6; temp


any variable defined in the damage formula is automatically scrapped after the eval, that is why you can use any name to calculate the number you need for the damage


EDIT: for the other effects you have to use the damage rate of the enemy in the damage calculation - I don't have time to get everything into the formula, but it uses the same principle and revers-calculates the needed damage to get to 6 after damage rates and whatever else
 
Last edited by a moderator:

The MM

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
4
First Language
French
Primarily Uses
Try this:


Damage formula: b.hp - 6


That should make it so that you always have 6 HP when finished, as the damage it will do is your current HP minus 6.


Edit: Though, a warning, this might heal the person if they have less than 6 HP. May need a tweak to avoid that, unless that is your intended behavior.
I tried, but Nova Barrier affects the magic attacks and nearly-nulls the damage. (Fixed: made it a certain hit skill)

temp = b.mhp - b.hp - 6; temp


any variable defined in the damage formula is automatically scrapped after the eval, that is why you can use any name to calculate the number you need for the damage


EDIT: for the other effects you have to use the damage rate of the enemy in the damage calculation - I don't have time to get everything into the formula, but it uses the same principle and reverse-calculates the needed damage to get to 6 after damage rates and whatever else
Yeah, but I don't know the damage for guarding. Is it the same as VX Ace's [damage / 2*grd] formula..?
 

The MM

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
4
First Language
French
Primarily Uses
I seem to have made it work outside of using YEP's SkillCore eval codes.


Here's the formula:

Code:
(b.hp-6) / (b.mdr*100) * (b.isGuard() ? 200*b.grd : 1)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top