From aef71ca6561f3c707a1c531c7fc4b9d090431d50 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:53:54 +0000 Subject: [PATCH] - Fixed Uril, the Miststalker. - Added slapshot5's code for Diamond Valley, Gaea's Avenger, Jondar's Saddlebags, People of the Woods. --- res/card-pictures.txt | 4 ++ res/cards.txt | 22 +++++++++++ src/forge/CardFactory.java | 29 +++++++++++++++ src/forge/CardFactory_Lands.java | 62 +++++++++++++++++++++++++++++++ src/forge/GameActionUtil.java | 63 ++++++++++++++++++++++++++++++-- src/forge/StaticEffects.java | 2 + 6 files changed, 179 insertions(+), 3 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 77b36fd2180..01097fe09b1 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,10 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg +jandors_saddlebags.jpg http://www.wizards.com/global/images/magic/general/jandors_saddlebags.jpg +people_of_the_woods.jpg http://www.wizards.com/global/images/magic/general/people_of_the_woods.jpg +diamond_valley.jpg http://www.wizards.com/global/images/magic/general/diamond_valley.jpg +gaeas_avenger.jpg http://www.wizards.com/global/images/magic/general/gaeas_avenger.jpg exotic_orchard.jpg http://www.wizards.com/global/images/magic/general/exotic_orchard.jpg reflecting_pool.jpg http://www.wizards.com/global/images/magic/general/reflecting_pool.jpg fallowsage.jpg http://www.wizards.com/global/images/magic/general/fallowsage.jpg diff --git a/res/cards.txt b/res/cards.txt index 23108b99949..fca09c1d69c 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,25 @@ +Diamond Valley +no cost +Land +tap: Sacrifice a creature: You gain life equal to the sacrificed creature's toughness. + +People of the Woods +G G +Creature Human +People of the Woods's toughness is equal to the number of Forests you control. +1/0 + +Jandor's Saddlebags +2 +Artifact +no text + +Gaea's Avenger +1 G G +Creature Treefolk +Gaea's Avenger's power and toughness are each equal to 1 plus the number of artifacts your opponents control. +1/1 + Exotic Orchard no cost Land diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index efd9dc9d957..8fe046d963b 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17400,6 +17400,35 @@ public class CardFactory implements NewConstants { return card; }//*************** END ************ END ************************** + + //*****************************START******************************* + if(cardName.equals("Jandor's Saddlebags")) { + /* Assuing the Rules state that this can target an untapped card, + * but it won't do anything useful + * + * This would bring the ruling in line with Icy Manipulator + * */ + + final Ability_Tap ability = new Ability_Tap(card, "3") { + private static final long serialVersionUID = 6349074098650621348L; + public boolean canPlayAI() { + return false; + } + public void chooseTargetAI() { + //setTargetCard(c); + }//chooseTargetAI() + public void resolve() { + if(AllZone.GameAction.isCardInPlay(getTargetCard())) { + getTargetCard().untap(); + } + } + };//SpellAbility + + card.addSpellAbility(ability); + ability.setDescription("3, tap: Untap target creature."); + ability.setBeforePayMana(CardFactoryUtil.input_targetType(ability, "Creature")); + }//Jandor's Saddlebags + //****************END*******END*********************** // Cards with Cycling abilities diff --git a/src/forge/CardFactory_Lands.java b/src/forge/CardFactory_Lands.java index 855d98acbb6..2bd677b0122 100644 --- a/src/forge/CardFactory_Lands.java +++ b/src/forge/CardFactory_Lands.java @@ -2787,6 +2787,68 @@ class CardFactory_Lands { a1.setDescription("2 R G: Until end of turn, Raging Ravine becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" It's still a land."); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Diamond Valley")) { + final Ability_Tap ability = new Ability_Tap(card, "0") { + + private static final long serialVersionUID = -6589125674356046586L; + + @Override + public boolean canPlayAI() { + CardList list = new CardList(AllZone.Computer_Play.getCards()); + list = list.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature(); + } + }); + + if(list.size() > 0 && AllZone.Computer_Life.getLife() < 5 ) setTargetCard(CardFactoryUtil.AI_getBestCreature(list, card)); + + return list.size() > 0; + } + + @Override + public void resolve() { + Card c = getTargetCard(); + + if(c != null) { + if(CardFactoryUtil.canTarget(card, c) && c.isCreature() ) { + AllZone.GameAction.addLife(c.getController(),c.getNetDefense()); + AllZone.GameAction.sacrifice(c); + } + } + } + }; + + Input runtime = new Input() { + + private static final long serialVersionUID = -7649177692384343204L; + + @Override + public void showMessage() { + CardList choice = new CardList(); + final String player = AllZone.Phase.getActivePlayer(); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); + choice.addAll(play.getCards()); + + choice = choice.getType("Creature"); + choice = choice.filter(new CardListFilter() { + public boolean addCard(Card c) { + return (c.isCreature()); + } + }); + + stopSetNext(CardFactoryUtil.input_targetSpecific(ability, choice, + "Select target creature:", true, false)); + } + }; + + card.addSpellAbility(ability); + ability.setBeforePayMana(runtime); + + }//*************** END ************ END ************************** + + if(hasKeyword(card, "Cycling") != -1) { int n = hasKeyword(card, "Cycling"); diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index cdf65981140..ac117862f0d 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -10088,6 +10088,61 @@ public class GameActionUtil { else return false; } }; + + + public static Command Gaeas_Avenger = new Command() { + private static final long serialVersionUID = 1987511098173387864L; + + 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("Gaea's Avenger"); + + for(int i = 0; i < list.size(); i++) { + Card c = list.get(i); + c.setBaseAttack(countOppArtifacts(c)+1); + c.setBaseDefense(c.getBaseAttack()); + } + + }// execute() + + private int countOppArtifacts(Card c) { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, AllZone.GameAction.getOpponent(c.getController())); + CardList artifacts = new CardList(play.getCards()); + artifacts = artifacts.getType("Artifact"); + return artifacts.size(); + } + }; + + public static Command People_of_the_Woods = new Command() { + private static final long serialVersionUID = 1987554325573387864L; + + 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("People of the Woods"); + + for(int i = 0; i < list.size(); i++) { + Card c = list.get(i); + c.setBaseAttack(1); + c.setBaseDefense(countForests(c)); + } + + }// execute() + + private int countForests(Card c) { + PlayerZone play = AllZone.getZone( + Constant.Zone.Play, c.getController()); + CardList forests = new CardList(play.getCards()); + forests = forests.getType("Forest"); + return forests.size(); + } + }; + public static Command Kird_Ape = new Command() { private static final long serialVersionUID = 3448725650293971110L; @@ -12637,8 +12692,8 @@ public class GameActionUtil { if(list.size() > 0) { Card c = list.get(0); - c.setBaseAttack(countAuras(c) * 2); - c.setBaseDefense(c.getBaseAttack() + 1); + c.setBaseAttack(5 + (countAuras(c) * 2)); + c.setBaseDefense(c.getBaseAttack()); } }// execute() @@ -14974,8 +15029,10 @@ public class GameActionUtil { commands.put("Guul_Draz_Specter", Guul_Draz_Specter); commands.put("Dakkon", Dakkon); commands.put("Korlash", Korlash); - + commands.put("Dauntless_Dourbark", Dauntless_Dourbark); + commands.put("People_of_the_Woods", People_of_the_Woods); + commands.put("Gaeas_Avenger", Gaeas_Avenger); commands.put("Vexing_Beetle", Vexing_Beetle); commands.put("Sejiri_Merfolk", Sejiri_Merfolk); commands.put("Kird_Ape", Kird_Ape); diff --git a/src/forge/StaticEffects.java b/src/forge/StaticEffects.java index 2ec61238f28..b85709948fb 100644 --- a/src/forge/StaticEffects.java +++ b/src/forge/StaticEffects.java @@ -55,6 +55,8 @@ public class StaticEffects cardToEffectsList.put("Dakkon Blackblade", new String[] {"Dakkon"}); cardToEffectsList.put("Korlash, Heir to Blackblade", new String[] {"Korlash"}); cardToEffectsList.put("Dauntless Dourbark", new String[] {"Dauntless_Dourbark"}); + cardToEffectsList.put("Gaea's Avenger", new String[] {"Gaeas_Avenger"}); + cardToEffectsList.put("People of the Woods", new String[] {"People_of_the_Woods"}); cardToEffectsList.put("Vexing Beetle", new String[] {"Vexing_Beetle"}); cardToEffectsList.put("Sejiri Merfolk", new String[] {"Sejiri_Merfolk"}); cardToEffectsList.put("Loam Lion", new String[] {"Loam_Lion"});