I've been try to create a skill like yawn from pokemon. (After 3 turns the target of the the yawn falls asleep.)
I have hit a roadblock when it come to the the code of the state however, and cannot seem to get the sleep state to trigger on the target of the droway state.
I believe the error is coming from the on Erase State, I cannot figure out how to get it so the sleep effect isn't instantly removed.
If anyone knows away to fix this or has an easier way please let me know.
JavaScript:
<JS On Add State>
user.clearActions();
let text = `<CENTER>${target.name()} will fall Asleep in 3 turns.`;
SceneManager._scene._logWindow._lines.push(text);
SceneManager._scene._logWindow.refresh();
</JS On Add State>
<JS On Erase State>
console.log("Applying state 10 to", target.name());
target.addState(10);
</JS On Erase State>
**EDIT**
I figured out the issue had to do with the fact I had remove by restriction selected on my sleep state, which was causing an automatic removal effect.
I have hit a roadblock when it come to the the code of the state however, and cannot seem to get the sleep state to trigger on the target of the droway state.
I believe the error is coming from the on Erase State, I cannot figure out how to get it so the sleep effect isn't instantly removed.
If anyone knows away to fix this or has an easier way please let me know.
JavaScript:
<JS On Add State>
user.clearActions();
let text = `<CENTER>${target.name()} will fall Asleep in 3 turns.`;
SceneManager._scene._logWindow._lines.push(text);
SceneManager._scene._logWindow.refresh();
</JS On Add State>
<JS On Erase State>
console.log("Applying state 10 to", target.name());
target.addState(10);
</JS On Erase State>
**EDIT**
I figured out the issue had to do with the fact I had remove by restriction selected on my sleep state, which was causing an automatic removal effect.