From 0e9c46ca6ae671a89b32a2b047e941b0b135fbfe Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:09:41 +0000 Subject: [PATCH] - Added Awakening Zone. --- res/cards.txt | 5 ++++ src/forge/CardFactoryUtil.java | 10 ++++++++ src/forge/GameActionUtil.java | 32 +++++++++++++++++++++++-- src/forge/gui/game/CardDetailPanel.java | 10 +++++++- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 6cc308ab6bf..45dd06e23e4 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Awakening Zone +2 G +Enchantment +At the beginning of your upkeep, you may put a 0/1 colorless Eldrazi Spawn creature token onto the battlefield. It has "Sacrifice this creature: Add 1 to your mana pool." + Chromatic Star 1 Artifact diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 1dac01a416f..afde20dfff0 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1813,6 +1813,16 @@ public class CardFactoryUtil { return enchant; }//enPumpCurse_Enchant() + public static Ability_Mana getEldraziSpawnAbility(final Card c) + { + SpellAbility mana = new Ability_Mana(c, "Sacrifice CARDNAME: Add 1 to your mana pool.") { + private static final long serialVersionUID = 2384540533244132975L; + }; + + return (Ability_Mana)mana; + } + + public static Command entersBattleFieldWithCounters(final Card c, final Counters type, final int n) { Command addCounters = new Command() { private static final long serialVersionUID = 4825430555490333062L; diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index ed49842e9ac..c87281fd06c 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -68,6 +68,7 @@ public class GameActionUtil { upkeep_Dragon_Broodmother(); //put this before bitterblossom and mycoloth, so that they will resolve FIRST upkeep_Bitterblossom(); upkeep_Goblin_Assault(); + upkeep_Awakening_Zone(); upkeep_Battle_of_Wits(); upkeep_Epic_Struggle(); upkeep_Near_Death_Experience(); @@ -6530,7 +6531,33 @@ public class GameActionUtil { AllZone.Stack.add(ability); }// for - }// upkeep_Bitterblossom() + }// upkeep_Goblin_Assault() + + private static void upkeep_Awakening_Zone() { + final String player = AllZone.Phase.getActivePlayer(); + PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player); + + CardList list = new CardList(playZone.getCards()); + list = list.getName("Awakening Zone"); + + Ability ability; + for(int i = 0; i < list.size(); i++) { + final Card crd = list.get(i); + ability = new Ability(list.get(i), "0") { + @Override + public void resolve() { + CardList cl = CardFactoryUtil.makeToken("Eldrazi Spawn", "C 0 1 Eldrazi Spawn", crd, "C", new String[] { + "Creature", "Eldrazi", "Spawn"}, 0, 1, new String[] {"Sacrifice CARDNAME: Add 1 to your mana pool."}); + for (Card c:cl) + c.addSpellAbility(CardFactoryUtil.getEldraziSpawnAbility(c)); + }// resolve() + };// Ability + ability.setStackDescription("Awakening Zone - " + player + + " puts a 0/1 colorless Eldrazi Spawn creature token onto the battlefield."); + + AllZone.Stack.add(ability); + }// for + }// upkeep_Awakening_Zone() private static void upkeep_Masticore() { final String player = AllZone.Phase.getActivePlayer(); @@ -8635,7 +8662,8 @@ public class GameActionUtil { }// for inner }// for outer }// execute() - }; //Goblin Assault + }; //Goblin Assault + public static Command Mobilization = new Command() { private static final long serialVersionUID = 2005579284163773044L; diff --git a/src/forge/gui/game/CardDetailPanel.java b/src/forge/gui/game/CardDetailPanel.java index 5439456a00a..deccece22b4 100644 --- a/src/forge/gui/game/CardDetailPanel.java +++ b/src/forge/gui/game/CardDetailPanel.java @@ -130,7 +130,7 @@ public class CardDetailPanel extends JPanel implements CardContainer { //displays keywords that have dots in them a little better: regex = "\\., "; - text = text.replaceAll(regex,"\r\n"); + text = text.replaceAll(regex,".\r\n"); area.append(text); } @@ -145,6 +145,14 @@ public class CardDetailPanel extends JPanel implements CardContainer { } } + //top revealed + if(card.getKeyword().contains("Play with the top card of your library revealed.") && + !card.getTopCardName().equals("")) + { + area.append("\r\nTop card: "); + area.append(card.getTopCardName()); + } + //chosen type if(card.getChosenType() != "") { if(area.length() != 0) area.append("\n");