From 897c6da17eb2bd6827155c274e5c4490e95795c0 Mon Sep 17 00:00:00 2001 From: jendave Date: Sun, 7 Aug 2011 01:52:04 +0000 Subject: [PATCH] add Ceta Sanctuary (from Apocalypse) --- .gitattributes | 1 + res/cardsfolder/ceta_sanctuary.txt | 8 +++++++ src/forge/GameActionUtil.java | 35 ++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 res/cardsfolder/ceta_sanctuary.txt diff --git a/.gitattributes b/.gitattributes index 752fbbeab20..08ecf7f1fd0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1217,6 +1217,7 @@ res/cardsfolder/cerulean_wisps.txt -text svneol=native#text/plain res/cardsfolder/cerulean_wyvern.txt -text svneol=native#text/plain res/cardsfolder/cessation.txt -text svneol=native#text/plain res/cardsfolder/ceta_disciple.txt -text svneol=native#text/plain +res/cardsfolder/ceta_sanctuary.txt -text svneol=native#text/plain res/cardsfolder/chain_reaction.txt -text svneol=native#text/plain res/cardsfolder/chainbreaker.txt svneol=native#text/plain res/cardsfolder/chained_throatseeker.txt svneol=native#text/plain diff --git a/res/cardsfolder/ceta_sanctuary.txt b/res/cardsfolder/ceta_sanctuary.txt new file mode 100644 index 00000000000..ffcb48450da --- /dev/null +++ b/res/cardsfolder/ceta_sanctuary.txt @@ -0,0 +1,8 @@ +Name:Ceta Sanctuary +ManaCost:2 U +Types:Enchantment +Text:At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card. +SVar:RemRandomDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://wizards.com/global/images/magic/general/ceta_sanctuary.jpg +End \ No newline at end of file diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index b0404397337..6174bd72bdf 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -40,6 +40,7 @@ public class GameActionUtil { upkeep_Carnophage(); upkeep_Sangrophage(); upkeep_Dega_Sanctuary(); + upkeep_Ceta_Sanctuary(); upkeep_Tangle_Wire(); upkeep_Dance_of_the_Dead(); upkeep_Mana_Crypt(); @@ -3670,6 +3671,40 @@ public class GameActionUtil { }//for }//upkeep_Dega_Sanctuary() + + private static void upkeep_Ceta_Sanctuary() { + final Player player = AllZone.Phase.getPlayerTurn(); + + CardList list = AllZoneUtil.getPlayerCardsInPlay(player, "Ceta Sanctuary"); + + for(Card sanc:list) { + final Card source = sanc; + final Ability ability = new Ability(source, "0") { + public void resolve() { + int draw = 0; + CardList play = AllZoneUtil.getPlayerCardsInPlay(player); + CardList green = play.filter(AllZoneUtil.green); + CardList red = play.filter(AllZoneUtil.red); + + if(green.size() > 0 && red.size() > 0) draw = 2; + else if(green.size() > 0 || red.size() > 0) draw = 1; + + if(draw > 0) { + player.drawCards(draw); + player.discard(1, this, true); + } + } + };//Ability + + StringBuilder sb = new StringBuilder(); + sb.append(source).append(" - "); + sb.append("At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card."); + ability.setStackDescription(sb.toString()); + + AllZone.Stack.addSimultaneousStackEntry(ability); + + }//for + }//upkeep_Ceta_Sanctuary() private static void upkeep_Power_Surge() { /*