Skip to content

Fix AI for Forge of Heroes and similar counter-boon pump wrappers#10620

Open
Madwand99 wants to merge 2 commits intoCard-Forge:masterfrom
Madwand99:FixAIUseOfForgeOfHeroes
Open

Fix AI for Forge of Heroes and similar counter-boon pump wrappers#10620
Madwand99 wants to merge 2 commits intoCard-Forge:masterfrom
Madwand99:FixAIUseOfForgeOfHeroes

Conversation

@Madwand99
Copy link
Copy Markdown
Contributor

@Madwand99 Madwand99 commented May 7, 2026

This fixes an AI targeting issue where Forge of Heroes could target an opponent’s commander instead of the AI’s own commander.

Added regression tests confirming that Forge of Heroes targets the AI’s own commander even when the opponent’s commander is also legal and stronger.

Tested with:

mvn -pl forge-gui-desktop -am -Dtest=forge.ai.ability.PumpAiTest -Dsurefire.failIfNoSpecifiedTests=false test

Fixes #9641

Comment thread forge-ai/src/main/java/forge/ai/SpellAbilityAi.java Outdated
@squee1968 squee1968 requested a review from Agetian May 7, 2026 09:24
Comment thread forge-ai/src/main/java/forge/ai/ability/PumpAi.java Outdated
Comment thread forge-ai/src/main/java/forge/ai/SpellAbilityAi.java Outdated
@Jetz72 Jetz72 added the AI General AI tag label May 7, 2026
Types:Land
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ Pump | Cost$ T | ValidTgts$ Card.IsCommander+ThisTurnEntered | TgtPrompt$ Select target commander that entered this turn | SubAbility$ DBPutCounter | StackDescription$ SpellDescription | SpellDescription$ Choose target commander that entered this turn. Put a +1/+1 counter on it if it's a creature and a loyalty counter on it if it's a planeswalker.
A:AB$ Pump | Cost$ T | ValidTgts$ Card.IsCommander+ThisTurnEntered | AILogic$ AnyPhase | AITgts$ Card.IsCommander+ThisTurnEntered+YourTeamCtrl | TgtPrompt$ Select target commander that entered this turn | SubAbility$ DBPutCounter | StackDescription$ SpellDescription | SpellDescription$ Choose target commander that entered this turn. Put a +1/+1 counter on it if it's a creature and a loyalty counter on it if it's a planeswalker.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to repeat the parts of the normal target legality in AITgts$ again

I also meant if you can't just script it without PumpEffect at all (otherwise this will be ok too)

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

Labels

AI General AI tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI uses "Forge of Heroes" on the opponent's commander

3 participants