I am trying to make skill that camouflages the battler. The skill applies a state alled camouflage that upon being apoplied changes the battlers opacity to 128 but when the state is removed it is supposed to return to 255 but it doesn't. Can anyone help me with this?
JavaScript:
<Custom Apply Effect>
console.log(user.name() + " is now camouflaged!");
if (user.isActor()) {
user._spriteOpacity = this.spriteOpacity();
user._battleSpriteOpacity = 128;
user.refresh();
}
</Custom Apply Effect>
<Custom Remove Effect>
if (user.isActor()) {
user._spriteOpacity = this.spriteOpacity();
user._battleSpriteOpacity = 255;
user.refresh();
}
</Custom Remove Effect>