Stop the AI crowning itself when it is already the monarch - #11446
Merged
Conversation
BecomeMonarch was mapped to AlwaysPlayAi, which accepts every activation without looking at the board. GameAction.becomeMonarch returns immediately when the chosen player is already the monarch, so activating one of these abilities while holding the crown does nothing. That is not just a wasted activation. Throne of the High City taps and sacrifices itself for 4, King Solomon's Frogs exiles itself, and Tchaka, Venerable King exiles itself from the graveyard, so the AI was throwing a permanent away for no effect. A test with the old mapping shows Throne of the High City going from one copy on the battlefield to zero. Add BecomeMonarchAi, which declines only when every player the ability would crown is already the monarch. Targeted versions are deliberately left alone: cards like Jared Carthalion, True Heir and Garland, Royal Kidnapper hand the crown to an opponent on purpose to turn on another ability, so the previous always-play behaviour is still right for them. Initiative is intentionally not changed. GameAction.takeInitiative documents that "You can take the initiative even if you already have it" and still runs the trigger, so AlwaysPlayAi remains correct there. forge.ai.** test suite: 248 tests, 0 failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agetian
approved these changes
Jul 29, 2026
Contributor
|
Looks good to me |
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.
BecomeMonarchis mapped toAlwaysPlayAi, whose entire logic isreturn WillPlay— it never looks at the board.GameAction.becomeMonarchreturns immediately when the chosen player is already the monarch:So activating one of these abilities while already holding the crown does nothing at all.
That is not merely a wasted activation, because several of these abilities cost a permanent:
{4}, {T}, Sacrifice{3}, {T}, Exile{3}, Exile from graveyardThe AI was throwing a permanent away for no effect. The added test shows Throne of the High City going from one copy on the battlefield to zero under the old mapping.
The fix
BecomeMonarchAideclines only when every player the ability would crown is already the monarch.Targeted versions are deliberately left alone. Cards like Jared Carthalion, True Heir and Garland, Royal Kidnapper hand the crown to an opponent on purpose in order to turn on another ability, so always-play is still right for them.
Initiative is intentionally not changed
The initiative mechanic looks identical but is not.
GameAction.takeInitiativeexplicitly documents:// You can take the initiative even if you already have itand still runs the
TakesInitiativetrigger in that case, soAlwaysPlayAiremains correct forTakeInitiative.Verification
Three tests, each of which fails on the old mapping or covers a case that must keep working:
doesNotCrownItselfTwice— the regression; fails withexpected:<1> but was:<0>without the fixtakesTheCrownFromAnOpponent— still activates when an opponent holds the crownclaimsAnUnclaimedCrown— still activates when nobody is the monarchforge.ai.**test suite: 248 tests, 0 failures. Fullmvn -U -B clean testacross all 12 modules passes.This PR was previously part of #11441, which bundled it with an unrelated
UnlockDoorfix. Split out so each can be reviewed on its own.Written with the help of GitHub Copilot CLI; the commit carries a
Co-authored-bytrailer for it.