Skill that does more damage the more debuffs the target have?

Status
Not open for further replies.

Waveclaw

Veteran
Veteran
Joined
Apr 20, 2018
Messages
114
Reaction score
19
First Language
English
Primarily Uses
RMVXA
I am wondering, how can I make a skill that does more damage the more debuffs the target have?

For example, I want a skill when the target that have more debuffs (3, for example,) receive more damage than the target that have less debuff (1, for example). How do I do this? Do I need to install a script, or do I need to write formulas?
 

gambitben

Veteran
Veteran
Joined
Jun 8, 2013
Messages
161
Reaction score
127
First Language
Spanish English
Primarily Uses
RMMV
This is from a yanfly's Tips and tricks video, you can find it here:

I've changed it a bit so it only deals Hp damage, the formula in Red means how much damage will the target receive for each debuff. This edit changes these things from yanfly's original idea so it fits your request:

-It shouldn't check for buffs (tho I'm not sure 100%, try it and you tell me :rswt)
- I deals damage for each debuff.
-It shoulnd't remove or clear them

You'll need these plugins to make it work:

Battle engine core: http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Skill core: http://yanfly.moe/2015/10/13/yep-8-skill-core/

My last suggestion is you should have the skill deal at least 1 damage or debuff the target, because the damage from the formulas below will occur after the skill's formula box happens. Anyways, test it if you want and you tell me. It should work and do what you wanted, but in case it doesn't, as I can't test it now, write me and I'll fix it, I'm pretty sure I can make it work :rwink:.

<After Eval>
// Initialize the HP value.
var hp = 0;
// Loop through all 8 parameters.
for (var i = 0; i < 8; i++) {
// If it is a debuff...
if (target._buffs < 0) {
// Then increase the damage by a formula.
hp -= user.mdf * 2;
}
// Check if the HP change is negative...
} if (hp < 0) {
// Play an animation.
target.startAnimation(animation Id from your animations list here);
}
// Check if the HP amount isn't 0...
if (hp !== 0) {
// Alter the target's HP.
target.gainHp(hp);
// Start the damage popup for the target.
target.startDamagePopup();
}
// Clear the target's results.
target.clearResult();
</After Eval>
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using. Apart from keeping those aspects separate, it also helps prevent things like gambitben's response which is for MV and the information under your avatar says you are using VXAce.

[move]RPGMaker VXAce[/move]
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
A damage formula should suffice.

dmg = a.atk * 4 - b.def * 2; dmg * (1 + (0..7).to_a.select {|id| b.debuff?(id)}.size)
 

Waveclaw

Veteran
Veteran
Joined
Apr 20, 2018
Messages
114
Reaction score
19
First Language
English
Primarily Uses
RMVXA
This is from a yanfly's Tips and tricks video, you can find it here:

I've changed it a bit so it only deals Hp damage, the formula in Red means how much damage will the target receive for each debuff. This edit changes these things from yanfly's original idea so it fits your request:

-It shouldn't check for buffs (tho I'm not sure 100%, try it and you tell me :rswt)
- I deals damage for each debuff.
-It shoulnd't remove or clear them

You'll need these plugins to make it work:

Battle engine core: http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Skill core: http://yanfly.moe/2015/10/13/yep-8-skill-core/

My last suggestion is you should have the skill deal at least 1 damage or debuff the target, because the damage from the formulas below will occur after the skill's formula box happens. Anyways, test it if you want and you tell me. It should work and do what you wanted, but in case it doesn't, as I can't test it now, write me and I'll fix it, I'm pretty sure I can make it work :rwink:.

<After Eval>
// Initialize the HP value.
var hp = 0;
// Loop through all 8 parameters.
for (var i = 0; i < 8; i++) {
// If it is a debuff...
if (target._buffs < 0) {
// Then increase the damage by a formula.
hp -= user.mdf * 2;
}
// Check if the HP change is negative...
} if (hp < 0) {
// Play an animation.
target.startAnimation(animation Id from your animations list here);
}
// Check if the HP amount isn't 0...
if (hp !== 0) {
// Alter the target's HP.
target.gainHp(hp);
// Start the damage popup for the target.
target.startDamagePopup();
}
// Clear the target's results.
target.clearResult();
</After Eval>
Err, I uses RPG VX Ace, not MV...

A damage formula should suffice.

dmg = a.atk * 4 - b.def * 2; dmg * (1 + (0..7).to_a.select {|id| b.debuff?(id)}.size)
I've tried these, but they didn't work. I attack the first time, which damages enemy 195. The second, with 1 debuffs, damages enemy 173, the third with 3 debuffs damages enemy 162...
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Hm... are you aware of the distinction between buffs and states?
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
...

What are these "debuffs" that you want to check for?
 

Waveclaw

Veteran
Veteran
Joined
Apr 20, 2018
Messages
114
Reaction score
19
First Language
English
Primarily Uses
RMVXA
...

What are these "debuffs" that you want to check for?
Bleed, which damages enemy like poison. Exposed, blind, bleeding eyes, unbalance, knocked-down, stun, paralize, and poison.
 

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
113
Reaction score
155
First Language
English
Primarily Uses
RMVXA
States:


Buffs/Debuffs:


When you add a buff, you increase a param by 25% each time (up to 2 times) or -25% in case of a debuff
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
This can be addressed with a similar formula, but I don't have time right now.
 

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
113
Reaction score
155
First Language
English
Primarily Uses
RMVXA
Luckily for me it sounds a lot easier to just count the number of states. I think this should work:

dmg = a.atk * 4 - b.def * 2; dmg * (1 + b.states.size)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
@Waveclaw If the query is resolved please Report your opening post and ask for it to be closed .
Thanks
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,381
Reaction score
8,537
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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,048
Messages
1,018,543
Members
137,834
Latest member
EverNoir
Top