From 14f2032f1cebccbc8c97444aee466807340ae4ed Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:59:33 +0000 Subject: [PATCH] Antler Skulkin, Ballynock Trapper, Mudbrawler Cohort, Crabapple Cohort, Briarberry Cohort, Ballynock Cohort, Ashenmoor Cohort were added. ControlsAnotherColoredCreature(Card c,String color) to cardfactoryutil was added. --- res/card-pictures.txt | 7 + res/cards.txt | 46 +++++ src/forge/CardFactoryUtil.java | 20 +++ src/forge/CardFactory_Creatures.java | 2 +- src/forge/GameActionUtil.java | 245 +++++++++++++++++++++++++++ src/forge/StateBasedEffects.java | 5 + 6 files changed, 324 insertions(+), 1 deletion(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 152fee29b33..91a16a702d6 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -18,6 +18,13 @@ forest.jpg http://resources.wizards.com/magic/cards/unh/en-us/card73946.jpg forest1.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=2748 forest2.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=587 forest3.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=586 +antler_skulkin.jpg http://www.wizards.com/global/images/magic/general/antler_skulkin.jpg +ballynock_trapper.jpg http://www.wizards.com/global/images/magic/general/ballynock_trapper.jpg +mudbrawler_cohort.jpg http://www.wizards.com/global/images/magic/general/mudbrawler_cohort.jpg +crabapple_cohort.jpg http://www.wizards.com/global/images/magic/general/crabapple_cohort.jpg +briarberry_cohort.jpg http://www.wizards.com/global/images/magic/general/briarberry_cohort.jpg +ashenmoor_cohort.jpg http://www.wizards.com/global/images/magic/general/ashenmoor_cohort.jpg +ballynock_cohort.jpg http://www.wizards.com/global/images/magic/general/ballynock_cohort.jpg gelectrode.jpg http://www.wizards.com/global/images/magic/general/gelectrode.jpg rathi_trapper.jpg http://www.wizards.com/global/images/magic/general/rathi_trapper.jpg hollow_dogs.jpg http://www.wizards.com/global/images/magic/general/hollow_dogs.jpg diff --git a/res/cards.txt b/res/cards.txt index 98866879501..f2288f33be9 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,49 @@ +Ashenmoor Cohort +5 B +Creature Elemental Warrior +Ashenmoor Cohort gets +1/+1 as long as you control another black creature. +4/3 + +Ballynock Cohort +2 W +Creature Kithkin Soldier +Ballynock Cohort gets +1/+1 as long as you control another white creature. +2/2 +First Strike + +Briarberry Cohort +1 U +Creature Faerie Soldier +Briarberry Cohort gets +1/+1 as long as you control another blue creature. +1/1 +Flying + +Crabapple Cohort +4 G +Creature Treefolk Warrior +Crabapple Cohort gets +1/+1 as long as you control another green creature. +4/4 + +Mudbrawler Cohort +1 R +Creature Goblin Warrior +Mudbrawler Cohort gets +1/+1 as long as you control another red creature. +1/1 +Haste + +Ballynock Trapper +3 W +Creature Kithkin Soldier +Whenever you cast a white spell, you may untap Ballynock Trapper. +2/2 + +Antler Skulkin +5 +Artifact Creature Scarecrow +no text +3/3 +TgtKPump 2:Persist + Gelectrode 1 U R Creature Weird diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 26de654a61d..b51dcb3ce45 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1831,6 +1831,26 @@ public class CardFactoryUtil } + public static boolean controlsAnotherColoredCreature(Card c,String color) + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); + + final Card crd = c; + final String col = color; + CardList list = new CardList(play.getCards()); + list = list.filter(new CardListFilter() + { + + public boolean addCard(Card c) { + return !c.equals(crd) && c.isCreature() && CardUtil.getColors(c).contains(col); + } + + }); + + return list.size() >= 1; + + } + public static int getNumberOfManaSymbolsControlledByColor(String colorAbb, String player) { PlayerZone play = AllZone.getZone(Constant.Zone.Play,player); diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index dd78fb23b41..272c35d2b4e 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -10027,7 +10027,7 @@ public class CardFactory_Creatures { }//*************** END ************ END ************************** //*************** START *********** START ************************** - if (cardName.equals("Minister of Impediments")) + if (cardName.equals("Minister of Impediments") || cardName.equals("Ballynock Trapper")) { final SpellAbility ability = new Ability_Tap(card, "0") { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 63b84a61d62..f6376c90834 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -108,6 +108,7 @@ public class GameActionUtil playCard_Witch_Maw_Nephilim(c); playCard_Forced_Fruition(c); playCard_Gelectrode(c); + playCard_Ballynock_Trapper(c); playCard_Standstill(c); playCard_Memory_Erosion(c); playCard_SolKanar(c); @@ -1283,6 +1284,50 @@ public class GameActionUtil } }// Gelectrode + public static void playCard_Ballynock_Trapper(Card c) + { + final String controller = c.getController(); + + final PlayerZone play = AllZone.getZone(Constant.Zone.Play, + controller); + + CardList list = new CardList(); + list.addAll(play.getCards()); + + list = list.getName("Ballynock Trapper"); + + if (list.size() > 0 && CardUtil.getColors(c).contains(Constant.Color.White)){ + + for (int i=0;i 0) + { + //Card crd = list.get(0); //unused + + for (int i = 0; i < list.size(); i++) + { + + Card c = list.get(i); + if (CardFactoryUtil.controlsAnotherColoredCreature(c, "white")){ + c.setBaseAttack(3); + c.setBaseDefense(3); + + } + else + { + c.setBaseAttack(2); + c.setBaseDefense(2); + + } + + } + } + }// execute() + + };//Ballynock Cohort + + public static Command Ashenmoor_Cohort = new Command() + { + + private static final long serialVersionUID = 5895665460018262987L; + + public void execute() + { + // get all creatures + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.getName("Ashenmoor Cohort"); + + if (list.size() > 0) + { + //Card crd = list.get(0); //unused + + for (int i = 0; i < list.size(); i++) + { + + Card c = list.get(i); + if (CardFactoryUtil.controlsAnotherColoredCreature(c, "black")){ + c.setBaseAttack(5); + c.setBaseDefense(4); + + } + else + { + c.setBaseAttack(4); + c.setBaseDefense(3); + + } + + } + } + }// execute() + + };//Ashenmoor Cohort + + public static Command Briarberry_Cohort = new Command() + { + + private static final long serialVersionUID = 5895665460018262987L; + + public void execute() + { + // get all creatures + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.getName("Briarberry Cohort"); + + if (list.size() > 0) + { + //Card crd = list.get(0); //unused + + for (int i = 0; i < list.size(); i++) + { + + Card c = list.get(i); + if (CardFactoryUtil.controlsAnotherColoredCreature(c, "blue")){ + c.setBaseAttack(2); + c.setBaseDefense(2); + + } + else + { + c.setBaseAttack(1); + c.setBaseDefense(1); + + } + + } + } + }// execute() + + };//Briarberry Cohort + + public static Command Crabapple_Cohort = new Command() + { + + private static final long serialVersionUID = 5895665460018262987L; + + public void execute() + { + // get all creatures + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.getName("Crabapple Cohort"); + + if (list.size() > 0) + { + //Card crd = list.get(0); //unused + + for (int i = 0; i < list.size(); i++) + { + + Card c = list.get(i); + if (CardFactoryUtil.controlsAnotherColoredCreature(c, "green")){ + c.setBaseAttack(5); + c.setBaseDefense(5); + + } + else + { + c.setBaseAttack(4); + c.setBaseDefense(4); + + } + + } + } + }// execute() + + };//Crabapple Cohort + + public static Command Mudbrawler_Cohort = new Command() + { + + private static final long serialVersionUID = 5895665460018262987L; + + public void execute() + { + // get all creatures + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.getName("Mudbrawler Cohort"); + + if (list.size() > 0) + { + //Card crd = list.get(0); //unused + + for (int i = 0; i < list.size(); i++) + { + + Card c = list.get(i); + if (CardFactoryUtil.controlsAnotherColoredCreature(c, "red")){ + c.setBaseAttack(2); + c.setBaseDefense(2); + + } + else + { + c.setBaseAttack(1); + c.setBaseDefense(1); + + } + + } + } + }// execute() + + };//Mudbrawler Cohort + public static Command Werebear = new Command() { @@ -14042,6 +14282,11 @@ public class GameActionUtil commands.put("Grixis_Grimblade", Grixis_Grimblade); commands.put("Jund_Hackblade", Jund_Hackblade); commands.put("Naya_Hushblade", Naya_Hushblade); + commands.put("Ballynock_Cohort", Ballynock_Cohort); + commands.put("Ashenmoor_Cohort", Ashenmoor_Cohort); + commands.put("Briarberry_Cohort", Briarberry_Cohort); + commands.put("Crabapple_Cohort", Crabapple_Cohort); + commands.put("Mudbrawler_Cohort", Mudbrawler_Cohort); commands.put("Nimble_Mongoose", Nimble_Mongoose); commands.put("Werebear", Werebear); commands.put("Divinity_of_Pride", Divinity_of_Pride); diff --git a/src/forge/StateBasedEffects.java b/src/forge/StateBasedEffects.java index 5060dfe0940..a977865500f 100644 --- a/src/forge/StateBasedEffects.java +++ b/src/forge/StateBasedEffects.java @@ -60,6 +60,11 @@ public class StateBasedEffects cardToEffectsList.put("Grixis Grimblade", new String[] {"Grixis_Grimblade"}); cardToEffectsList.put("Jund Hackblade", new String[] {"Jund_Hackblade"}); cardToEffectsList.put("Naya Hushblade", new String[] {"Naya_Hushblade"}); + cardToEffectsList.put("Ashenmoor Cohort", new String[] {"Ashenmoor_Cohort"}); + cardToEffectsList.put("Ballynock Cohort", new String[] {"Ballynock_Cohort"}); + cardToEffectsList.put("Briarberry Cohort", new String[] {"Briarberry_Cohort"}); + cardToEffectsList.put("Crabapple Cohort", new String[] {"Crabapple_Cohort"}); + cardToEffectsList.put("Mudbrawler Cohort", new String[] {"Mudbrawler_Cohort"}); cardToEffectsList.put("Mystic Enforcer", new String[] {"Mystic_Enforcer"}); cardToEffectsList.put("Nimble Mongoose", new String[] {"Nimble_Mongoose"}); cardToEffectsList.put("Werebear", new String[] {"Werebear"});