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
275
Reaction score
37
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
275
Reaction score
37
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 Profile Posts

https://s12.directupload.net/images/200715/34vwhkoz.png Finally have a concept I am happy with, now I just have to decide wheather I really want to do it as vector art.
I just keep coming up with weird ideas, and then spend the time trying to make sense out of it.:kaocry:
Hi, Erm... My name is zozobie! I just had a snack.
Face masks are to be compulsory when inside shops in England from the 24th of July. People can be fined £100 if they fail to comply.

Forum statistics

Threads
99,690
Messages
968,058
Members
131,379
Latest member
MikuRikku
Top