- 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
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.
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>
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>
