From ab15ae66a3fd832d561914212b7715094d97ccb7 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:29:10 +0000 Subject: [PATCH] - Added Lord of the Undead, tweaked one of the quest decks. --- res/cards.txt | 6 ++ res/quest/decks/quest8.dck | 7 ++- src/forge/CardFactory_Creatures.java | 60 ++++++++++++++++++ src/forge/GameActionUtil.java | 91 ++++++++++++++++++++++++++-- src/forge/StaticEffects.java | 1 + 5 files changed, 158 insertions(+), 7 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 42913f8f440..59fd1afe77f 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,9 @@ +Lord of the Undead +1 B B +Creature Zombie +Other Zombie creatures get +1/+1. +2/2 + Sound the Call 2 G Sorcery diff --git a/res/quest/decks/quest8.dck b/res/quest/decks/quest8.dck index 9688ccc80ab..b0f07d3d4d7 100644 --- a/res/quest/decks/quest8.dck +++ b/res/quest/decks/quest8.dck @@ -2,9 +2,10 @@ quest8 [general] constructed [main] -1 Windswept Heath +1 Temple Garden 1 Mox Emerald -2 Arctic Wolves +1 Arctic Wolves +4 Sound the Call 2 Wolfbriar Elemental 1 Plains 4 Wyluli Wolf @@ -15,7 +16,7 @@ constructed 18 Forest 4 Kodama's Reach 2 Muraganda Petroglyphs -4 Bestial Menace +1 Bestial Menace 4 Tundra Wolves 4 Savannah [sideboard] diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 6e0f3f44af7..9f3cd285e16 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -18397,6 +18397,66 @@ public class CardFactory_Creatures { ability.setBeforePayMana(CardFactoryUtil.input_targetPermanent(ability)); }//*************** END ************ END ************************** + + //*************** START *********** START ************************ + if(cardName.equals("Lord of the Undead")) { + final Ability_Tap ability = new Ability_Tap(card, "1 B") { + + /** + * + */ + private static final long serialVersionUID = -4287216165943846367L; + + @Override + public boolean canPlayAI() { + return getGraveCreatures().size() != 0; + } + + @Override + public void chooseTargetAI() { + CardList grave = getGraveCreatures(); + Card target = CardFactoryUtil.AI_getBestCreature(grave); + setTargetCard(target); + } + + @Override + public void resolve() { + if(card.getController().equals(Constant.Player.Human)) { + Card c = AllZone.Display.getChoice("Select card", getGraveCreatures().toArray()); + setTargetCard(c); + } + + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); + + if(AllZone.GameAction.isCardInZone(getTargetCard(), grave)) AllZone.GameAction.moveTo(hand, + getTargetCard()); + }//resolve() + + @Override + public boolean canPlay() { + return super.canPlay() && getGraveCreatures().size() != 0; + } + + CardList getGraveCreatures() { + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + CardList list = new CardList(grave.getCards()); + list = list.filter(new CardListFilter(){ + public boolean addCard(Card c) + { + return c.getType().contains("Zombie") || c.getKeyword().contains("Changeling"); + } + }); + return list; + } + };//SpellAbility + ability.setDescription("1 B, Tap: Return target Zombie card from your graveyard to your hand."); + ability.setStackDescription(cardName + " - Return target Zombie card from your graveyard to your hand."); + + card.addSpellAbility(ability); + + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(shouldCycle(card) != -1) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 9330345de0f..31f9af1d269 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -12647,6 +12647,87 @@ public class GameActionUtil { }; //Wizened Cenn Other + public static Command Lord_of_the_Undead_Pump = new Command() { + + private static final long serialVersionUID = 4866202925944860238L; + CardList gloriousAnthemList = new CardList(); + + public void execute() { + + CardList cList = gloriousAnthemList; + Card c; + + for(int i = 0; i < cList.size(); i++) { + c = cList.get(i); + c.addSemiPermanentAttackBoost(-1); + c.addSemiPermanentDefenseBoost(-1); + } + cList.clear(); + PlayerZone[] zone = getZone("Lord of the Undead"); + + // for each zone found add +1/+1 to each card + for(int outer = 0; outer < zone.length; outer++) { + CardList creature = new CardList( + zone[outer].getCards()); + creature = creature.getType("Zombie"); + + for(int i = 0; i < creature.size(); i++) { + c = creature.get(i); + if(c.isCreature() + && !c.getName().equals( + "Lord of the Undead")) { + c.addSemiPermanentAttackBoost(1); + c.addSemiPermanentDefenseBoost(1); + + gloriousAnthemList.add(c); + } + + } // for + } // for + + }// execute() + + }; //Lord_of_the_Undead_ + + public static Command Lord_of_the_Undead_Other = new Command() { + + private static final long serialVersionUID = -6925991029956531314L; + int otherLords = 0; + + private int countOtherLords(Card c) { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); + CardList capts = new CardList(play.getCards()); + capts = capts.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.getName().equals( + "Lord of the Undead") + && (c.getType().contains("Zombie") || c.getKeyword().contains( + "Changeling")); + } + }); + return capts.size() - 1; + + } + + public void execute() { + + CardList creature = new CardList(); + creature.addAll(AllZone.Human_Play.getCards()); + creature.addAll(AllZone.Computer_Play.getCards()); + + creature = creature.getName("Lord of the Undead"); + + for(int i = 0; i < creature.size(); i++) { + Card c = creature.get(i); + otherLords = countOtherLords(c); + c.setOtherAttackBoost(otherLords); + c.setOtherDefenseBoost(otherLords); + + }// for inner + }// execute() + + }; //Lord_of_the_Undead_Other + public static Command Cemetery_Reaper_Pump = new Command() { private static final long serialVersionUID = 3534935133707913819L; @@ -12695,8 +12776,8 @@ public class GameActionUtil { private int countOtherReapers(Card c) { PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); - CardList capts = new CardList(play.getCards()); - capts = capts.filter(new CardListFilter() { + CardList reapers = new CardList(play.getCards()); + reapers = reapers.filter(new CardListFilter() { public boolean addCard(Card c) { return c.getName().equals( "Cemetery Reaper") @@ -12704,7 +12785,7 @@ public class GameActionUtil { "Changeling")); } }); - return capts.size() - 1; + return reapers.size() - 1; } @@ -12725,7 +12806,7 @@ public class GameActionUtil { }// for inner }// execute() - }; //Cemetery_Reaper_Oher + }; //Cemetery_Reaper_Other public static Command Captain_of_the_Watch_Pump = new Command() { private static final long serialVersionUID = 542524781150091105L; @@ -16765,6 +16846,8 @@ public class GameActionUtil { commands.put("Elvish_Champion_Other", Elvish_Champion_Other); commands.put("Wizened_Cenn_Pump", Wizened_Cenn_Pump); commands.put("Wizened_Cenn_Other", Wizened_Cenn_Other); + commands.put("Lord_of_the_Undead_Pump", Lord_of_the_Undead_Pump); + commands.put("Lord_of_the_Undead_Other", Lord_of_the_Undead_Other); commands.put("Cemetery_Reaper_Pump", Cemetery_Reaper_Pump); commands.put("Cemetery_Reaper_Other", Cemetery_Reaper_Other); commands.put("Captain_of_the_Watch_Pump", Captain_of_the_Watch_Pump); diff --git a/src/forge/StaticEffects.java b/src/forge/StaticEffects.java index 6ab4a79767c..709ddc4d1dc 100644 --- a/src/forge/StaticEffects.java +++ b/src/forge/StaticEffects.java @@ -111,6 +111,7 @@ public class StaticEffects cardToEffectsList.put("Privileged Position", new String[] {"Privileged_Position", "Privileged_Position_Other"}); cardToEffectsList.put("Elvish Archdruid", new String[] {"Elvish_Archdruid_Pump", "Elvish_Archdruid_Other"}); cardToEffectsList.put("Wizened Cenn", new String[] {"Wizened_Cenn_Pump", "Wizened_Cenn_Other"}); + cardToEffectsList.put("Lord of the Undead", new String[] {"Lord_of_the_Undead_Pump", "Lord_of_the_Undead_Other"}); cardToEffectsList.put("Cemetery Reaper", new String[] {"Cemetery_Reaper_Pump", "Cemetery_Reaper_Other"}); cardToEffectsList.put("Captain of the Watch", new String[] {"Captain_of_the_Watch_Pump", "Captain_of_the_Watch_Other"}); cardToEffectsList.put("Veteran Armorsmith", new String[] {"Veteran_Armorsmith_Pump", "Veteran_Armorsmith_Other"});