From 339bb6e9c920626504ac8b56ac81af94173f5bb9 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:19:23 +0000 Subject: [PATCH] - Fixed some bug I introduced by fixing Phyrexian Arena. - Fixed the way Meloku the Clouded Mirror works (can choose a land to return now - even though it's still done during resolution of the spell), won't be able to play the ability if there are no controlled lands in play. --- src/forge/CardFactory.java | 2 - src/forge/CardFactory_Creatures.java | 31 ++++++--- src/forge/GameActionUtil.java | 100 +-------------------------- 3 files changed, 26 insertions(+), 107 deletions(-) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 1e5b0ed2a6d..5171666cb69 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -5036,8 +5036,6 @@ public class CardFactory implements NewConstants { }//*************** END ************ END ************************** - - //*************** START *********** START ************************** else if(cardName.equals("Ashes to Ashes")) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 87365b53bb4..7d7cd6993f3 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -9383,7 +9383,6 @@ public class CardFactory_Creatures { }//*************** END ************ END ************************** - //*************** START *********** START ************************** else if(cardName.equals("Meloku the Clouded Mirror")) { @@ -9394,22 +9393,38 @@ public class CardFactory_Creatures { CardFactoryUtil.makeToken("Illusion", "U 1 1 Illusion", card, "U", new String[]{"Creature", "Illusion"}, 1, 1, new String[] {"Flying"}); PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); - //TODO: the "bounced" land should be chosen by the user - //instead of "automatically" done for him - CardList island = new CardList(play.getCards()); - island = island.filter(new CardListFilter() + CardList land = new CardList(play.getCards()); + land = land.filter(new CardListFilter() { public boolean addCard(Card c) { - return c.getType().contains("Land") && c.isTapped(); + return c.getType().contains("Land"); } }); PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - if(! island.isEmpty()) - AllZone.GameAction.moveTo(hand, island.get(0)); + if(! land.isEmpty()) { + Object o = AllZone.Display.getChoiceOptional("Select target Land", land.toArray()); + Card l = (Card)o; + AllZone.GameAction.moveTo(hand, l); + } + }//resolve() + + public boolean canPlay() + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList land = new CardList(play.getCards()); + land = land.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.getType().contains("Land"); + } + }); + return land.size() > 0; + } };//SpellAbility card.addSpellAbility(ability); ability.setDescription("1, Return a land you control to its owner's hand: Put a 1/1 blue Illusion creature token with flying into play."); diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index d1dcdf2ad58..06eb4061c51 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -4120,15 +4120,7 @@ public class GameActionUtil playerCombatDamage_Rith(c); else if (c.getName().equals("Vorosh, the Hunter")) playerCombatDamage_Vorosh(c); - /* - if(CardFactoryUtil.hasNumberEquipments(c, "Umezawa's Jitte") == 1) - { - PlayerZone play = AllZone.getZone(c); - CardList list = new CardList(play.getCards()); - list = list.getName("Umezawa's Jitte"); - Card jitte = list.get(0); - } - */ + if (c.getNetAttack() > 0) c.setDealtCombatDmgToOppThisTurn(true); @@ -5004,7 +4996,6 @@ public class GameActionUtil { Ability ability = new Ability(list.get(i), "0") { - public void resolve() { PlayerZone graveyard = AllZone.getZone( @@ -5089,7 +5080,6 @@ public class GameActionUtil AllZone.Stack.add(ability); }//for } - } private static void upkeep_Scute_Mob() @@ -5155,9 +5145,7 @@ public class GameActionUtil Card c = fungi.get(j); c.addCounter(Counters.SPORE, 1); } - } - };// Ability ability .setStackDescription("Sporesower - put a spore counter on each fungus you control."); @@ -5378,89 +5366,6 @@ public class GameActionUtil AllZone.Stack.add(ability); } } - /* - private static void upkeep_Sensation_Gorger() - { - final String player = AllZone.Phase.getActivePlayer(); - final String opponent = AllZone.GameAction.getOpponent(player); - PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player); - PlayerZone library = AllZone.getZone(Constant.Zone.Library, player); - - CardList list = new CardList(playZone.getCards()); - list = list.getName("Sensation Gorger"); - - Ability ability; - for (int i = 0; i < list.size(); i++) - { - - if (library.size() <= 0) - { - return; - } - - if (list.get(i).getController().equals("Human")) - { - String[] choices = { "Yes", "No" }; - Object o = AllZone.Display.getChoiceOptional("Use " + list.get(i).getName() + "'s ability this turn?", choices); - - if (o.equals("No")) - return; - } - - // System.out.println("top of deck: " + library.get(i).getName()); - String creatureType = library.get(i).getType().toString(); - String cardName = library.get(i).getName(); - - ability = new Ability(list.get(i), "0") - { - public void resolve() - { - PlayerZone library = AllZone.getZone(Constant.Zone.Library, - player); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, - player); - - // PlayerZone oppLibrary = - // AllZone.getZone(Constant.Zone.Library, opponent); - PlayerZone oppHand = AllZone.getZone(Constant.Zone.Hand, - opponent); - - String creatureType = library.get(0).getType().toString(); - - if (creatureType.contains("Goblin") - || creatureType.contains("Shaman")) - { - Card[] c = hand.getCards(); - for(int q = 0; q < c.length; q++) - AllZone.GameAction.discard(c[q]); - - Card[] oc = oppHand.getCards(); - for(int j = 0; j < oc.length; j++) - AllZone.GameAction.discard(oc[j]); - - for(int z = 0; z < 4; z++) - { - AllZone.GameAction.drawCard(Constant.Player.Computer); - AllZone.GameAction.drawCard(Constant.Player.Human); - } - - } - - }// resolve() - };// Ability - if (creatureType.contains("Goblin") - || creatureType.contains("Shaman")) - ability.setStackDescription("Sensation Gorger - " + player - + " reveals: " + cardName - + ", everyone discards their hands and draws 4 cards."); - else - ability.setStackDescription("Sensation Gorger - " + player - + " reveals top card: " + cardName + "."); - - AllZone.Stack.add(ability); - }// for - }// upkeep_Sensation_Gorger() - */ private static void upkeep_Sensation_Gorger() { @@ -7485,8 +7390,9 @@ public class GameActionUtil for (int i = 0; i < list.size(); i++) { AllZone.GameAction.drawCard(player); AllZone.GameAction.getPlayerLife(player).subtractLife(1); + + AllZone.GameAction.checkStateEffects(); } - AllZone.GameAction.checkStateEffects(); }// upkeep_Phyrexian_Arena private static void upkeep_Honden_of_Seeing_Winds()