- Joined
- Aug 14, 2020
- Messages
- 41
- Reaction score
- 6
- First Language
- French
- Primarily Uses
- RMMV
Hello, I hope my issue is on the right thread.
I've been doing my project smoothly for now, and came across an issue with a skill that checks the hp of the target to increase its base damage.
My damage formula works correctly as I tested it on my usual skills, though it's a bit lengthy since variance was too big (the formula is inspired by Dragon Quest 8's damage formula). Here it is without the hp mechanic :
dmg = ((a.mat*0.7)*(a.level*0.035)) + ((a.mat*0.25) + ((a.level/70)*55)) - (b.mdf/6) ; rge1 = dmg-((dmg/16)+1) ; rge2 = dmg+((dmg/16)+1) ; dmg = Math.floor(Math.random() * (rge2 - rge1 + 1)) + rge1 ; tdmg = (v[20]) * dmg ; tdmg
where v[20] depends on states that the character can have
I've been searching a bit in order for the skill to depend on the target's hpRate. As I wanted the skill to not be overpowered below the 10% hp, I tired to make an event changing a variable or a if(b.hpRate()) kind of thing in the damage formula.
The issue comes there, cause when I try the skill it doesn't deal damage anymore. So what I want to achieve is this kind of result :
-if the HP of the target is above 80% of its maximum, the damage of the skill is reduced by 20%
-if the HP of the target is above 50% of its maximum, the damage of the skill is normal
-if the HP of the target is above 20% of its maximum, the damage of the skill is increased by 20%
-if the HP of the target is under 20% of its maximum, the damage of the skill is increased by 50%
Can I achieve it with my current damage formula ? Is there a way to have a 'if x ? else : if y ?' situation in RMMV ?
I've been doing my project smoothly for now, and came across an issue with a skill that checks the hp of the target to increase its base damage.
My damage formula works correctly as I tested it on my usual skills, though it's a bit lengthy since variance was too big (the formula is inspired by Dragon Quest 8's damage formula). Here it is without the hp mechanic :
dmg = ((a.mat*0.7)*(a.level*0.035)) + ((a.mat*0.25) + ((a.level/70)*55)) - (b.mdf/6) ; rge1 = dmg-((dmg/16)+1) ; rge2 = dmg+((dmg/16)+1) ; dmg = Math.floor(Math.random() * (rge2 - rge1 + 1)) + rge1 ; tdmg = (v[20]) * dmg ; tdmg
where v[20] depends on states that the character can have
I've been searching a bit in order for the skill to depend on the target's hpRate. As I wanted the skill to not be overpowered below the 10% hp, I tired to make an event changing a variable or a if(b.hpRate()) kind of thing in the damage formula.
The issue comes there, cause when I try the skill it doesn't deal damage anymore. So what I want to achieve is this kind of result :
-if the HP of the target is above 80% of its maximum, the damage of the skill is reduced by 20%
-if the HP of the target is above 50% of its maximum, the damage of the skill is normal
-if the HP of the target is above 20% of its maximum, the damage of the skill is increased by 20%
-if the HP of the target is under 20% of its maximum, the damage of the skill is increased by 50%
Can I achieve it with my current damage formula ? Is there a way to have a 'if x ? else : if y ?' situation in RMMV ?