Hello, all! I'm working on a state for a character in my game who is an undead. My idea is that instead of the normal Death state, they have a custom 'Fallen' state applied that lasts for 7 turns and then revives them with 5% MHP + 150.
Using Yanfly's Auto Passive States, I created the state and gave it the passive condition of 'HP below 1,' while also making the actor resistant to the base Knockout state. The problem is that the turn counter isn't showing up when the state is applied and when I attempt to check how many turns the state has left in the console, it returns 'NaN.' Is there a different way I should be going about this?
Using Yanfly's Auto Passive States, I created the state and gave it the passive condition of 'HP below 1,' while also making the actor resistant to the base Knockout state. The problem is that the turn counter isn't showing up when the state is applied and when I attempt to check how many turns the state has left in the console, it returns 'NaN.' Is there a different way I should be going about this?
Code:
<Cannot Select: All>
<Passive Condition: hp Below 1>
<custom apply effect>
console.log('Custom Apply Effect');
target._stateTurns[136] = 7;
AudioManager.playSe({
name: 'Collapse4',
volume: 90,
pitch: 100,
pan: 0
});
</custom apply effect>
<custom leave effect>
var value = Math.round(target.mhp * 0.05);
user.startAnimation(70);
target.gainHp(value);
target.startDamagePopup();
target.clearResult();
</custom leave effect>