mage icon indicating copy to clipboard operation
mage copied to clipboard

Card rules generator don't use target pointers

Open JayDi85 opened this issue 6 years ago • 3 comments

As example: Essence Capture (fix: 0b648343bc25fad65f9f72d6c54a4a8987e09e0a)

That's spell uses target pointer for second effect:

  • .setTargetPointer(new SecondTargetPointer())

But rules generation in AddCountersTargetEffect uses first target only:

  • Target target = mode.getTargets().get(0);

There are not so many affected cards (~100).

TODO:

  • [x] implement targetPointer processing in rules;
  • [x] search files for mode.getTargets().get(0) and replace it with
    • getTargetPointer().describeTargets(mode.getTargets(), "{default for empty/fixed target}");

Most effects have been cleaned up. The remaining effects use a second target or need to check some other feature of the target, so more work would be needed:

  • [ ] DamageMultiEffect
  • [x] DamageTargetEffect
  • [ ] DamageWithPowerFromOneToAnotherTargetEffect
  • [ ] DontUntapInControllersNextUntapStepTargetEffect
  • [ ] FightTargetsEffect
  • [ ] PutOnLibraryTargetEffect
  • [ ] ReturnFromGraveyardToBattlefieldTargetEffect
  • [ ] TargetPlayerShufflesTargetCardsEffect

JayDi85 avatar Jan 14 '19 07:01 JayDi85

Has this been done, and if not, can we get a list of the places that would need to be fixed as a mini-tracking project?

Zerrisx avatar Jul 13 '20 22:07 Zerrisx

It's not done and can be fixed very easy (see TODO list with search and fix example in rules generation).

I updated topic with effects and cards list to check/fix.

JayDi85 avatar Jul 14 '20 02:07 JayDi85

I didn't see this issue until I had started implementing this myself.

Anyway, Targets.getEffectTarget is gone. The new way to do it is with TargetPointer.describeTargets, which handles all the text generation for you--numbers, "up to", and even multiple targets with EachTargetPointer.

awjackson avatar Oct 14 '22 04:10 awjackson