Exploiting enemy weakness.

KaosChrist

Villager
Member
Joined
Jan 24, 2015
Messages
12
Reaction score
4
First Language
English
Primarily Uses
Hello, I want use lunatic to create a state that when the effected is stuck for weakness it does increased damage. Any help would be appreciated. Has to be lunatic no default functions for it exist in any plug ins. It is to remake the T&T for Atunement (http://www.yanfly.moe/wiki/Attunement_(MV_Plugin_Tips_&_Tricks)) in a way the state is on the target of the skills, not a passive on the user. Thanks.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
271
Reaction score
32
First Language
English
Primarily Uses
Hello, I want use lunatic to create a state that when the effected is stuck for weakness it does increased damage. Any help would be appreciated. Has to be lunatic no default functions for it exist in any plug ins. It is to remake the T&T for Atunement (http://www.yanfly.moe/wiki/Attunement_(MV_Plugin_Tips_&_Tricks)) in a way the state is on the target of the skills, not a passive on the user. Thanks.
Im not sure I 100% understand but why not use the default;
In states, traits, elemental rate * X%
Elemental Rate Fire * 130% means target takes 30% extra fire damage.

You want a state that makes enemies take more elemental damage?
 

KaosChrist

Villager
Member
Joined
Jan 24, 2015
Messages
12
Reaction score
4
First Language
English
Primarily Uses
Im not sure I 100% understand but why not use the default;
In states, traits, elemental rate * X%
Elemental Rate Fire * 130% means target takes 30% extra fire damage.

You want a state that makes enemies take more elemental damage?
Exactly. A state that rewards hitting a weakness by adding more damage.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
271
Reaction score
32
First Language
English
Primarily Uses
In addition to the weakness damage already done?
Okay I misunderstood! I thought you wanted to have them take extra damage from an element. Oh boy lol!

Its simple then, its the same code but you use React instead of Confirm. If you apply the state on target and you hit a weakness they take more damage!

Code:
<Custom React Effect>
// Check if the action deals HP damage
if (this.isHpEffect() && value > 0) {
  // Get this action's elements
  var elements = this.getItemElements();
  // Loop through each of the elements
  for (var i = 0; i < elements.length; ++i) {
    // Get the currently looped element
    var elementId = elements[i];
    // Check if the target is weak to the element
    if (target.elementRate(elementId) > 1.00) {
      // Set the bonus damage rate to be dealt
      var rate = 1.3;
      // Calculate the new damage value
      value = Math.ceil(value * rate);
      // Break the loop
      break;
    }
  }
}
</Custom React Effect>
 

KaosChrist

Villager
Member
Joined
Jan 24, 2015
Messages
12
Reaction score
4
First Language
English
Primarily Uses
Wow that worked. I tried that before but it didn't. How weird. Anyway thanks a bunch. I'd been frustrated over this for days.
Okay I misunderstood! I thought you wanted to have them take extra damage from an element. Oh boy lol!

Its simple then, its the same code but you use React instead of Confirm. If you apply the state on target and you hit a weakness they take more damage!

Code:
<Custom React Effect>
// Check if the action deals HP damage
if (this.isHpEffect() && value > 0) {
  // Get this action's elements
  var elements = this.getItemElements();
  // Loop through each of the elements
  for (var i = 0; i < elements.length; ++i) {
    // Get the currently looped element
    var elementId = elements[i];
    // Check if the target is weak to the element
    if (target.elementRate(elementId) > 1.00) {
      // Set the bonus damage rate to be dealt
      var rate = 1.3;
      // Calculate the new damage value
      value = Math.ceil(value * rate);
      // Break the loop
      break;
    }
  }
}
</Custom React Effect>
 

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

Latest Threads

Latest Posts

Latest Profile Posts

It's raining non stop since yesterday. The sound of the rain is so soothing.
I really miss the old style disney animated movies. I guess the last one was The Princess and the Frog from 2009. Now I am trying to collect every single one I can get on BD or DVD.
What I've seen from the MZ tiles looks pretty inconsistent, bleh. Every plant seems to be drawn in a different style.
Recently posted a demo of my game online. Now I have no idea what to do with myself o_O What is the reason for my existence now...
I'm feeling a lot better this week. Some of the rules in my country for isolation changed a little, so I was able to see friends in person again, which was a huge relief. Thanks everyone for giving me some sympathy last week when I was having a rough time!

Forum statistics

Threads
99,287
Messages
963,876
Members
130,898
Latest member
pilami202
Top