From 374a78604ed4642112e03d36ee37bd618f95ae2f Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 5 Oct 2015 12:54:27 +0000 Subject: [PATCH] - The AI will now be aware of Chalice of the Void and Presence of the Master. --- forge-ai/src/main/java/forge/ai/AiController.java | 15 +++++++++++---- .../res/cardsfolder/c/chalice_of_the_void.txt | 1 + forge-gui/res/cardsfolder/l/lethal_vapors.txt | 2 +- .../res/cardsfolder/p/presence_of_the_master.txt | 1 + forge-gui/res/cardsfolder/p/price_of_glory.txt | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index be153fd50c8..77cf2f45343 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -162,14 +162,21 @@ public class AiController { private boolean checkCurseEffects(final SpellAbility sa) { for (final Card c : game.getCardsIn(ZoneType.Battlefield)) { - if (c.hasSVar("CurseEffect")) { - final String curse = c.getSVar("CurseEffect"); + if (c.hasSVar("AICurseEffect")) { + final String curse = c.getSVar("AICurseEffect"); + final Card host = sa.getHostCard(); if ("NonActive".equals(curse) && !player.equals(game.getPhaseHandler().getPlayerTurn())) { return true; - } else if ("DestroyCreature".equals(curse) && sa.isSpell() && sa.getHostCard().isCreature() + } else if ("DestroyCreature".equals(curse) && sa.isSpell() && host.isCreature() && !sa.getHostCard().hasKeyword("Indestructible")) { return true; - } + } else if ("CounterEnchantment".equals(curse) && sa.isSpell() && host.isEnchantment() + && !sa.getHostCard().hasKeyword("CARDNAME can't be countered.")) { + return true; + } else if ("ChaliceOfTheVoid".equals(curse) && sa.isSpell() && !host.hasKeyword("CARDNAME can't be countered.") + && host.getCMC() == c.getCounters(CounterType.CHARGE)) { + return true; + } } } return false; diff --git a/forge-gui/res/cardsfolder/c/chalice_of_the_void.txt b/forge-gui/res/cardsfolder/c/chalice_of_the_void.txt index 69eaac2551e..c97af62bf0f 100644 --- a/forge-gui/res/cardsfolder/c/chalice_of_the_void.txt +++ b/forge-gui/res/cardsfolder/c/chalice_of_the_void.txt @@ -6,6 +6,7 @@ T:Mode$ SpellCast | ValidCard$ Card.cmcEQY | ValidActivatingPlayer$ Player | Tri SVar:TrigCounter:AB$ Counter | Cost$ 0 | Defined$ TriggeredSpellAbility SVar:X:Count$xPaid SVar:Y:Count$CardCounters.CHARGE +SVar:AICurseEffect:ChaliceOfTheVoid SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/chalice_of_the_void.jpg Oracle:Chalice of the Void enters the battlefield with X charge counters on it.\nWhenever a player casts a spell with converted mana cost equal to the number of charge counters on Chalice of the Void, counter that spell. diff --git a/forge-gui/res/cardsfolder/l/lethal_vapors.txt b/forge-gui/res/cardsfolder/l/lethal_vapors.txt index 627163b3cef..15429274152 100644 --- a/forge-gui/res/cardsfolder/l/lethal_vapors.txt +++ b/forge-gui/res/cardsfolder/l/lethal_vapors.txt @@ -5,7 +5,7 @@ T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Creature | Execute$ SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredCard A:AB$ Destroy | Cost$ 0 | Defined$ Self | SubAbility$ DBSkipTurn | AnyPlayer$ True | AILogic$ WillSkipTurn | SpellDescription$ Destroy CARDNAME. You skip your next turn. Any player may activate this ability. SVar:DBSkipTurn:DB$ SkipTurn | Defined$ You | NumTurns$ 1 | AILogic$ Always -SVar:CurseEffect:DestroyCreature +SVar:AICurseEffect:DestroyCreature SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/lethal_vapors.jpg diff --git a/forge-gui/res/cardsfolder/p/presence_of_the_master.txt b/forge-gui/res/cardsfolder/p/presence_of_the_master.txt index 573b1b3318b..69679764778 100644 --- a/forge-gui/res/cardsfolder/p/presence_of_the_master.txt +++ b/forge-gui/res/cardsfolder/p/presence_of_the_master.txt @@ -3,6 +3,7 @@ ManaCost:3 W Types:Enchantment T:Mode$ SpellCast | ValidCard$ Enchantment | TriggerZones$ Battlefield | Execute$ TrigCounter | TriggerDescription$ Whenever a player casts an enchantment spell, counter it. SVar:TrigCounter:AB$Counter | Cost$ 0 | Defined$ TriggeredSpellAbility +SVar:AICurseEffect:CounterEnchantment SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/presence_of_the_master.jpg Oracle:Whenever a player casts an enchantment spell, counter it. diff --git a/forge-gui/res/cardsfolder/p/price_of_glory.txt b/forge-gui/res/cardsfolder/p/price_of_glory.txt index de0446db80a..6dcaa9a72bd 100644 --- a/forge-gui/res/cardsfolder/p/price_of_glory.txt +++ b/forge-gui/res/cardsfolder/p/price_of_glory.txt @@ -3,7 +3,7 @@ ManaCost:2 R Types:Enchantment T:Mode$ TapsForMana | ValidCard$ Land | Execute$ TrigDestroy | TriggerZones$ Battlefield | Activator$ Player.NonActive | TriggerDescription$ Whenever a player taps a land for mana, if it's not that player's turn, destroy that land. SVar:TrigDestroy:DB$ Destroy | Defined$ TriggeredCard -SVar:CurseEffect:NonActive +SVar:AICurseEffect:NonActive SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/price_of_glory.jpg Oracle:Whenever a player taps a land for mana, if it's not that player's turn, destroy that land.