From 2114d9eaeda06aa8712936a1b92df73604789a2c Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:46:17 +0000 Subject: [PATCH] - Fixed Goblin Grenade, cannot cast it as an instant now. - Fixed Thought Courier, Blightspeaker, Cackling Imp and Stern Judge. --- res/main.properties | 2 +- src/forge/CardFactory.java | 2 +- src/forge/CardFactory_Creatures.java | 82 ++++++++++++++++++++++++++++ src/forge/CardFactory_Equipment.java | 1 - 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/res/main.properties b/res/main.properties index 556629e72e8..e7e82ef37eb 100644 --- a/res/main.properties +++ b/res/main.properties @@ -1,6 +1,6 @@ program/mail=mtgrares@yahoo.com program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 -program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 61 +program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 62 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index d5e8db7ffd8..5bfce230c15 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -16201,7 +16201,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); CardList gobs = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards()); gobs = gobs.getType("Goblin"); - return gobs.size()>0; + return super.canPlay() && gobs.size()>0; } public boolean canPlayAI() diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index c6aa9fe5dba..a1a85d7c218 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -15509,7 +15509,89 @@ public class CardFactory_Creatures { ability.setDescription("1, tap: Destroy all artifacts, creatures, and enchantments."); ability.setStackDescription("Destroy all artifacts, creatures, and enchantments."); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + if(cardName.equals("Stern Judge")) + { + final Ability_Tap ability = new Ability_Tap(card) + { + private static final long serialVersionUID = 3059547795996737707L; + public void resolve() + { + AllZone.Human_Life.subtractLife(countSwamps("Human")); + AllZone.Computer_Life.subtractLife(countSwamps("Computer")); + } + int countSwamps(String player) + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); + CardList swamps = new CardList(play.getCards()); + swamps = swamps.getType("Swamp"); + return swamps.size(); + } + public boolean canPlayAI() + { + int computer = countSwamps(Constant.Player.Computer); + int human = countSwamps(Constant.Player.Human); + if((computer >= AllZone.Computer_Life.getLife()) || (human == 0)) + return false; + + return computer <= human; + } + };//SpellAbility + card.addSpellAbility(ability); + ability.setDescription("tap: Each player loses 1 life for each Swamp he or she controls."); + ability.setStackDescription("Stern Judge - Each player loses 1 life for each Swamp he or she controls"); + ability.setBeforePayMana(new Input_NoCost_TapAbility(ability)); + }//*************** END ************ END ************************** + + + //*************** START *********** START ************************** + if(cardName.equals("Cackling Imp") || cardName.equals("Blightspeaker")) + { + final Ability_Tap ability = new Ability_Tap(card) + { + private static final long serialVersionUID = -8034678094689484203L; + public void resolve() + { + String opponent = AllZone.GameAction.getOpponent(card.getController()); + AllZone.GameAction.getPlayerLife(opponent).subtractLife(1); + } + public boolean canPlayAI() + { + //computer should play ability if this creature doesn't attack + Combat c = ComputerUtil.getAttackers(); + CardList list = new CardList(c.getAttackers()); + + //could this creature attack?, if attacks, do not use ability + return (! list.contains(card)); + } + };//SpellAbility + card.addSpellAbility(ability); + ability.setDescription("tap: Target player loses 1 life."); + ability.setStackDescription(card.getName() + " - Opponent loses 1 life."); + ability.setBeforePayMana(new Input_NoCost_TapAbility(ability)); + }//*************** END ************ END ************************** + + + //*************** START *********** START ************************** + if(cardName.equals("Thought Courier")) + { + final Ability_Tap ability = new Ability_Tap(card) + { + private static final long serialVersionUID = -7702857487992969125L; + public boolean canPlayAI() {return false;} + public void resolve() + { + AllZone.GameAction.drawCard(card.getController()); + AllZone.InputControl.setInput(CardFactoryUtil.input_discard()); + } + };//SpellAbility + card.addSpellAbility(ability); + ability.setDescription("tap: Draw a card, then discard a card."); + ability.setStackDescription("Thought Courier - draw a card, then discard a card."); + ability.setBeforePayMana(new Input_NoCost_TapAbility(ability)); + }//*************** END ************ END ************************** // Cards with Cycling abilities diff --git a/src/forge/CardFactory_Equipment.java b/src/forge/CardFactory_Equipment.java index e2db3be0a2f..659c80c52fd 100644 --- a/src/forge/CardFactory_Equipment.java +++ b/src/forge/CardFactory_Equipment.java @@ -1540,7 +1540,6 @@ class CardFactory_Equipment { return getCreature().size() != 0 && !card.isEquipping(); } - public void chooseTargetAI() { Card target = CardFactoryUtil.AI_getBestCreature(getCreature());