diff --git a/res/cardsfolder/m/momir_vig_simic_visionary_avatar.txt b/res/cardsfolder/m/momir_vig_simic_visionary_avatar.txt index f049a781f9c..4b6157ce1a0 100644 --- a/res/cardsfolder/m/momir_vig_simic_visionary_avatar.txt +++ b/res/cardsfolder/m/momir_vig_simic_visionary_avatar.txt @@ -2,7 +2,7 @@ Name:Momir Vig, Simic Visionary Avatar ManaCost:no cost Types:Vanguard HandLifeModifier:+0/+4 -A:AB$ NameCard | Cost$ X Discard<1/Card> | ActivationZone$ Command | AtRandom$ True | ValidCards$ Creature | ValidAttribute$ cmcEQX | References$ X | Amount$ 1 | SubAbility$ DBToken | SorcerySpeed$ True | ActivationLimit$ 1 | AILogic$ MomirAvatar | SpellDescription$ Put a token onto the battlefield that's a copy of a creature card with converted mana cost X chosen at random. Activate this ability only any time you could cast a sorcery and only once each turn. | StackDescription$ SpellDescription +A:AB$ NameCard | Cost$ X Discard<1/Card> | AILogic$ MomirAvatar | ActivationZone$ Command | AtRandom$ True | ValidCards$ Creature | ValidAttribute$ cmcEQX | References$ X | Amount$ 1 | SubAbility$ DBToken | SorcerySpeed$ True | ActivationLimit$ 1 | AILogic$ MomirAvatar | SpellDescription$ Put a token onto the battlefield that's a copy of a creature card with converted mana cost X chosen at random. Activate this ability only any time you could cast a sorcery and only once each turn. | StackDescription$ SpellDescription SVar:DBToken:DB$ CopyPermanent | ValidSupportedCopy$ Card | DefinedName$ NamedCard | NumCopies$ 1 | StackDescription$ SVar:X:Count$xPaid SVar:Picture:http://www.cardforge.org/fpics/vgd-lq/momir_vig_simic_visionary_avatar.jpg diff --git a/src/main/java/forge/card/ability/ai/ChooseCardNameAi.java b/src/main/java/forge/card/ability/ai/ChooseCardNameAi.java index 65cfb2363e2..f2dc3d68dd6 100644 --- a/src/main/java/forge/card/ability/ai/ChooseCardNameAi.java +++ b/src/main/java/forge/card/ability/ai/ChooseCardNameAi.java @@ -1,22 +1,48 @@ package forge.card.ability.ai; +import forge.Card; import forge.card.ability.SpellAbilityAi; import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; import forge.game.ai.ComputerUtil; +import forge.game.ai.ComputerUtilMana; import forge.game.player.AIPlayer; public class ChooseCardNameAi extends SpellAbilityAi { @Override protected boolean canPlayAI(AIPlayer ai, SpellAbility sa) { - + Card source = sa.getSourceCard(); if (sa.hasParam("AILogic")) { // Don't tap creatures that may be able to block if (ComputerUtil.waitForBlocking(sa)) { return false; } + String logic = sa.getParam("AILogic"); + if (logic.equals("MomirAvatar")) { + // Set PayX here to maximum value. + int tokenSize = ComputerUtilMana.determineLeftoverMana(sa, ai); + + // Some basic strategy for Momir + if (tokenSize >= 11) { + tokenSize = 11; + } else if (tokenSize >= 9) { + tokenSize = 9; + } else if (tokenSize >= 8) { + tokenSize = 8; + } else if (tokenSize >= 6) { + tokenSize = 6; + } else if (tokenSize >= 4) { + tokenSize = 4; + } else if (tokenSize >= 2) { + tokenSize = 2; + } else { + return false; + } + source.setSVar("PayX", Integer.toString(tokenSize)); + } + final Target tgt = sa.getTarget(); if (tgt != null) { tgt.resetTargets();