From a6ce06acd406e0587578af5e81c39d87dad96cef Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:20:55 +0000 Subject: [PATCH] add Arena of the Ancients from Legends --- res/card-pictures.txt | 1 + res/cards.txt | 5 +++++ src/forge/AllZoneUtil.java | 15 +++++++++------ src/forge/CardFactory.java | 29 +++++++++++++++++++++++++++++ src/forge/GameActionUtil.java | 35 +++++++++++++++++++++++++++++++++++ src/forge/StaticEffects.java | 1 + 6 files changed, 80 insertions(+), 6 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index ebb5758421b..4157a46c639 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 +arena_of_the_ancients.jpg http://www.wizards.com/global/images/magic/general/arena_of_the_ancients.jpg energy_tap.jpg http://www.wizards.com/global/images/magic/general/energy_tap.jpg divine_offering.jpg http://www.wizards.com/global/images/magic/general/divine_offering.jpg argothian_pixies.jpg http://www.wizards.com/global/images/magic/general/argothian_pixies.jpg diff --git a/res/cards.txt b/res/cards.txt index 39b5afbeba7..7c601cec8b8 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Arena of the Ancients +3 +Artifact +Legendary creatures don't untap during their controllers' untap steps. When Arena of the Ancients enters the battlefield, tap all legendary creatures. + Energy Tap U Sorcery diff --git a/src/forge/AllZoneUtil.java b/src/forge/AllZoneUtil.java index f1a70bd7f75..22a4ef1d19f 100644 --- a/src/forge/AllZoneUtil.java +++ b/src/forge/AllZoneUtil.java @@ -34,12 +34,6 @@ public class AllZoneUtil { return creatures.filter(AllZoneUtil.creatures); } - private static CardListFilter creatures = new CardListFilter() { - public boolean addCard(Card c) { - return c.isCreature(); - } - }; - ///////////////// Lands /** @@ -361,4 +355,13 @@ public class AllZoneUtil { return c.isUntapped(); } }; + + /** + * a CardListFilter to get all creaures + */ + public static CardListFilter creatures = new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature(); + } + }; } \ No newline at end of file diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 880d1a8cec3..3b2690cc6ed 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -19687,6 +19687,35 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Arena of the Ancients")) { + /* + * When Arena of the Ancients enters the battlefield, tap + * all legendary creatures. + */ + final SpellAbility ability = new Ability(card, "0") { + @Override + public void resolve() { + CardList legends = AllZoneUtil.getTypeInPlay("Legendary"); + legends = legends.filter(AllZoneUtil.creatures); + for(int i = 0; i < legends.size(); i++) { + Card c = legends.get(i); + if(c.isUntapped()) c.tap(); + } + } + };//ability + Command intoPlay = new Command() { + private static final long serialVersionUID = 3564466123797650567L; + + public void execute() { + ability.setStackDescription("When " + card.getName() + + " comes into play, tap all Legendary creatures."); + AllZone.Stack.add(ability); + } + }; + card.addComesIntoPlayCommand(intoPlay); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 140cc58cfac..758845ec443 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -8429,6 +8429,39 @@ public class GameActionUtil { }// execute() }; + /** + * stores the Command to execute the "Legends don't untap during your untap step" + */ + public static Command Arena_of_the_Ancients = new Command() { + private static final long serialVersionUID = -3233715310427996429L; + + CardList gloriousAnthemList = new CardList(); + + public void execute() { + String keyword = "CARDNAME doesn't untap during your untap step."; + + CardList list = gloriousAnthemList; + Card c; + // reset all cards in list - aka "old" cards + for(int i = 0; i < list.size(); i++) { + c = list.get(i); + c.removeExtrinsicKeyword(keyword); + } + list.clear(); + + if(AllZoneUtil.isCardInPlay("Arena of the Ancients")) { + CardList legends = AllZoneUtil.getTypeInPlay("Legendary"); + legends = legends.filter(AllZoneUtil.creatures); + for(int i = 0; i < legends.size(); i++) { + c = legends.get(i); + if(!c.getKeyword().contains(keyword)) { + c.addExtrinsicKeyword(keyword); + gloriousAnthemList.add(c); + } + }//for + }//if + }// execute() + }; public static Command Absolute_Grace = new Command() { private static final long serialVersionUID = -6904191523315339355L; @@ -16301,6 +16334,8 @@ public class GameActionUtil { commands.put("Kor_Duelist", Kor_Duelist); commands.put("Keldon_Warlord", Keldon_Warlord); commands.put("Heedless_One", Heedless_One); + commands.put("Arena_of_the_Ancients", Arena_of_the_Ancients); + //System.out.println("size of commands: " + commands.size()); } diff --git a/src/forge/StaticEffects.java b/src/forge/StaticEffects.java index bdeaea1784f..684c3d8b8d8 100644 --- a/src/forge/StaticEffects.java +++ b/src/forge/StaticEffects.java @@ -203,6 +203,7 @@ public class StaticEffects cardToEffectsList.put("Kor Duelist", new String[] {"Kor_Duelist"}); cardToEffectsList.put("Keldon Warlord", new String[] {"Keldon_Warlord"}); cardToEffectsList.put("Heedless One", new String[] {"Heedless_One"}); + cardToEffectsList.put("Arena of the Ancients", new String[] {"Arena_of_the_Ancients"}); } public HashMap getCardToEffectsList()