I just updated the main post with V3 of the block chance state. I identified a potential problem, where a blocker who successfully blocked an incoming action that would add a state (like a venomous bite) would still have the state applied to him as if the ability had landed a hit.
I did this by storing the states the target had before being hit, and then reverting the target's current states back to what they were before being hit, but only if a block was successful.
One potential problem I can see with this, is that if an attack was supposed to remove a state from the target, but was blocked, that state will not be removed. So be aware that if that is something you've used, you might need to find another way to remove the state in that case.
Also, because of the way I am negating these states, a <custom apply effect> will still apply to the blocking actor, but a <custom remove effect> will not. Depending on what you were using this for, this could cause some unintended behavior, so watch out for that as well.
Edit:
I just updated the main post again with v4 for the state paste code. This will correct the above issue where states didn't play their remove effect when removed by the blocking state.
There is still an issue where a state that was applied by a skill that was blocked will still be applied to the battler for a couple of frames, and will continue to perform it's custom apply effect, as well as it's remove effect now. This will prevent issues arising from states that relied on the remove effect to restore missing values from an affected battler when the state clears.
Unfortunately, it still has the side effect that the state is applied briefly, instead of being completely resisted.
There are two examples where this could prove to be a problem:
- A state that sets a 'cannot move' restriction will cancel the afflicted battler's action during the turn he is hit with it. This is only an issue using the DTB
- If state that is being used as a custom death condition is applied to the only living actor will immediately cause a game over condition, even though the state was only on the battler for a few frames. Likewise, if this happens to an enemy, the party will immediately be victorious.
I am still looking for a way to strip the added states off an incoming action from inside a react effect, in the same way I can make the damage = 0.