Nullify negative state once per battle?

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
410
Reaction score
61
First Language
English
Primarily Uses
Im trying to make a set of equipment and skill with the ability nullify a negative effect once per battle.
A negative effect being states like blind or poison and also any debuff.
If you have 2 different pieces and the skill you can get this effect 3 times per battle, so it is a unique occurrence.

A little while ago I got some help with a similar type of skill, that raised defence until the actor got hit. I figure I can model it after this, having a state that resists debuffs and the negatives states. But is there a way to check if the attack in question were to apply a debuff? Or would I have to create an if (this.isSkill() && (skills.contains(this.item().id))) and put any skill that does any sort of negative effect in this code? Also not sure how it could work with skills that only have a chance to inflict a negative effect

Code:
<Custom Apply Effect>
var atkcount = 1; //This is the attack counter. Change it to fit your purpose
target._attackCount = target._attackCount || atkcount;
target.setStateCounter(99, target._attackCount); //Set a counter to your state. Change X to your state ID
</Custom Apply Effect>

<Custom React Effect>
//Check if actor takes dmg
if (value > 0 && !this.isHpRecover()){
//Decrease the attack counter by 1
target._attackCount -= 1;
//Set a counter to your state. Change X to your state ID
target.setStateCounter(99, target._attackCount);
//Check if attack counter reaches 0
if (target._attackCount <=0){
//Remove the state. Change X to your state ID
target.removeState(99);}}
</Custom React Effect>

<Custom Remove Effect>
user._attackCount = undefined;
</Custom Remove Effect>
Alternatively im trying something like this, but I cant get the passive skill to add this state at the beginning of battle.
I can have it check if I got a debuff or poisoned it would instantly cure or remove the effect, play an animation and remove 1 from the state counter, then check if its at 0, remove the state all together.
Code:
<Custom React Effect>
//Check if actor takes dmg
if (target._buffs[0] < 1) {
    target._buffs[0] *= 0;
    target.startAnimation(59);
    atkcount -= 1;
}
if (target.isStateAffected(4)) {
    target.removeState(4);
    target.startAnimation(59);
    atkcount -= 1;
}
//Set a counter to your state. Change X to your state ID
target.setStateCounter(99, target._attackCount);
//Check if attack counter reaches 0
if (target._attackCount <=0){
//Remove the state. Change X to your state ID
target.removeState(99);}}
</Custom React Effect>
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
410
Reaction score
61
First Language
English
Primarily Uses
So did the best I could and added a state to resist psn and all debuffs, then used
Code:
<Custom Deselect Effect>
var skills = [];
skills.push(422);
if (this.isSkill() && (skills.contains(this.item().id))) {
    target.startAnimation(59);
    target.removeState(67);
}
</Custom Deselect Effect>
I will have to add all the skills into push that would trigger a negative stats, it would resist that status then remove the state.
I cant get it the way I first thought unless theres a way to check if the state or debuff was being applied but from what I seen, it only checks if the actor isStatedAffected.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top