Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #9357.
Emrakul's "protection from spells" ability has been the subject of numerous bugs and regressions (#9357 itself was a regression caused by an incorrect fix for #7033, and that in turn was caused by an incorrect fix for #6946) and really needs a comprehensive set of tests:
ProtectionTest
)I've done each of these tests "by hand" before opening this PR, but they all need to be added to
ProtectionTest
which currently only tests the simplest case.Also, this PR adds an explicit
game.inCheckPlayableState
test for the case of potential spells before casting, but this check is still problematic:I don't know how to fix this without substantial changes to the process of scanning for playable abilities. The problem is that during the check-playable scan, the "source" passed to
ProtectionAbility.canTarget
is simply the Card object in whatever zone it's in, and there's no way to tell whether the proposed use of the card is casting it as a spell or activating one of its abilities.