Skip to content

Juxtapose, Tariff - fixed game error when choosing among tied permanents - #16437

Open
DominionSpy wants to merge 1 commit into
magefree:masterfrom
DominionSpy:fix-juxtapose-tariff-tied-choice
Open

DominionSpy wants to merge 1 commit into
magefree:masterfrom
DominionSpy:fix-juxtapose-tariff-tied-choice

Conversation

@DominionSpy

Copy link
Copy Markdown
Contributor

Fixes #16436

When two or more permanents were tied for highest mana value, Juxtapose and Tariff asked the player to choose one with a TargetCard in the battlefield zone. TargetCard doesn't support the battlefield, so the choice threw IllegalArgumentException: Unsupported TargetCard zone: BATTLEFIELD for human and AI players.

Changes

  • Both cards now choose among the tied permanents with a non-targeting TargetPermanent restricted by PermanentReferenceInCollectionPredicate, the same approach as the Aetherspouts fix in Rework Aetherspouts to use non-targeting permanent selection #14616. Human players make the choice by clicking a permanent on the battlefield. These were the last new TargetCard(Zone.BATTLEFIELD, ...) uses in Mage.Sets.
  • The choice uses Outcome.Detriment instead of Outcome.Benefit, so the AI gives away (Juxtapose) or pays for or sacrifices (Tariff) its least valuable tied permanent rather than its best one.

Tests

JuxtaposeTest and TariffTest each cover a tie chosen explicitly by each player and a tie chosen by the AI. The Juxtapose tests include tied creatures and tied artifacts on both sides. All four tests fail on master with the reported error and pass with this change.

🤖 Generated with Claude Code

When two or more permanents were tied for highest mana value, both cards
asked the player to choose one with a TargetCard in the battlefield zone.
TargetCard does not support the battlefield, so the choice threw
"IllegalArgumentException: Unsupported TargetCard zone: BATTLEFIELD" for
human and AI players alike.

Choose among the tied permanents with a non-targeting TargetPermanent
restricted by PermanentReferenceInCollectionPredicate, as done for
Aetherspouts in magefree#14616. The choice now uses Outcome.Detriment, so the AI
gives away (Juxtapose) or pays for/sacrifices (Tariff) its least valuable
tied permanent instead of its best one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Juxtapose, Tariff - game error when two or more permanents are tied for highest mana value

2 participants