Reflect X% damage?

RMVNex

Some guy from the internet...
Veteran
Joined
Nov 26, 2016
Messages
56
Reaction score
8
First Language
FR (Perfect EN)
Primarily Uses
N/A
Hi! In the game I'm making, there are about 20 different characters (as of right now). Some are warriors, others are mages, others are supports and the others are tanks. Now I want to make a bit of diversity amongst those tanks, not just taking hits and a bit of healing here and there. I was wondering if there's a way to make a skill that reflects X% damage taken by the skill's user. I think it'd be a skill that adds a status to that character for let's say 3 turns, but there seems to be no way of doing this. I've seen a plugin (Yanfly's element core, to be exact) that reflects damage of certain elements. I'm looking for a plugin that simply reflects a certain portion of taken damage. Let's say I'd want to make a skill that reflects 30% taken damage. The user would take let's say 200 damage, and he'd reflect 60 to whoever dealt damage to him... Please help! I really need this for one of the characters I'm trying to make, since he's going to be based around that damage reflect ability...
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Have you tried searching for Thorn Mail effect?  I did this in Ace and I would be surprised if there wasn't an equivalent in MV.


You are searching for a plugin so...


I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

RMVNex

Some guy from the internet...
Veteran
Joined
Nov 26, 2016
Messages
56
Reaction score
8
First Language
FR (Perfect EN)
Primarily Uses
N/A
@Kes This is what it gives me. It tells me to copy paste this... 


<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
  // Sets the Recoil Rate to 15%.
  var rate = 0.15;
  // Determines the amount of recoil damage dealt.
  var recoil = value * rate;
  // Sets the DEF bonus rate to 25%.
  var rate = 0.25;
  // Determines the amount of bonus damage dealt.
  var bonus = target.def * rate;
  // Rounds up the bonus damage and recoil damage.
  var dmg = Math.ceil(bonus + recoil);
  // Makes the attacker lose damage equal to the dmg variable.
  user.gainHp(-1 * dmg);
  // Check to see if the attacker is dead.
  if (user.isDead()) {
    // If the attacker is dead, make it collapse.
    user.performCollapse();
  }
}
</Custom React Effect>


I don't know if you know how it works, but would you know how to change how much damage % it reflects, and how to change/remove the defence part?


Even if you don't you've already helped me a ton, so thanks! :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I don't know Javascript, but at the moment it looks like the damage is set as a percentage (15%).  That's what the Recoil Rate is.


As for removing the defence part, what I would suggest is that where it has


// Sets the DEF bonus rate to 25%.
  var rate = 0.25;


you just change the second line to


var rate = 0
 

RMVNex

Some guy from the internet...
Veteran
Joined
Nov 26, 2016
Messages
56
Reaction score
8
First Language
FR (Perfect EN)
Primarily Uses
N/A
Yeah that seems logical. That was kind of a stupid question, but thanks for helping out bud!
 

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,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top