diff --git a/res/cardsfolder/gilt_leaf_archdruid.txt b/res/cardsfolder/gilt_leaf_archdruid.txt index 9543358ff0e..dc22b80bf03 100644 --- a/res/cardsfolder/gilt_leaf_archdruid.txt +++ b/res/cardsfolder/gilt_leaf_archdruid.txt @@ -1,7 +1,7 @@ Name:Gilt-Leaf Archdruid ManaCost:3 G G Types:Creature Elf Druid -Text:Whenever you play a Druid spell, you may draw a card.\r\nTap seven untapped Druids you control: Gain control of all lands target player controls. +Text:Whenever you play a Druid spell, you may draw a card. PT:3/3 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/gilt_leaf_archdruid.jpg diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index aad81f26d7b..6b9b9198878 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -857,7 +857,7 @@ public class CardFactoryUtil { }//input_sacrifice() public static Input input_sacrificePermanent(final CardList choices, final String message) { - return input_sacrificePermanentsFromList(1, choices, "Select a permanent to sacrifice"); + return input_sacrificePermanentsFromList(1, choices, message); }//input_sacrifice() public static Input input_sacrificePermanents(final int nCards) { @@ -4328,7 +4328,7 @@ public class CardFactoryUtil { //c.setOwner(controller); // todo: most tokens mana cost is 0, this needs to be fixed - c.setManaCost(manaCost); + //c.setManaCost(manaCost); c.addColor(manaCost); c.setToken(true); diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index d20efa413c4..2923da9b799 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -10118,211 +10118,70 @@ public class CardFactory_Creatures { //*************** START *********** START ************************** else if(cardName.equals("Gilt-Leaf Archdruid")) { - final SpellAbility a1 = new Ability(card, "0") { - @Override - public boolean canPlay() { - Player controller = card.getController(); - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, controller); - - CardList druids = new CardList(); - - druids.addAll(play.getCards()); - druids = druids.getType("Druid"); - - //System.out.println("Druids size: " + druids.size()); - - int druidsUntapped = 0; - for(int i = 0; i < druids.size(); i++) { - Card c = druids.get(0); - if(!c.isTapped()) druidsUntapped++; - } - - if(druids.size() > 6 && druidsUntapped > 6 && AllZone.GameAction.isCardInPlay(card) && super.canPlay()) return true; - else return false; - } + Ability_Cost abCost = new Ability_Cost("tapXType<7/Druid>", cardName, true); + Target tgt = new Target("Select a player to gain lands from", "Player".split(",")); + final SpellAbility stealLands = new Ability_Activated(card, abCost, tgt){ + private static final long serialVersionUID = 636594487143500891L; + + @Override + public boolean canPlayAI(){ + Player p = AllZone.HumanPlayer; + + if (!p.canTarget(card)) + return false; + + setTargetPlayer(p); + + CardList lands = AllZoneUtil.getPlayerCardsInPlay(p); + lands = lands.getType("Land"); + + // Don't steal lands if Human has less than 2 + return lands.size() >= 2; + } @Override public void resolve() { + Player activator = this.getActivatingPlayer(); - Player player = card.getController(); - if(player.equals(AllZone.HumanPlayer)) humanResolve(); - else computerResolve(); + CardList lands = AllZoneUtil.getPlayerCardsInPlay(getTargetPlayer()); + lands = lands.getType("Land"); + + for(int i = 0; i < lands.size(); i++) { + Card land = lands.get(i); + if(AllZone.GameAction.isCardInPlay(land)) { // this really shouldn't fail in the middle of resolution + land.setController(activator); + + // i don't know how the code handles Sum Sickness so I'm leaving this + // but a card changing controllers should always gain this no matter if it has haste or not + if(land.getKeyword().contains("Haste")) { + land.setSickness(false); + } else { + land.setSickness(true); + } + + ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(false); + ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(false); + + PlayerZone from = AllZone.getZone(land); + from.remove(land); + + PlayerZone to = AllZone.getZone(Constant.Zone.Battlefield, card.getController()); + to.add(land); + + ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(true); + ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(true); + }//if + } } - - public void humanResolve() { - Player controller = card.getController(); - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, controller); - CardList druids = new CardList(); - - druids.addAll(play.getCards()); - druids = druids.getType("Druid"); - - CardList tappedDruids = new CardList(); - - Object o = AllZone.Display.getChoice("Pick first druid to tap", druids.toArray()); - - if(o != null) { - Card c1 = (Card) o; - druids.remove(c1); - tappedDruids.add(c1); - } else return; - - o = AllZone.Display.getChoice("Pick second druid to tap", druids.toArray()); - if(o != null) { - Card c2 = (Card) o; - druids.remove(c2); - tappedDruids.add(c2); - } else return; - - o = AllZone.Display.getChoice("Pick third druid to tap", druids.toArray()); - if(o != null) { - Card c3 = (Card) o; - druids.remove(c3); - tappedDruids.add(c3); - } else return; - - o = AllZone.Display.getChoice("Pick fourth druid to tap", druids.toArray()); - if(o != null) { - Card c4 = (Card) o; - druids.remove(c4); - tappedDruids.add(c4); - } else return; - o = AllZone.Display.getChoice("Pick fifth druid to tap", druids.toArray()); - if(o != null) { - Card c5 = (Card) o; - druids.remove(c5); - tappedDruids.add(c5); - } else return; - - o = AllZone.Display.getChoice("Pick sixth druid to tap", druids.toArray()); - if(o != null) { - Card c6 = (Card) o; - druids.remove(c6); - tappedDruids.add(c6); - } else return; - - o = AllZone.Display.getChoice("Pick seventh druid to tap", druids.toArray()); - if(o != null) { - Card c7 = (Card) o; - druids.remove(c7); - tappedDruids.add(c7); - } else return; - - for(int i = 0; i < tappedDruids.size(); i++) { - Card tapDruid = tappedDruids.get(i); - tapDruid.tap(); - } - - Player opponent = controller.getOpponent(); - PlayerZone opponentPlay = AllZone.getZone(Constant.Zone.Battlefield, opponent); - - CardList lands = new CardList(); - lands.addAll(opponentPlay.getCards()); - lands = lands.getType("Land"); - - //System.out.println("Land size: " +lands.size()); - - for(int i = 0; i < lands.size(); i++) { - Card land = lands.get(i); - - - if(AllZone.GameAction.isCardInPlay(land)) { - land.setController(controller); - - //set summoning sickness - if(land.getKeyword().contains("Haste")) { - land.setSickness(false); - } else { - land.setSickness(true); - } - - ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(false); - ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(false); - - PlayerZone from = AllZone.getZone(land); - from.remove(land); - - PlayerZone to = AllZone.getZone(Constant.Zone.Battlefield, card.getController()); - to.add(land); - - ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(true); - ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(true); - }//if - - - } - - }//humanResolve - - public void computerResolve() { - Player controller = card.getController(); - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, controller); - CardList druids = new CardList(); - - druids.addAll(play.getCards()); - druids = druids.getType("Druid"); - - - for(int i = 0; i < 7; i++) { - Card c = druids.get(i); - c.tap(); - - } - - Player opponent = controller.getOpponent(); - PlayerZone opponentPlay = AllZone.getZone(Constant.Zone.Battlefield, opponent); - - CardList lands = new CardList(); - lands.addAll(opponentPlay.getCards()); - lands = lands.getType("Land"); - - for(int i = 0; i < lands.size(); i++) { - Card land = lands.get(i); - if(AllZone.GameAction.isCardInPlay(land)) { - land.setController(controller); - - //set summoning sickness - if(land.getKeyword().contains("Haste")) { - land.setSickness(false); - } else { - land.setSickness(true); - } - - ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(false); - ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(false); - - PlayerZone from = AllZone.getZone(land); - from.remove(land); - - PlayerZone to = AllZone.getZone(Constant.Zone.Battlefield, card.getController()); - to.add(land); - - ((PlayerZone_ComesIntoPlay) AllZone.Human_Battlefield).setTriggers(true); - ((PlayerZone_ComesIntoPlay) AllZone.Computer_Battlefield).setTriggers(true); - }//if - } - - }//computerResolve - - };//a1 + }; - card.clearSpellAbility(); - card.addSpellAbility(a1); + card.addSpellAbility(stealLands); StringBuilder sb = new StringBuilder(); - sb.append(card.getController()).append(" taps seven untapped Druids and gains control of all opponent's land."); - a1.setStackDescription(sb.toString()); + sb.append(card.toString()).append(" - Gain control of all lands target player controls."); + stealLands.setStackDescription(sb.toString()); - a1.setDescription("Tap seven untapped Druids you control: Gain control of all lands target player controls."); - - card.addSpellAbility(new Spell_Permanent(card) { - private static final long serialVersionUID = -4621346281051305833L; - - @Override - public boolean canPlayAI() { - return true; - } - }); + stealLands.setDescription("Tap seven untapped Druids you control: Gain control of all lands target player controls."); }//*************** END ************ END ************************** diff --git a/src/forge/CardList.java b/src/forge/CardList.java index e67a6b55f36..8ba09a8ca94 100644 --- a/src/forge/CardList.java +++ b/src/forge/CardList.java @@ -305,7 +305,10 @@ public class CardList implements Iterable { } }); } - + + public CardList getValidCards(String Restrictions, final Player sourceController, final Card source) { + return getValidCards(Restrictions.split(","), sourceController, source); + } public CardList getValidCards(final String Restrictions[], final Player sourceController, final Card source) { return this.filter(new CardListFilter() { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 196caef16e1..0075f9f7b0b 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -10528,7 +10528,7 @@ public class GameActionUtil { c.setName("Dragon"); c.setImageName("RG 1 1 Dragon"); - c.setManaCost("RG"); + //c.setManaCost("RG"); c.addColor("RG"); c.setToken(true); diff --git a/src/forge/QuestUtil.java b/src/forge/QuestUtil.java index d0da4d7b6ee..d8c343174c4 100644 --- a/src/forge/QuestUtil.java +++ b/src/forge/QuestUtil.java @@ -122,7 +122,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("G"); + //c.setManaCost("G"); c.addColor("G"); c.setToken(true); @@ -208,7 +208,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("G"); + //c.setManaCost("G"); c.addColor("G"); c.setToken(true); @@ -265,7 +265,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("B"); + //c.setManaCost("B"); c.addColor("B"); c.setToken(true); @@ -322,7 +322,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("W"); + //c.setManaCost("W"); c.addColor("W"); c.setToken(true); @@ -381,7 +381,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("R"); + //c.setManaCost("R"); c.addColor("R"); c.setToken(true); @@ -503,7 +503,7 @@ public class QuestUtil { c.setController(AllZone.HumanPlayer); c.setOwner(AllZone.HumanPlayer); - c.setManaCost("G"); + //c.setManaCost("G"); c.addColor("G"); c.setToken(true); diff --git a/src/forge/SpellAbility_Restriction.java b/src/forge/SpellAbility_Restriction.java index 236cff226a7..80db9272367 100644 --- a/src/forge/SpellAbility_Restriction.java +++ b/src/forge/SpellAbility_Restriction.java @@ -155,9 +155,6 @@ public class SpellAbility_Restriction { if (activationLimit != -1 && numberTurnActivations >= activationLimit) return false; - /*if( activationNumberSacrifice != -1 && numberTurnActivations >= (activationNumberSacrifice - 1)) - return false;*/ - if (activatePhases.size() > 0){ boolean isPhase = false; String currPhase = AllZone.Phase.getPhase();