Let the AI use Fauna Shaman's tutor#11348
Merged
Merged
Conversation
Fauna Shaman ({G}, {T}, Discard a creature: search your library for a
creature and put it into your hand) is not flagged, so the AI runs it,
but it never activates the ability - it plays as a vanilla 2/2.
The block is the discard cost. SpellAbilityAi.willPayCosts ->
ComputerUtilCost.checkDiscardCost asks ComputerUtil.getCardPreference for
a "DiscardCost" creature to pitch; with no preference declared it returns
null, so the AI decides CostNotAcceptable and never tutors. The cost is
judged in isolation, without crediting that the tutor hands back a
stronger creature.
Survival of the Fittest is the same ability ({G}, discard a creature:
tutor a creature to hand) and already solves this with two hints:
AILogic$ SurvivalOfTheFittest
SVar:AIPreference:DiscardCost$Special:SurvivalOfTheFittest
The backing SpecialCardAi.SurvivalOfTheFittest handlers
(considerDiscardTarget / considerCardToGet) are generic - they only look
at the AI's own creatures in hand and library and its mana - so they
apply unchanged to Fauna Shaman. Add the same two hints.
Verified: before, canPlaySa returns CostNotAcceptable. After, at the
window this logic fires (the opponent's end of turn, just before the AI's
turn) the AI activates it, discards its worst spare creature and fetches
the best affordable one - identical to Survival of the Fittest. 286 desktop
tests still pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Agetian
approved these changes
Jul 24, 2026
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.
Fauna Shaman (
{G}, {T}, Discard a creature: search your library for a creature and put it into your hand) is unflagged, so the AI runs it — but it never uses the ability, playing as a vanilla 2/2.Cause
The block is the discard cost, not targeting or timing.
SpellAbilityAi.willPayCosts→ComputerUtilCost.checkDiscardCostcallsComputerUtil.getCardPreference(ai, source, "DiscardCost", …); with no preference declared it returnsnull, so the decision comes backCostNotAcceptableand the tutor never fires. The cost is judged in isolation, with no credit for the fact that the tutor hands back a stronger creature than the one discarded.Fix
Survival of the Fittestis the same ability ({G}, discard a creature: tutor a creature to hand) and already handles this with two hints:The backing
SpecialCardAi.SurvivalOfTheFittesthandlers (considerDiscardTarget/considerCardToGet) are generic — they look only at the AI's own creatures in hand and library and its available mana, with no binding to the Survival card. So they apply unchanged to Fauna Shaman. This PR adds the same two hints; no Java change.Verified
canPlaySa(untapped, fodder in hand)CostNotAcceptableWillPlayat its firing windowConcretely: with two Grizzly Bears + a Runeclaw Bear in hand and a Colossal Dreadmaw in the library, it discards a Grizzly Bears and fetches the Dreadmaw — same behaviour as Survival of the Fittest, which fires this logic at the opponent's end of turn just before the AI's turn. 286 desktop tests pass.
Written with Claude Code (Opus 4.8), per the AI coding agent guidance in CONTRIBUTING.md; also recorded as a commit co-author.