From eacdb4a66fb46b487c84815ed1b33478ec96a5d1 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:57:36 +0000 Subject: [PATCH] - Added Slapshot5's code for Natural Selection, Giant Tortoise. --- res/card-pictures.txt | 1 + res/cards.txt | 11 ++++++++ src/forge/CardFactory.java | 51 +++++++++++++++++++++++++++++++++++ src/forge/GameActionUtil.java | 37 +++++++++++++++++++++++++ 4 files changed, 100 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 1c20a1b31d8..ca715af1adf 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,7 @@ 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 +natural_selection.jpg http://www.wizards.com/global/images/magic/general/natural_selection.jpg epic_struggle.jpg http://www.wizards.com/global/images/magic/general/epic_struggle.jpg reinforcements.jpg http://www.wizards.com/global/images/magic/general/reinforcements.jpg rampant_growth.jpg http://www.wizards.com/global/images/magic/general/rampant_growth.jpg diff --git a/res/cards.txt b/res/cards.txt index f2511f96ccb..c6a62884846 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,14 @@ +Natural Selection +G +Instant +Look at the top 3 cards of target player's library and put them back in any order. You may have that player shuffle his or her library. + +Giant Tortoise +1 U +Creature Turtle +As long as Giant Tortoise is untapped, it gets +0/+3. +1/1 + Landbind Ritual 3 W W Sorcery diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index b9315fc81d0..cced31dcd27 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17723,6 +17723,57 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + + else if(cardName.equals("Natural Selection")) { + /* Look at the top 3 cards of target player's library and put them + * back in any order. You may have that player shuffle his or + * her library */ + + final SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = 8649520296192617609L; + + @Override + public void resolve() { + String player = getTargetPlayer(); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + if(lib.size() < 3) return; + CardList topThree = new CardList(); + //show top 3 cards: + topThree.add(lib.get(0)); + topThree.add(lib.get(1)); + topThree.add(lib.get(2)); + for(int i = 1; i <= 3; i++) { + String Title = "Put on top: "; + if(i == 2) Title = "Put second from top: "; + if(i == 3) Title = "Put third from top: "; + Object o = AllZone.Display.getChoiceOptional(Title, topThree.toArray()); + if(o == null) break; + Card c_1 = (Card) o; + topThree.remove(c_1); + lib.remove(c_1); + lib.add(c_1, i - 1); + } + String[] choices = new String[] {"Yes", "No"}; + Object o = AllZone.Display.getChoice("Shuffle target player's library?", choices); + String myChoice = (String) o; + if(myChoice.equals("Yes")) { + AllZone.GameAction.shuffle(getTargetPlayer()); + } + } + @Override + public boolean canPlayAI() { + //basically the same reason as Sensei's Diving Top + return false; + } + };//spell + card.clearSpellAbility(); + card.addSpellAbility(spell); + spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); + } + //*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index f33e24a0204..f11a90d656a 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -13626,6 +13626,42 @@ public class GameActionUtil { return list; }// getRaptor() }; // Castle Raptors + + public static Command Giant_Tortoise = new Command() { + private static final long serialVersionUID = -8191148876633239167L; + + CardList old = new CardList(); + int pump = 3; + + public void execute() { + Card c; + // reset all previous cards stats + for(int i = 0; i < old.size(); i++) { + c = old.get(i); + c.addSemiPermanentDefenseBoost(-pump); + } + old.clear(); + + CardList list = getCard("Giant Tortoise"); + for(int i = 0; i < list.size(); i++) { + c = list.get(i); + // only add boost if card is untapped + if(c.isUntapped()) { + c.addSemiPermanentDefenseBoost(pump); + old.add(c); + } + }// for + }// execute() + + CardList getCard(String name) { + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.getName(name); + return list; + }// getCard() + }; // Giant_Tortoise + public static Command Radiant_Archangel = new Command() { private static final long serialVersionUID = -7086544305058527889L; @@ -15082,6 +15118,7 @@ public class GameActionUtil { commands.put("Radiant_Archangel", Radiant_Archangel); commands.put("Castle", Castle); commands.put("Castle_Raptors", Castle_Raptors); + commands.put("Giant_Tortoise", Giant_Tortoise); commands.put("Darksteel_Forge", Darksteel_Forge); commands.put("Levitation", Levitation);