From f5550a6835f30ea9aa20e58ae9d3d03b3a76c458 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:01:54 +0000 Subject: [PATCH] added Soul's Attendant from Rise of the Eldrazi (identical to Soul Warden) --- res/card-pictures.txt | 1 + res/cards.txt | 6 +++ src/forge/GameActionUtil.java | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 8328a8fc0e5..80be244208f 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 +souls_attendant.jpg http://www.wizards.com/global/images/magic/general/souls_attendant.jpg lighthouse_chronologist.jpg http://www.wizards.com/global/images/magic/general/lighthouse_chronologist.jpg transcendent_master.jpg http://www.wizards.com/global/images/magic/general/transcendent_master.jpg student_of_warfare.jpg http://www.wizards.com/global/images/magic/general/student_of_warfare.jpg diff --git a/res/cards.txt b/res/cards.txt index 2c336ba058c..50684143f54 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,9 @@ +Soul's Attendant +W +Creature Human Cleric +Whenever another creature comes into play, you gain 1 life. +1/1 + Kazandu Tuskcaller 1 G Creature Human Shaman diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index d8ef83b1e46..b4c4f4df11c 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -7354,6 +7354,7 @@ public class GameActionUtil { Essence_Warden.execute(); Soul_Warden.execute(); + Souls_Attendant.execute(); Wirewood_Hivemaster.execute(); Sacrifice_NoIslands.execute(); @@ -9707,6 +9708,87 @@ public class GameActionUtil { old = current; }// execute() }; // soul warden + + public static Command Souls_Attendant = new Command() { + private static final long serialVersionUID = -472504539729742971L; + // Hold old creatures + CardList old = new CardList(); // Hold old Soul Wardens + CardList soul = new CardList(); + + public void execute() { + // get all creatures + CardList current = new CardList(); + current.addAll(AllZone.Human_Play.getCards()); + current.addAll(AllZone.Computer_Play.getCards()); + //current = current.getType("Creature"); + + final ArrayList list = CardFactoryUtil.getCreatureLandNames(); + + current = current.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature() + && !list.contains(c.getName()); + } + }); + + // Holds Soul Warden's in play + CardList wardenList = current.getName("Soul's Attendant"); + + // Holds Soul Warden's that are new to play + CardList newWarden = new CardList(); + + // Go through the list of Soul Warden's in play + for(int i = 0; i < wardenList.size(); i++) { + Card c = wardenList.get(i); + + // Check to see which Soul Warden's in play are new + if(!soul.contains(c)) { + newWarden.add(c); + wardenList.remove(c); + i -= 1; // Must do as a card was just removed + } + + current.remove(c); + } + + for(int outer = 0; outer < wardenList.size(); outer++) { + // Gain life for new creatures in play - excluding any new Soul + // Wardens + final int[] n = new int[1]; + for(int i = 0; i < current.size(); i++) { + if(!old.contains(current.getCard(i))) { + n[0]++; + } + } + + // Gain life for new Soul's Attendants + n[0] += newWarden.size(); + + final PlayerLife life = AllZone.GameAction.getPlayerLife(wardenList.get( + outer).getController()); + SpellAbility ability = new Ability(new Card(), + "0") { + + @Override + public void resolve() { + life.addLife(n[0]); + } + }; + ability.setStackDescription(wardenList.get(outer).getName() + + " - " + + wardenList.get(outer).getController() + + " gains " + n[0] + " life"); + + if(n[0] != 0) { + AllZone.Stack.push(ability); + } + }// outer for + + soul = wardenList; + soul.addAll(newWarden.toArray()); + old = current; + }// execute() + }; // soul's Attendant public static Command Wirewood_Hivemaster = new Command() { private static final long serialVersionUID = -6440532066018273862L;