diff --git a/res/cards.txt b/res/cards.txt index 8935c5d1142..23a538a201e 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Icy Manipulator +4 +Artifact +no text + Reprisal 1 W Instant diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index e1ebe814c63..85fde468aa7 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -3880,7 +3880,15 @@ public class CardFactory implements NewConstants { PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); list.addAll(play.getCards()); - if(cardName.equals("Nature's Cloak")) list = list.getColor("G"); + if(cardName.equals("Nature's Cloak")) { + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return CardUtil.getColors(c).contains(Constant.Color.Green); + } + }); + } } if(cardName.equals("Magnify") || // All Creatures in Play @@ -17599,6 +17607,32 @@ public class CardFactory implements NewConstants { spell.setBeforePayMana(target); }//*************** END ************ END ************************** + + + //*****************************START******************************* + if(cardName.equals("Icy Manipulator")) { + /* The Rules state that this can target a tapped card, but it won't do anything */ + + final Ability_Tap ability = new Ability_Tap(card, "1") { + private static final long serialVersionUID = 6349074398830621348L; + public boolean canPlayAI() { + return false; + } + public void chooseTargetAI() { + //setTargetCard(c); + }//chooseTargetAI() + public void resolve() { + if(AllZone.GameAction.isCardInPlay(getTargetCard())) { + getTargetCard().tap(); + } + } + };//SpellAbility + + card.addSpellAbility(ability); + ability.setDescription("1, tap: Tap target artifact, creature or land."); + ability.setBeforePayMana(CardFactoryUtil.input_targetType(ability, "Artifact;Creature;Land")); + }//end Icy Manipulator + //****************END*******END*********************** // Cards with Cycling abilities diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index d87cc3fc62e..69ec89caa4d 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Random; +import java.util.StringTokenizer; public class CardFactoryUtil { @@ -1611,6 +1612,7 @@ public class CardFactoryUtil { }//input_discard() + /* //cardType is like "Creature", "Land", "Artifact", "Goblin", "Legendary" //cardType can also be "All", which will allow any permanent to be selected public static Input input_targetType(final SpellAbility spell, final String cardType) { @@ -1642,7 +1644,55 @@ public class CardFactoryUtil { }; return target; }//input_targetType() + */ + //****************copied from input_targetType***************** + //cardType is like "Creature", "Land", "Artifact", "Goblin", "Legendary", ";"-delimited + //cardType can also be "All", which will allow any permanent to be selected + public static Input input_targetType(final SpellAbility spell, final String cardTypeList) { + Input target = new Input() { + private static final long serialVersionUID = 6443658187985259709L; + public void showMessage() { + StringTokenizer st = new StringTokenizer(cardTypeList, ";"); + if(cardTypeList.equals("All")) { + AllZone.Display.showMessage("Select target permanent"); + } + else { + String toDisplay = ""; + toDisplay += "Select target "; + while( st.hasMoreTokens() ) { + toDisplay += st.nextToken(); + if( st.hasMoreTokens() ) { + toDisplay += " or "; + } + } + AllZone.Display.showMessage( toDisplay ); + } + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() {stop();} + public void selectCard(Card card, PlayerZone zone) { + boolean foundCardType = false; + StringTokenizer st = new StringTokenizer(cardTypeList, ";"); + if( cardTypeList.equals("All") ) { + foundCardType = true; + } else { + while( st.hasMoreTokens() ) { + if( card.getType().contains( st.nextToken() )) { + foundCardType = true; + } + } + } + if( foundCardType && zone.is(Constant.Zone.Play)) { + spell.setTargetCard(card); + stopSetNext(new Input_PayManaCost(spell)); + } + } + }; + return target; + }//input_targetType() + //***************end copy****************** + public static Input input_targetCreature(final SpellAbility spell) { return input_targetCreature(spell, Command.Blank);