Repository navigation
Juxtapose, Tariff - fixed game error when choosing among tied permanents - #16437
Open
DominionSpy wants to merge 1 commit into
Open
DominionSpy wants to merge 1 commit into
DominionSpy wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16436
When two or more permanents were tied for highest mana value, Juxtapose and Tariff asked the player to choose one with a
TargetCardin the battlefield zone.TargetCarddoesn't support the battlefield, so the choice threwIllegalArgumentException: Unsupported TargetCard zone: BATTLEFIELDfor human and AI players.Changes
TargetPermanentrestricted byPermanentReferenceInCollectionPredicate, 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 lastnew TargetCard(Zone.BATTLEFIELD, ...)uses in Mage.Sets.Outcome.Detrimentinstead ofOutcome.Benefit, so the AI gives away (Juxtapose) or pays for or sacrifices (Tariff) its least valuable tied permanent rather than its best one.Tests
JuxtaposeTestandTariffTesteach 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