diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 98fd6fb04dc..e568c4c7cb1 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 +winter_orb.jpg http://www.wizards.com/global/images/magic/general/winter_orb.jpg keldon_warlord.jpg http://www.wizards.com/global/images/magic/general/keldon_warlord.jpg zuran_orb.jpg http://www.wizards.com/global/images/magic/general/zuran_orb.jpg storm_seeker.jpg http://www.wizards.com/global/images/magic/general/storm_seeker.jpg diff --git a/res/cards.txt b/res/cards.txt index c53be72e2fa..007a9178b67 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Winter Orb +2 +Artifact +As long as Winter Orb is untapped, players can't untap more than one land during their untap steps. + Keldon Warlord 2 R R Creature Human Barbarian diff --git a/src/forge/Input_Untap.java b/src/forge/Input_Untap.java index e8b5b3d2585..062ec02a4e8 100644 --- a/src/forge/Input_Untap.java +++ b/src/forge/Input_Untap.java @@ -62,23 +62,95 @@ public class Input_Untap extends Input { private void doUntap() { PlayerZone p = AllZone.getZone(Constant.Zone.Play, AllZone.Phase.getActivePlayer()); - CardList list = new CardList(p.getCards()); - list = list.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - if (isMarbleTitanInPlay()) - return c.getNetAttack() < 3; - - return true; - } - }); - - for(Card c : list) { - if(!c.getKeyword().contains("This card doesn't untap during your untap step.") - && !c.getKeyword().contains("This card doesn't untap during your next untap step.")) c.untap(); - else c.removeExtrinsicKeyword("This card doesn't untap during your next untap step."); - - } + CardList list = new CardList(p.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + if( isMarbleTitanInPlay() && isWinterOrbInEffect() ) { + return !c.isLand() && c.getNetAttack() < 3; + } + else if( isWinterOrbInEffect() ) { + return !c.isLand(); + } + else if (isMarbleTitanInPlay()) { + return c.getNetAttack() < 3; + } + + return true; + } + }); + + for(Card c : list) { + if(!c.getKeyword().contains("This card doesn't untap during your untap step.") + && !c.getKeyword().contains("This card doesn't untap during your next untap step.")) c.untap(); + else c.removeExtrinsicKeyword("This card doesn't untap during your next untap step."); + + } + if( isWinterOrbInEffect() ) { + if( AllZone.Phase.getActivePlayer().equals(Constant.Player.Computer) ) { + //search for lands the computer has and only untap 1 + CardList landList = new CardList(p.getCards()); + landList = landList.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isLand() && c.isTapped(); + } + }); + if( landList.size() > 0 ) { + landList.get(0).untap(); + } + } + else { + Input target = new Input() { + private static final long serialVersionUID = 6653677835629939465L; + public void showMessage() { + AllZone.Display.showMessage("Winter Orb - Select one tapped land to untap"); + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() {stop();} + public void selectCard(Card c, PlayerZone zone) { + if(c.isLand() && zone.is(Constant.Zone.Play) && c.isTapped()) { + c.untap(); + stop(); + } + }//selectCard() + };//Input + CardList landList = new CardList(p.getCards()); + landList = landList.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isLand() && c.isTapped(); + } + }); + if( landList.size() > 0 ) { + AllZone.InputControl.setInput(target); + } + + } + } + }//end doUntap + + + private boolean isWinterOrbInEffect() { + CardList all = new CardList(); + all.addAll(AllZone.Human_Play.getCards()); + all.addAll(AllZone.Computer_Play.getCards()); + all = all.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.getName().equals("Winter Orb"); + } + }); + + //if multiple Winter Orbs, check that at least 1 of them is untapped + for( int i = 0; i < all.size(); i++ ) { + if( all.get(i).isUntapped() ) { + return true; + } + } + return false; } + } \ No newline at end of file