From 5b8d2cb36adc3b4e5ce8fe2c43f418d4be0e8cdc Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 20 Sep 2017 17:43:52 +0000 Subject: [PATCH] - AI: For Vraska, the Relic Seeker, play a little more conservatively to avoid losing the planeswalker by activating its -3 ability two times in a row --- .../main/java/forge/ai/ability/DestroyAi.java | 23 ++++++------------- .../res/cardsfolder/v/vraska_relic_seeker.txt | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java index f73f64be516..f0d6939227d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java @@ -1,24 +1,10 @@ package forge.ai.ability; import com.google.common.base.Predicate; -import forge.ai.AiController; -import forge.ai.AiProps; - -import forge.ai.ComputerUtil; -import forge.ai.ComputerUtilCard; -import forge.ai.ComputerUtilCost; -import forge.ai.ComputerUtilMana; -import forge.ai.PlayerControllerAi; -import forge.ai.SpecialCardAi; -import forge.ai.SpellAbilityAi; +import forge.ai.*; import forge.game.ability.AbilityUtils; import forge.game.ability.ApiType; -import forge.game.card.Card; -import forge.game.card.CardCollection; -import forge.game.card.CardFactoryUtil; -import forge.game.card.CardLists; -import forge.game.card.CardPredicates; -import forge.game.card.CounterType; +import forge.game.card.*; import forge.game.cost.Cost; import forge.game.cost.CostPart; import forge.game.cost.CostSacrifice; @@ -78,6 +64,11 @@ public class DestroyAi extends SpellAbilityAi { } if ("MadSarkhanDragon".equals(logic)) { return SpecialCardAi.SarkhanTheMad.considerMakeDragon(ai, sa); + } else if (logic != null && logic.startsWith("MinLoyalty.")) { + int minLoyalty = Integer.parseInt(logic.substring(logic.indexOf(".") + 1)); + if (source.getCounters(CounterType.LOYALTY) < minLoyalty) { + return false; + } } else if ("Polymorph".equals(logic)) { list = CardLists.getTargetableCards(ai.getCardsIn(ZoneType.Battlefield), sa); if (list.isEmpty()) { diff --git a/forge-gui/res/cardsfolder/v/vraska_relic_seeker.txt b/forge-gui/res/cardsfolder/v/vraska_relic_seeker.txt index 3ebec5e0711..1e94067affe 100644 --- a/forge-gui/res/cardsfolder/v/vraska_relic_seeker.txt +++ b/forge-gui/res/cardsfolder/v/vraska_relic_seeker.txt @@ -5,7 +5,7 @@ Loyalty:6 A:AB$ Token | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | TokenAmount$ 1 | TokenName$ Pirate | TokenTypes$ Creature,Pirate | TokenOwner$ You | TokenColors$ Black | TokenPower$ 2 | TokenToughness$ 2 | TokenKeywords$ Menace | SpellDescription$ Create a 2/2 black Pirate creature token with menace. -A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Artifact,Creature,Enchantment | TgtPrompt$ Select target artifact, creature, or enchantment | SubAbility$ DBTreasure | SpellDescription$ Destroy target artifact, creature, or enchantment. Create a colorless treasure artifact token with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool." +A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Artifact,Creature,Enchantment | TgtPrompt$ Select target artifact, creature, or enchantment | AILogic$ MinLoyalty.4 | SubAbility$ DBTreasure | SpellDescription$ Destroy target artifact, creature, or enchantment. Create a colorless treasure artifact token with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool." SVar:DBTreasure:DB$ Token | TokenAmount$ 1 | TokenName$ Treasure | TokenTypes$ Artifact,Treasure | TokenOwner$ You | TokenColors$ Colorless | TokenImage$ c treasure | TokenAbilities$ ABTreasureMana | TokenAltImages$ c_treasure2,c_treasure3,c_treasure4 SVar:ABTreasureMana:AB$ Mana | Cost$ T Sac<1/CARDNAME> | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool.