From 310cc0c0345f99fce4234b53a83e8a98b3c416f6 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:00:56 +0000 Subject: [PATCH] Added support for Ripple (Up to 10, but this can be easily changed). Added Thrumming Stone, Surging AEther, Surging Dementia, Surging Flame, Surging Might and Surging Sentinels --- res/card-pictures.txt | 6 +++ res/cards.txt | 41 +++++++++++++++ src/forge/CardFactory.java | 2 +- src/forge/GameActionUtil.java | 97 +++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+), 1 deletion(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 8d9598c18fe..edeb524e00b 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,12 @@ 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 +thrumming_stone.jpg http://www.wizards.com/global/images/magic/general/thrumming_stone.jpg +surging_aether.jpg http://www.wizards.com/global/images/magic/general/surging_aether.jpg +surging_dementia.jpg http://www.wizards.com/global/images/magic/general/surging_dementia.jpg +surging_flame.jpg http://www.wizards.com/global/images/magic/general/surging_flame.jpg +surging_might.jpg http://www.wizards.com/global/images/magic/general/surging_might.jpg +surging_sentinels.jpg http://www.wizards.com/global/images/magic/general/surging_sentinels.jpg glory.jpg http://www.wizards.com/global/images/magic/general/glory.jpg filth.jpg http://www.wizards.com/global/images/magic/general/filth.jpg abyssal_specter.jpg http://www.wizards.com/global/images/magic/general/abyssal_specter.jpg diff --git a/res/cards.txt b/res/cards.txt index 9347b5bf18b..9077b14d66f 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,44 @@ +Thrumming Stone +5 +Legendary Artifact +Spells you cast have ripple 4. + +Surging AEther +3 U +Instant +Return target permanent to its owner's hand. +Ripple:4 + +Surging Dementia +1 B +Sorcery +no text +spDamageTgtP:0:Drawback$TgtDiscard/1:Target player discards a card.:Surging Dementia - Target player discards a card. +Ripple:4 + +Surging Flame +1 R +Instant +no text +spDamageTgtCP:2 +Ripple:4 + +Surging Might +2 G +Enchantment Aura +Enchanted creature gets +2/+2. +Enchant creature +enPump:+2/+2 +Ripple:4 + +Surging Sentinels +2 W +Creature Human Soldier +no text +2/1 +First strike +Ripple:4 + Glory 3 W W Creature Incarnation diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index cb554eb3e3e..341f9a9ac02 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -13735,7 +13735,7 @@ public class CardFactory implements NewConstants { //*************** START *********** START ************************** - else if(cardName.equals("Boomerang") || cardName.equals("Eye of Nowhere")) { + else if(cardName.equals("Boomerang") || cardName.equals("Eye of Nowhere") || cardName.equals("Surging AEther")) { final SpellAbility spell = new Spell(card) { private static final long serialVersionUID = 5383879224433456795L; diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 7beefad154a..110c27084af 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -277,6 +277,7 @@ public class GameActionUtil { playCard_Artisan_of_Kozilek(c); playCard_Cascade(c); + playCard_Ripple(c); playCard_Storm(c); playCard_Dovescape(c); //keep this one top @@ -545,6 +546,102 @@ public class GameActionUtil { Cascade.execute(); } + public static void playCard_Ripple(final Card c) { + Command Ripple = new Command() { + private static final long serialVersionUID = -845154812215847505L; + public void execute() { + final PlayerZone play = AllZone.getZone(Constant.Zone.Play, + Constant.Player.Human); + final PlayerZone comp = AllZone.getZone(Constant.Zone.Play, + Constant.Player.Computer); + + CardList Human_ThrummingStone = new CardList(); + CardList Computer_ThrummingStone = new CardList(); + Human_ThrummingStone.addAll(play.getCards()); + Computer_ThrummingStone.addAll(comp.getCards()); + + Human_ThrummingStone = Human_ThrummingStone.getName("Thrumming Stone"); + Computer_ThrummingStone = Computer_ThrummingStone.getName("Thrumming Stone"); + for (int i=0;i a = c.getKeyword(); + for(int x = 0; x < a.size(); x++) + if(a.get(x).toString().startsWith("Ripple")) { + String parse = c.getKeyword().get(x).toString(); + String k[] = parse.split(":"); + DoRipple(c,Integer.valueOf(k[1])); + } + }// execute() + + void DoRipple(Card c, final int RippleCount) { + final String controller = c.getController(); + final PlayerZone lib = AllZone.getZone(Constant.Zone.Library, controller); + final Card RippleCard = c; + + final Ability ability = new Ability(c, "0") { + @Override + public void resolve() { + CardList topOfLibrary = new CardList(lib.getCards()); + CardList revealed = new CardList(); + int RippleNumber = RippleCount; + if(topOfLibrary.size() == 0) return; + int RippleMax = 10; // Shouldn't Have more than Ripple 10, seeing as no cards exist with a ripple greater than 4 + Card[] RippledCards = new Card[RippleMax]; + Card crd; + if(topOfLibrary.size() < RippleNumber) RippleNumber = topOfLibrary.size(); + + for(int i = 0; i < RippleNumber; i++){ + crd = topOfLibrary.get(i); + revealed.add(crd); + lib.remove(crd); + if(crd.getName().equals(RippleCard.getName())) RippledCards[i] = crd; + }//For + AllZone.Display.getChoiceOptional("Revealed cards:", revealed.toArray()); + for(int i = 0; i < RippleMax; i++) { + if(RippledCards[i] != null && !RippledCards[i].isUnCastable()) { + + if(RippledCards[i].getController().equals(Constant.Player.Human)) { + Object[] possibleValues = {"Yes", "No"}; + Object q = JOptionPane.showOptionDialog(null, "Cast " + RippledCards[i].getName() + "?", "Ripple", + JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, + null, possibleValues, possibleValues[0]); + if(q.equals(0)) { + AllZone.GameAction.playCardNoCost(RippledCards[i]); + revealed.remove(RippledCards[i]); + } + } else //computer + { + ArrayList choices = RippledCards[i].getBasicSpells(); + + for(SpellAbility sa:choices) { + if(sa.canPlayAI() && !sa.getSourceCard().getType().contains("Legendary")) { + ComputerUtil.playStackFree(sa); + revealed.remove(RippledCards[i]); + break; + } + } + } + } + } + revealed.shuffle(); + for(Card bottom:revealed) { + lib.add(bottom); + } + } + }; + ability.setStackDescription(c + " - Ripple."); + AllZone.Stack.add(ability); + } + }; + Ripple.execute(); + } + public static void playCard_Storm(Card c) { if(c.getKeyword().contains("Storm")) {