From 3ad9ebf1c2ffa452054efe62843b8bd5fcc0070e Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 08:20:48 +0000 Subject: [PATCH] -add Goblin Scouts (from Mirage) -add Icatian Town (from Fallen Empires) -add Sosuke's Summons (from Betrayers of Kamigawa) --- .gitattributes | 3 ++ res/cardsfolder/goblin_scouts.txt | 8 +++++ res/cardsfolder/icatian_town.txt | 8 +++++ res/cardsfolder/sosukes_summons.txt | 8 +++++ src/forge/AllZoneUtil.java | 6 ++++ src/forge/GameActionUtil.java | 49 +++++++++++++++++++++++++++++ 6 files changed, 82 insertions(+) create mode 100644 res/cardsfolder/goblin_scouts.txt create mode 100644 res/cardsfolder/icatian_town.txt create mode 100644 res/cardsfolder/sosukes_summons.txt diff --git a/.gitattributes b/.gitattributes index 049af47d2e7..ef9c7a3de08 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1528,6 +1528,7 @@ res/cardsfolder/goblin_replica.txt -text svneol=native#text/plain res/cardsfolder/goblin_rimerunner.txt -text svneol=native#text/plain res/cardsfolder/goblin_ringleader.txt -text svneol=native#text/plain res/cardsfolder/goblin_roughrider.txt -text svneol=native#text/plain +res/cardsfolder/goblin_scouts.txt -text svneol=native#text/plain res/cardsfolder/goblin_settler.txt -text svneol=native#text/plain res/cardsfolder/goblin_sharpshooter.txt -text svneol=native#text/plain res/cardsfolder/goblin_sky_raider.txt -text svneol=native#text/plain @@ -1785,6 +1786,7 @@ res/cardsfolder/hypnotic_specter.txt -text svneol=native#text/plain res/cardsfolder/hystrodon.txt -text svneol=native#text/plain res/cardsfolder/icatian_priest.txt -text svneol=native#text/plain res/cardsfolder/icatian_scout.txt -text svneol=native#text/plain +res/cardsfolder/icatian_town.txt -text svneol=native#text/plain res/cardsfolder/ice_storm.txt -text svneol=native#text/plain res/cardsfolder/ichor_slick.txt -text svneol=native#text/plain res/cardsfolder/ichorclaw_myr.txt -text svneol=native#text/plain @@ -3406,6 +3408,7 @@ res/cardsfolder/sootfeather_flock.txt -text svneol=native#text/plain res/cardsfolder/soothing_balm.txt -text svneol=native#text/plain res/cardsfolder/sootwalkers.txt -text svneol=native#text/plain res/cardsfolder/sorceress_queen.txt -text svneol=native#text/plain +res/cardsfolder/sosukes_summons.txt -text svneol=native#text/plain res/cardsfolder/soul_feast.txt -text svneol=native#text/plain res/cardsfolder/soul_net.txt -text svneol=native#text/plain res/cardsfolder/soul_warden.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/goblin_scouts.txt b/res/cardsfolder/goblin_scouts.txt new file mode 100644 index 00000000000..a8f4f802e21 --- /dev/null +++ b/res/cardsfolder/goblin_scouts.txt @@ -0,0 +1,8 @@ +Name:Goblin Scouts +ManaCost:3 R R +Types:Sorcery +Text:Put three 1/1 red Goblin Scout creature tokens with mountainwalk onto the battlefield. +K:spMakeToken<>3<>Goblin Scout<>R 1 1 Goblin Scout<>Controller<>R<>Creature;Goblin;Scout<>1<>1<>Mountainwalk +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_scouts.jpg +End diff --git a/res/cardsfolder/icatian_town.txt b/res/cardsfolder/icatian_town.txt new file mode 100644 index 00000000000..02f654ad94b --- /dev/null +++ b/res/cardsfolder/icatian_town.txt @@ -0,0 +1,8 @@ +Name:Icatian Town +ManaCost:5 W +Types:Sorcery +Text:Put four 1/1 white Citizen creature tokens onto the battlefield. +K:spMakeToken<>4<>Citizen<>W 1 1 Citizen<>Controller<>W<>Creature;Citizen<>1<>1<>None +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/icatian_town.jpg +End diff --git a/res/cardsfolder/sosukes_summons.txt b/res/cardsfolder/sosukes_summons.txt new file mode 100644 index 00000000000..f37255cdaf2 --- /dev/null +++ b/res/cardsfolder/sosukes_summons.txt @@ -0,0 +1,8 @@ +Name:Sosuke's Summons +ManaCost:2 G +Types:Sorcery +Text:Put two 1/1 green Snake creature tokens onto the battlefield.\r\nWhenever a nontoken Snake enters the battlefield under your control, you may return Sosuke's Summons from your graveyard to your hand. +K:spMakeToken<>2<>Snake<>G 1 1 Snake<>Controller<>G<>Creature;Snake<>1<>1<>None +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/sosukes_summons.jpg +End diff --git a/src/forge/AllZoneUtil.java b/src/forge/AllZoneUtil.java index ca1b9dd8e87..b94a409f8a2 100644 --- a/src/forge/AllZoneUtil.java +++ b/src/forge/AllZoneUtil.java @@ -453,4 +453,10 @@ public class AllZoneUtil { return !c.isEnchanted(); } }; + + public static CardListFilter nonToken = new CardListFilter() { + public boolean addCard(Card c) { + return !c.isToken(); + } + }; } \ No newline at end of file diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 0823c16a501..3c697d697d6 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -9708,6 +9708,7 @@ public class GameActionUtil { Baru.execute(); Reach_of_Branches.execute(); + Sosukes_Summons.execute(); Essence_Warden.execute(); Soul_Warden.execute(); @@ -13122,6 +13123,54 @@ public class GameActionUtil { return false; }// newForest() }; // Reach of Branches + + // Reach of Branches + public static Command Sosukes_Summons= new Command() { + CardList oldSnakes = new CardList(); + + public void execute() { + // count card "Reach of Branches" in graveyard + final String player = AllZone.Phase.getActivePlayer(); + final CardList nCard = AllZoneUtil.getPlayerGraveyard(player, "Sosuke's Summons"); + + // get all Snakes that player has + CardList newSnakes = AllZoneUtil.getPlayerTypeInPlay(player, "Snake"); + newSnakes = newSnakes.filter(AllZoneUtil.nonToken); + + // if "Sosuke's Summons" is in graveyard and played a Forest + if(0 < nCard.size() && newSnake(oldSnakes, newSnakes)) { + SpellAbility ability = new Ability( new Card(), "0" ) { + @Override + public void resolve() { + // return all Reach of Branches to hand + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player); + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); + for(int i = 0; i < nCard.size(); i++) { + grave.remove(nCard.get(i)); + hand.add(nCard.get(i)); + } + }// resolve() + };// SpellAbility + ability.setStackDescription("Sosuke's Summons - return card to " + + player + "'s hand"); + AllZone.Stack.add(ability); + }// if + + // potential problem: if a Forest is bounced to your hand + // "Reach Branches" + // won't trigger when you play that Forest + oldSnakes.addAll(newSnakes.toArray()); + }// execute + + // check if newList has anything that oldList doesn't have + boolean newSnake(CardList oldList, CardList newList) { + // check if a Snake came into play under your control + for(int i = 0; i < newList.size(); i++) + if(!oldList.contains(newList.get(i))) return true; + + return false; + }// newSnake() + }; // Sosukes Summons public static Command Mad_Auntie = new Command() { private static final long serialVersionUID = 7969640438477308299L;