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: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Government : "Hehehe~ I will spread lies that the earth is round so that I could sell globes~"
Anyone here managed to never burn out on programming? My current limit is 3 months(6-8 hours per day, 7 days per week, 50 hour programming week on average), and then I just have to take a break, sometimes lasting few days(with at most 2 hours on programming per day). I've been always like this so far, so I admire those who can always be so passionate on programming :)

Forum statistics

Threads
99,658
Messages
967,759
Members
131,338
Latest member
Vattitheminish
Top