mage icon indicating copy to clipboard operation
mage copied to clipboard

improve and enable checkMissTargeted verify test

Open ssk97 opened this issue 7 months ago • 2 comments

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.

ssk97 avatar May 17 '25 23:05 ssk97

As idea: there are possible cards with gain and token effects that can wrongly require target after rules parse.

JayDi85 avatar May 18 '25 04:05 JayDi85

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.

ssk97 avatar May 18 '25 04:05 ssk97

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.

ssk97 avatar Jun 21 '25 02:06 ssk97

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!

ssk97 avatar Jun 21 '25 13:06 ssk97

Ok, explanations and example cards added. Is this good to merge or is some part still too weird?

ssk97 avatar Jun 22 '25 03:06 ssk97

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.

ssk97 avatar Jun 22 '25 08:06 ssk97

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.

ssk97 avatar Jun 29 '25 22:06 ssk97

@JayDi85 Is this ok to merge? It now does two separate checks:

  1. 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)
  2. Per-card check that the number of times "target" appears in the XMage rules text is the same as in the reference text.

ssk97 avatar Jul 19 '25 08:07 ssk97