mage icon indicating copy to clipboard operation
mage copied to clipboard

ENHANCEMENT - It would be nice if "target opponent" autotargeted in 1v1.

Open tiera3 opened this issue 1 year ago • 8 comments

This comes up a lot with OTJ cards but there are a lot of old cards that would benefit from this also.

Example - [[quick draw]]


Of course if there is any card that allows "up to one target opponent" that shouldn't autotarget, but I don't know of any such cards off the top of my head.

tiera3 avatar Jun 13 '24 05:06 tiera3

Quick Draw - (Gatherer) (Scryfall) (EDHREC)

{R} Instant Target creature you control gets +1/+1 and gains first strike until end of turn. Creatures target opponent controls lose first strike and double strike until end of turn.

github-actions[bot] avatar Jun 13 '24 05:06 github-actions[bot]

It already must work for required choices (not up to xxx). Check your auto-choose settings in Preferences dialog.

JayDi85 avatar Jun 13 '24 08:06 JayDi85

I'm pretty sure this is in fact something that's bugged about auto-choices, even if fully enabled

xenohedron avatar Jun 14 '24 02:06 xenohedron

image Not sure what setting you are referring to, so here are my settings. image

When I need to select target creature or a target card in a graveyard, the client autotargets when there is only valid choice - which is what prompted me to make this suggestion. (Target opponent always requires me to manually target.)

tiera3 avatar Jun 14 '24 06:06 tiera3

IMG_0519

JayDi85 avatar Jun 14 '24 06:06 JayDi85

I suspect this has to do with something about TargetOpponent / FilterOpponent / possibleTargets not being properly implemented. Need some clear steps with simple cards/effects to reproduce when it consistently does or doesn't autotarget.

  • Ravenous Rats and Farsight Wizard both auto-choose opponent for me
  • Razortip Whip fails to autochoose, even though no planeswalker available and only one possible target

xenohedron avatar Sep 15 '24 23:09 xenohedron

Alright, I figured it out. PossibleTargets was a red herring (there is a problem with stack objects incorrectly not excluding themselves, but not a problem for target opponent)

It has to do with bad overloaded usage of "isRequired" in Target, exacerbated by the fix in #10557 (which did address a real bug, but not in the best way).

For UI purpose, if casting a spell or activating an ability, it is sensible to allow a "cancel" for human players when choosing targets. Currently it overwrites the target's "required" parameter to false, which prevents autochoose from working for all cast spells and activating abilities, defeating the point in many common scenarios.

This needs to instead use a separate "canBeCanceled" param, distinct from the "required" param used for e.g. Vendilion Clique. Autochoose method then needs to only autochoose if "required", but still autochoose even if "canBeCanceled".

https://github.com/magefree/mage/blob/dadc6775923f6330fd68e0731aece582bd890f89/Mage/src/main/java/mage/abilities/AbilityImpl.java#L390-L392

https://github.com/magefree/mage/blob/754b382e7802fdc45eacd1b8f0ce16666ff33a4f/Mage/src/main/java/mage/target/Targets.java#L90-L93

xenohedron avatar Oct 04 '24 00:10 xenohedron

Or... another approach could be to modify the targets that are explicitly "required = false" to instead use "minNumTargets = 0". This might be cleaner and more practical. Then autochoose logic wouldn't have to check it.

Existing implementation of "required" logic is very messy.

xenohedron avatar Oct 04 '24 02:10 xenohedron