From 64e294366ff032c73e9fb057db9a8e65d5b2e05b Mon Sep 17 00:00:00 2001 From: jendave Date: Sun, 7 Aug 2011 01:16:03 +0000 Subject: [PATCH] add Ichneumon Druid (from Legends) --- .gitattributes | 1 + res/cardsfolder/ichneumon_druid.txt | 9 +++++++++ src/forge/GameActionUtil.java | 24 ++++++++++++++++++++++++ src/forge/Phase.java | 14 ++++++++++++-- 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 res/cardsfolder/ichneumon_druid.txt diff --git a/.gitattributes b/.gitattributes index 7c72d08038b..63f403aec3a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3460,6 +3460,7 @@ res/cardsfolder/ice_storm.txt -text svneol=native#text/plain res/cardsfolder/iceberg.txt svneol=native#text/plain res/cardsfolder/icefall.txt -text svneol=native#text/plain res/cardsfolder/icequake.txt svneol=native#text/plain +res/cardsfolder/ichneumon_druid.txt svneol=native#text/plain res/cardsfolder/ichor_explosion.txt svneol=native#text/plain res/cardsfolder/ichor_rats.txt -text svneol=native#text/plain res/cardsfolder/ichor_slick.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/ichneumon_druid.txt b/res/cardsfolder/ichneumon_druid.txt new file mode 100644 index 00000000000..c42fa2e036f --- /dev/null +++ b/res/cardsfolder/ichneumon_druid.txt @@ -0,0 +1,9 @@ +Name:Ichneumon Druid +ManaCost:1 G G +Types:Creature Human Druid +Text:Whenever an opponent casts an instant spell other than the first instant spell that player casts each turn, CARDNAME deals 4 damage to him or her. +PT:1/1 +SVar:RemRandomDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/ichneumon_druid.jpg +End \ No newline at end of file diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index e15fd017604..635c0baa0fb 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -127,6 +127,7 @@ public class GameActionUtil { playCard_Sigil_of_the_Empty_Throne(c); playCard_Curse_of_Wizardry(c); playCard_Venser_Emblem(c); + playCard_Ichneumon_Druid(c); } @@ -376,6 +377,29 @@ public class GameActionUtil { } }//playCard_Vengevine() + public static void playCard_Ichneumon_Druid(Card c) { + if (c.isInstant() && (Phase.PlayerInstantSpellCount >= 2 || Phase.ComputerInstantSpellCount >= 2)) { + final Player player = c.getController(); + final Player opp = player.getOpponent(); + CardList list = AllZoneUtil.getPlayerCardsInPlay(opp, "Ichneumon Druid"); + for(int i = 0; i < list.size(); i++) { + final Card card = list.get(i); + Ability ability = new Ability(card, "0") { + @Override + public void resolve() { + player.addDamage(4, card); + } + }; // ability + + StringBuilder sb = new StringBuilder(); + sb.append(card).append(" - ").append("Whenever an opponent casts an instant spell other than the first instant spell that player casts each turn, Ichneumon Druid deals 4 damage to him or her."); + ability.setStackDescription(sb.toString()); + + AllZone.Stack.addSimultaneousStackEntry(ability); + } + } + }//playCard_Ichneumon_Druid() + public static void playCard_Venser_Emblem(Card c) { final Player controller = c.getController(); diff --git a/src/forge/Phase.java b/src/forge/Phase.java index eed74c8e8d4..8885ac4c589 100644 --- a/src/forge/Phase.java +++ b/src/forge/Phase.java @@ -17,9 +17,11 @@ public class Phase extends MyObservable private static int GameBegins = 0; private static int StormCount; static int PlayerSpellCount; - static int PlayerCreatureSpellCount; + static int PlayerCreatureSpellCount; + static int PlayerInstantSpellCount; static int ComputerSpellCount; static int ComputerCreatureSpellCount; + static int ComputerInstantSpellCount; private Stack extraTurns = new Stack(); @@ -145,9 +147,11 @@ public class Phase extends MyObservable public void turnReset(){ setStormCount(0); PlayerSpellCount = 0; - PlayerCreatureSpellCount = 0; + PlayerCreatureSpellCount = 0; + PlayerInstantSpellCount = 0; ComputerSpellCount = 0; ComputerCreatureSpellCount = 0; + ComputerInstantSpellCount = 0; playerTurn.setNumLandsPlayed(0); } @@ -585,6 +589,9 @@ public class Phase extends MyObservable if (sp instanceof Spell_Permanent && sp.getSourceCard().isCreature()) { PlayerCreatureSpellCount++; } + if (sp.getSourceCard().isInstant()) { + PlayerInstantSpellCount++; + } } else { @@ -592,6 +599,9 @@ public class Phase extends MyObservable if (sp instanceof Spell_Permanent && sp.getSourceCard().isCreature()) { Phase.ComputerCreatureSpellCount++; } + if (sp.getSourceCard().isInstant()) { + ComputerInstantSpellCount++; + } } }