diff --git a/.gitattributes b/.gitattributes index b92865bcb8c..0846445559b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -117,6 +117,7 @@ res/cardsfolder/amrou_seekers.txt -text svneol=native#text/plain res/cardsfolder/amulet_of_vigor.txt -text svneol=native#text/plain res/cardsfolder/an_havva_inn.txt -text svneol=native#text/plain res/cardsfolder/an_havva_township.txt -text svneol=native#text/plain +res/cardsfolder/an_zerrin_ruins.txt -text svneol=native#text/plain res/cardsfolder/anaba_bodyguard.txt -text svneol=native#text/plain res/cardsfolder/anaba_shaman.txt -text svneol=native#text/plain res/cardsfolder/anaba_spirit_crafter.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/an_zerrin_ruins.txt b/res/cardsfolder/an_zerrin_ruins.txt new file mode 100644 index 00000000000..deee525c13f --- /dev/null +++ b/res/cardsfolder/an_zerrin_ruins.txt @@ -0,0 +1,7 @@ +Name:An-Zerrin Ruins +ManaCost:2 R R +Types:Enchantment +Text:As An-Zerrin Ruins enters the battlefield, choose a creature type.\r\nCreatures of the chosen type don't untap during their controllers' untap steps. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/an_zerrin_ruins.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 2511bd8bbf0..61d5ab9e08b 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -10442,7 +10442,36 @@ public class CardFactory implements NewConstants { card.addSpellAbility(ability); ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability)); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if (cardName.equals("An-Zerrin Ruins")) { + + final SpellAbility comesIntoPlayAbility = new Ability(card, "0") { + @Override + public void resolve() { + String chosenType = ""; + if(card.getController().equals(Constant.Player.Human)) { + chosenType = JOptionPane.showInputDialog(null, "Enter a creature type:", card.getName(), + JOptionPane.QUESTION_MESSAGE); + } + else { + //not implemented for AI + } + card.setChosenType(chosenType); + }//resolve() + }; //comesIntoPlayAbility + + Command intoPlay = new Command() { + private static final long serialVersionUID = 2985015252466920757L; + public void execute() { + comesIntoPlayAbility.setStackDescription(card.getName()+" - choose a creature type. Creatures of that type do not untap during their controller's untap step."); + AllZone.Stack.add(comesIntoPlayAbility); + } + }; + + card.addComesIntoPlayCommand(intoPlay); + }//*************** END ************ END ************************** // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/Input_Untap.java b/src/forge/Input_Untap.java index 59cee0acda3..1893d39b5ac 100644 --- a/src/forge/Input_Untap.java +++ b/src/forge/Input_Untap.java @@ -1,6 +1,8 @@ package forge; +import java.util.ArrayList; + public class Input_Untap extends Input { private static final long serialVersionUID = 3452595801560263386L; @@ -99,6 +101,9 @@ public class Input_Untap extends Input { } } } + else if(isAnZerrinRuinsType(getAnZerrinRuinsTypes(), c)) { + //nothing to do, just doesn't let the card untap + } else if((c.getCounters(Counters.WIND)>0) && AllZoneUtil.isCardInPlay("Freyalise's Winds")) { //remove a WIND counter instead of untapping c.subtractCounter(Counters.WIND, 1); @@ -168,5 +173,22 @@ public class Input_Untap extends Input { } return false; } + + private ArrayList getAnZerrinRuinsTypes() { + ArrayList types = new ArrayList(); + CardList ruins = AllZoneUtil.getCardsInPlay("An-Zerrin Ruins"); + for(Card ruin:ruins) { + types.add(ruin.getChosenType()); + } + return types; + } + + private boolean isAnZerrinRuinsType(ArrayList types, Card card) { + ArrayList cardTypes = card.getType(); + for(String type:cardTypes) { + if(types.contains(type)) return true; + } + return false; + } } \ No newline at end of file