I have an accessory in my game called the "Scapegoat Token", which once per battle will "absorb" a negative status effect that would have been applied to the wearer.
The way I implemented this was whenever a character is hit by a skill that might apply a negative status, a common event checks if that character now has one of those states, if they are wearing the accessory, and if the token has not already been "broken" earlier in the battle. If all those conditions are met, that state is removed and the switch indicating that the token is "broken" for the rest of the battle is toggled.
Here's a screenshot showing the general shape of it:
I had previously tested and found that actors weren't affected by restrictions that were immediately removed, for example, a character that was hit by a state with the "attack an enemy" restriction that was absorbed by the token will use the correctly selected skill against the correctly selected enemy or ally.
However, more recently I found that if the token removes a state with the "cannot move" restriction before that character has taken their action for that turn, that restriction still takes effect even though it was removed. The renders the item useless for states where the effect is "cannot move for 1 turn".
So I need to find a way to get this accessory properly nullifying "cannot move" states. Is there a way to "restore" a turn that was lost in this way?
An implementation that uses the "resist" trait might work, but part of the reason this implementation had been working for me is that removing the state after it's been applied gave something tangible to check against to know when the token should "break." When different skills have different rates of applying a state that are also sometimes different than the skill's success rate, I have no idea how to check if a resisted state was "blocked" by the accessory.
The way I implemented this was whenever a character is hit by a skill that might apply a negative status, a common event checks if that character now has one of those states, if they are wearing the accessory, and if the token has not already been "broken" earlier in the battle. If all those conditions are met, that state is removed and the switch indicating that the token is "broken" for the rest of the battle is toggled.
Here's a screenshot showing the general shape of it:
I had previously tested and found that actors weren't affected by restrictions that were immediately removed, for example, a character that was hit by a state with the "attack an enemy" restriction that was absorbed by the token will use the correctly selected skill against the correctly selected enemy or ally.
However, more recently I found that if the token removes a state with the "cannot move" restriction before that character has taken their action for that turn, that restriction still takes effect even though it was removed. The renders the item useless for states where the effect is "cannot move for 1 turn".
So I need to find a way to get this accessory properly nullifying "cannot move" states. Is there a way to "restore" a turn that was lost in this way?
An implementation that uses the "resist" trait might work, but part of the reason this implementation had been working for me is that removing the state after it's been applied gave something tangible to check against to know when the token should "break." When different skills have different rates of applying a state that are also sometimes different than the skill's success rate, I have no idea how to check if a resisted state was "blocked" by the accessory.