Hello fellow game-makers!
I'm looking to make it so that the party members (and Player), will develop a passive [Poison Resistance] skill after being affected by Poison X amount of times. I've figured out a stacking debuff previously (with considerable help), and thought the principles were similar, but I have a feeling that I'm not using the correct script pieces.
The code in the screenshot is:
The poison should do 5% max HP damage, unless the character has a special skill, then the poison will heal. I got the damage to work initially, but it stopped working entirely when I added the conditional damage in there. The Custom Action End Effect doesn't seem to work at all. I'm guessing that I'm doing a small piece of the script incorrectly (namely, calling a function incorrectly).
This combines the effects of 3 or 4 different YanFly plugins. I have the complete pack of them, so if another one needs to be utilized to solve this, then this is not an issue.
Thank you in advance for the help!
I'm looking to make it so that the party members (and Player), will develop a passive [Poison Resistance] skill after being affected by Poison X amount of times. I've figured out a stacking debuff previously (with considerable help), and thought the principles were similar, but I have a feeling that I'm not using the correct script pieces.
The code in the screenshot is:
Code:
<Reapply Reset Turns>
<Custom Apply Effect>
target._stackingPoison = target._stackingPoison || 0;
target._stackingPoison += 1;
</Custom Apply Effect>
<Custom Regenerate Effect>
var damage = Math.round(a.mhp * 0.05);
if(target.isStateAffected(167)){
damage = Math.round(a.mhp * 0.1);
target.gainHp(damage);
}
Else{target.gainHp(-damage);}
</Custom Regenerate Effect>
<Custom Action End Effect>
if(target._hasSkill(387)||target._hasSkill(319)){target._stackingPoison = 0;}
Else{
if(target._stackingPoison >== 90){target.learnSkill(319); target.forgetSkill(318);}
Else{if(target._stackingPoison >== 70){target.learnSkill(318); target.forgetSkill(317);}
Else{if(target._stackingPoison >== 50){target.learnSkill(317); target.forgetSkill(316);}
Else{if(target._stackingPoison >== 30){target.learnSkill(316); target.forgetSkill(315);}
Else{if(target._stackingPoison >== 10){target.learnSkill(315)}
}}}}}
</Custom Action End Effect>
The poison should do 5% max HP damage, unless the character has a special skill, then the poison will heal. I got the damage to work initially, but it stopped working entirely when I added the conditional damage in there. The Custom Action End Effect doesn't seem to work at all. I'm guessing that I'm doing a small piece of the script incorrectly (namely, calling a function incorrectly).
This combines the effects of 3 or 4 different YanFly plugins. I have the complete pack of them, so if another one needs to be utilized to solve this, then this is not an issue.
Thank you in advance for the help!