Hi.İm making a passive state for my final boss but i ve got a issue with that.Im using Yanfly's Adapting Armor Tip.
http://www.yanfly.moe/wiki/Adapting_Armor_(MV_Plugin_Tips_&_Tricks)
When the user takes damage from an elemental attack, the user will gain a buff that grants a massive resistance(%90) to the elemental damage received. İts really cool but I want to make some changes.I want to make it to gain resistance to last element it receives.For example if it receives fire damage it gains resistane to fire element.And then if it receives poison damage the fire resistance buff is erased and gain poison resistance buff.For example if it receives ice damage then posion resistance buff will be erased too and it gains ice resistance buff.Hope i can explain.İt can gain only 1 element resistance at time.İn this code element resistance buffs are stacking hope somebody help me with this.
http://www.yanfly.moe/wiki/Adapting_Armor_(MV_Plugin_Tips_&_Tricks)
When the user takes damage from an elemental attack, the user will gain a buff that grants a massive resistance(%90) to the elemental damage received. İts really cool but I want to make some changes.I want to make it to gain resistance to last element it receives.For example if it receives fire damage it gains resistane to fire element.And then if it receives poison damage the fire resistance buff is erased and gain poison resistance buff.For example if it receives ice damage then posion resistance buff will be erased too and it gains ice resistance buff.Hope i can explain.İt can gain only 1 element resistance at time.İn this code element resistance buffs are stacking hope somebody help me with this.
<Custom Respond Effect>
// Check if the target received HP damage.
if (target.result().hpDamage > 0) {
// Get all of the elements used for this attack.
var elements = this.getItemElements();
// Loop through all the elements.
while (elements.length > 0) {
// Get the current element.
var element = elements.shift();
// Set the default state.
var state = 0;
// If the current element ID is 7...
if (element === 7) {
// ...then apply state 121.
state = 121;
// If the current element ID is 8...
} else if (element === 8) {
// ...then apply state 122.
state = 122;
// If the current element ID is 9...
} else if (element === 9) {
// ...then apply state 123.
state = 123;
// If the current element ID is 10...
} else if (element === 10) {
// ...then apply state 124.
state = 124;
// If the current element ID is 11...
} else if (element === 11) {
// ...then apply state 125.
state = 125;
// If the current element ID is 12...
} else if (element === 12) {
// ...then apply state 126.
state = 126;
// If the current element ID is 13...
} else if (element === 13) {
// ...then apply state 127.
state = 127;
// If the current element ID is 14...
} else if (element === 14) {
// ...then apply state 128.
state = 128;
// If the current element ID is 15...
} else if (element === 15) {
// ...then apply state 129.
state = 129;
// If the current element ID is 16...
} else if (element === 16) {
// ...then apply state 130.
state = 130;
}
// If the state is a positive number...
if (state) {
// ...then add the state to the target.
target.addState(state);
// And play an animation on the target.
target.startAnimation(53);
}
}
}
</Custom Respond Effect>
// Check if the target received HP damage.
if (target.result().hpDamage > 0) {
// Get all of the elements used for this attack.
var elements = this.getItemElements();
// Loop through all the elements.
while (elements.length > 0) {
// Get the current element.
var element = elements.shift();
// Set the default state.
var state = 0;
// If the current element ID is 7...
if (element === 7) {
// ...then apply state 121.
state = 121;
// If the current element ID is 8...
} else if (element === 8) {
// ...then apply state 122.
state = 122;
// If the current element ID is 9...
} else if (element === 9) {
// ...then apply state 123.
state = 123;
// If the current element ID is 10...
} else if (element === 10) {
// ...then apply state 124.
state = 124;
// If the current element ID is 11...
} else if (element === 11) {
// ...then apply state 125.
state = 125;
// If the current element ID is 12...
} else if (element === 12) {
// ...then apply state 126.
state = 126;
// If the current element ID is 13...
} else if (element === 13) {
// ...then apply state 127.
state = 127;
// If the current element ID is 14...
} else if (element === 14) {
// ...then apply state 128.
state = 128;
// If the current element ID is 15...
} else if (element === 15) {
// ...then apply state 129.
state = 129;
// If the current element ID is 16...
} else if (element === 16) {
// ...then apply state 130.
state = 130;
}
// If the state is a positive number...
if (state) {
// ...then add the state to the target.
target.addState(state);
// And play an animation on the target.
target.startAnimation(53);
}
}
}
</Custom Respond Effect>