improve and enable checkMissTargeted verify test
There are 73 unique cards failing. The ones I've checked all add a target inside of checkTrigger or apply. Most of them likely could be using TargetAdjusters instead, but need to be manually reviewed. Soulshift and Provoke are explicitly excluded, as they too add their target inside the ability.
I have two different checks that attempt to search out recursive abilities (abilities that involve a targeting ability inside of them), one that operates on the card text directly and on that operates on the card's abilities. Ideally the test would check that both see the same ability, but currently I exclude the card if either check is passed to eliminate a large number of false positives.
As idea: there are possible cards with gain and token effects that can wrongly require target after rules parse.
As idea: there are possible cards with gain and token effects that can wrongly require target after rules parse.
All of those should be handled with the recursive ability checks. If not for that there would be hundreds more cards in the list.
All cards' targets have been fixed, this verify check is now ready to be merged. The regex and reflection involved are a little ugly, but there's a lot of weird exceptions in Magic's card text that all need to be accounted for.
Still need to add some card examples and a few more explanations, but hopefully this is a lot more readable than the original. Caught a few cards that the old regex missed!
Ok, explanations and example cards added. Is this good to merge or is some part still too weird?
I don't see how it could simplify the checks. It could make them lot more precise (and thus more likely to catch errors), but would need additional complexity to properly handle auras and nonpermanent cards (SpellAbility target)
That being said, I think #13710 is more important than this one since that one fixes several currently-bugged cards whereas this is just an extra verify check.
Now supports per-ability checking of targets. This means it's using the XMage card text instead of the reference card text, which could cause problems if the two don't match up well enough. Not sure if there's a good way to fix that.
@JayDi85 Is this ok to merge? It now does two separate checks:
- Per-ability check that XMage rules text does or does not contain "target" when expected (always accepts if a complex ability target is found in either the text or the ability's internal fields)
- Per-card check that the number of times "target" appears in the XMage rules text is the same as in the reference text.