diff --git a/res/cards.txt b/res/cards.txt index f4170273fa3..179e7319e7d 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,15 @@ +Avenger of Zendikar +5 G G +Creature Elemental +When Avenger of Zendikar enters the battlefield, put a 0/1 green Plant creature token onto the battlefield for each land you control. Landfall - Whenever a land enters the battlefield under your control, you may put a +1/+1 counter on each Plant creature you control. +5/5 +Landfall + +Bestial Menace +3 G G +Sorcery +Put a 1/1 green Snake creature token, a 2/2 green Wolf creature token, and a 3/3 green Elephant creature token onto the battlefield. + Doubling Season 4 G Enchantment diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index 334b56eb390..bb4e7166bb9 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -1,5 +1,5 @@ - + @@ -16,7 +16,7 @@ 0 0 - 245 + 249 827 @@ -27,8 +27,8 @@ 0 0 - 245 - 128 + 249 + 125 @@ -47,8 +47,8 @@ 0 - 128 - 245 + 125 + 249 10 @@ -62,9 +62,9 @@ 0 - 138 - 245 - 192 + 135 + 249 + 189 @@ -83,8 +83,8 @@ 0 - 330 - 245 + 324 + 249 10 @@ -98,9 +98,9 @@ 0 - 340 - 245 - 109 + 334 + 249 + 106 @@ -119,8 +119,8 @@ 0 - 449 - 245 + 440 + 249 10 @@ -134,9 +134,9 @@ 0 - 459 - 245 - 103 + 450 + 249 + 100 @@ -155,8 +155,8 @@ 0 - 562 - 245 + 550 + 249 10 @@ -170,9 +170,9 @@ 0 - 572 - 245 - 255 + 560 + 249 + 267 @@ -202,7 +202,7 @@ - 245 + 249 0 10 827 @@ -217,9 +217,9 @@ - 255 + 259 0 - 899 + 863 827 @@ -228,10 +228,10 @@ - 255 + 259 0 - 899 - 149 + 863 + 146 @@ -249,9 +249,9 @@ - 255 - 149 - 899 + 259 + 146 + 863 10 @@ -264,10 +264,10 @@ - 255 - 159 - 899 - 159 + 259 + 156 + 863 + 147 @@ -285,9 +285,9 @@ - 255 - 318 - 899 + 259 + 303 + 863 10 @@ -300,10 +300,10 @@ - 255 - 328 - 899 - 135 + 259 + 313 + 863 + 162 @@ -321,9 +321,9 @@ - 255 - 463 - 899 + 259 + 475 + 863 10 @@ -336,10 +336,10 @@ - 255 - 473 - 899 - 172 + 259 + 485 + 863 + 170 @@ -357,9 +357,9 @@ - 255 - 645 - 899 + 259 + 655 + 863 10 @@ -372,10 +372,10 @@ - 255 - 655 - 899 - 172 + 259 + 665 + 863 + 162 @@ -408,7 +408,7 @@ - 1154 + 1122 0 10 827 @@ -423,9 +423,9 @@ - 1164 + 1132 0 - 276 + 308 827 @@ -434,10 +434,10 @@ - 1164 + 1132 0 - 276 - 408 + 308 + 360 @@ -455,9 +455,9 @@ - 1164 - 408 - 276 + 1132 + 360 + 308 10 @@ -470,10 +470,10 @@ - 1164 - 418 - 276 - 409 + 1132 + 370 + 308 + 457 diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 5181fb16ba4..8ea211b3b33 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -5494,7 +5494,8 @@ public class CardFactory implements NewConstants { { CardList play = new CardList(AllZone.Human_Play.getCards()); Card target = CardFactoryUtil.AI_getBestCreature(play, card); - setTargetCard(target); + if (target!=null) + setTargetCard(target); } }; spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); @@ -9924,7 +9925,7 @@ public class CardFactory implements NewConstants { public void resolve() { - CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card, "G", new String[]{"Creature", "Beast"}, 1, 1, new String[] {""}); + CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card, "G", new String[]{"Creature", "Beast"}, 3, 3, new String[] {""}); //return card to hand if necessary String opponent = AllZone.GameAction.getOpponent(card.getController()); @@ -16949,6 +16950,23 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if (cardName.equals("Bestial Menace")) + { + SpellAbility spell = new Spell(card) + { + private static final long serialVersionUID = 523613120207836692L; + + public void resolve() + { + CardFactoryUtil.makeToken("Snake", "G 1 1 Snake", card, "G", new String[]{"Creature", "Snake"}, 1, 1, new String[] {""}); + CardFactoryUtil.makeToken("Wolf", "G 2 2 Wolf", card, "G", new String[]{"Creature", "Wolf"}, 2, 2, new String[] {""}); + CardFactoryUtil.makeToken("Elephant", "G 3 3 Elephant", card, "G", new String[]{"Creature", "Elephant"}, 3, 3, new String[] {""}); + }//resolve() + }; + card.clearSpellAbility(); + card.addSpellAbility(spell); + }//*************** END ************ END ************************** // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index c7087bf691f..87365b53bb4 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -715,6 +715,7 @@ public class CardFactory_Creatures { if(AllZone.GameAction.isCardInPlay(getTargetCard()) && getTargetCard().getController().equals(card.getController()) && CardFactoryUtil.canTarget(card,getTargetCard()) ) { + Card copy; if (!getTargetCard().isToken()) { @@ -724,7 +725,11 @@ public class CardFactory_Creatures { //copy creature and put it into play //copy = getCard(getTargetCard(), getTargetCard().getName(), card.getController()); copy = cfact.getCard(getTargetCard().getName(), getTargetCard().getOwner()); - copy.setToken(true); + + //when copying something stolen: + copy.setController(getTargetCard().getController()); + + copy.setToken(true); if (getTargetCard().isFaceDown()) { copy.setIsFaceDown(true); @@ -741,6 +746,8 @@ public class CardFactory_Creatures { else //isToken() { Card c = getTargetCard(); + + copy = new Card(); copy.setName(c.getName()); @@ -8476,13 +8483,202 @@ public class CardFactory_Creatures { AllZone.Stack.push(ability); } - }//execute() };//Command card.addDestroyCommand(leavesPlay); }//*************** END ************ END ************************** - + + + //*************** START *********** START ************************** + else if(cardName.equals("Sower of Temptation")) + { + final Card movedCreature[] = new Card[1]; + + final CommandReturn getCreature = new CommandReturn() + { + public Object execute() + { + //get all creatures + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list.addAll(AllZone.Computer_Play.getCards()); + list = list.filter(new CardListFilter(){ + public boolean addCard(Card c) { + return c.isCreature() && CardFactoryUtil.canTarget(card,c); + } + }); + + //remove "this card" + list.remove(card); + + return list; + } + };//CommandReturn + + + final SpellAbility comesAbility = new Ability(card,"0") + { + public void resolve() + { + //super.resolve(); + + Card c = getTargetCard(); + movedCreature[0] = c; + + if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c) ) + { + //set summoning sickness + if(c.getKeyword().contains("Haste")){ + c.setSickness(false); + } + else{ + c.setSickness(true); + } + + ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(false); + ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(false); + + c.setSickness(true); + c.setController(card.getController()); + + PlayerZone from = AllZone.getZone(c); + from.remove(c); + + PlayerZone to = AllZone.getZone(Constant.Zone.Play, card.getController()); + to.add(c); + + ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(true); + ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(true); + } + }//resolve() + };//SpellAbility + + final Input inputComes = new Input() + { + private static final long serialVersionUID = -8449238833091942579L; + + public void showMessage() + { + CardList choice = (CardList)getCreature.execute(); + + stopSetNext(CardFactoryUtil.input_targetSpecific(comesAbility, choice, "Select target creature to gain control of: ", true, false)); + ButtonUtil.disableAll();//to disable the Cancel button + } + }; + + final Command commandCIP = new Command() + { + private static final long serialVersionUID = -5675532512302863456L; + + public void execute() + { + CardList creature = (CardList)getCreature.execute(); + String s = card.getController(); + if(creature.size() == 0) + return; + else if(s.equals(Constant.Player.Human)) + AllZone.InputControl.setInput(inputComes); + else //computer + { + Card target; + //try to target human creature + CardList human = CardFactoryUtil.AI_getHumanCreature(card, true); + target = CardFactoryUtil.AI_getBestCreature(human);//returns null if list is empty + + if(target == null) + { + //must target computer creature + CardList computer = new CardList(AllZone.Computer_Play.getCards()); + computer = computer.getType("Creature"); + computer.remove(card); + + computer.shuffle(); + if (computer.size()!= 0) + target = computer.get(0); + } + comesAbility.setTargetCard(target); + AllZone.Stack.add(comesAbility); + }//else + }//execute() + };//CommandComes + card.addComesIntoPlayCommand(commandCIP); + card.addLeavesPlayCommand(new Command() + { + private static final long serialVersionUID = 6737424952039552060L; + + public void execute() + { + Card c = movedCreature[0]; + + if(AllZone.GameAction.isCardInPlay(c)) + { + ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(false); + ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(false); + + c.setSickness(true); + c.setController(AllZone.GameAction.getOpponent(c.getController())); + + PlayerZone from = AllZone.getZone(c); + from.remove(c); + + //make sure the creature is removed from combat: + CardList list = new CardList(AllZone.Combat.getAttackers()); + if (list.contains(c)) + AllZone.Combat.removeFromCombat(c); + + CardList pwlist = new CardList(AllZone.pwCombat.getAttackers()); + if (pwlist.contains(c)) + AllZone.pwCombat.removeFromCombat(c); + + PlayerZone to = AllZone.getZone(Constant.Zone.Play, c.getOwner()); + to.add(c); + + ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(true); + ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(true); + }//if + }//execute() + });//Command + + card.clearSpellAbility(); + card.addSpellAbility(new Spell_Permanent(card) + { + private static final long serialVersionUID = -6810781646652311270L; + + public boolean canPlay() + { + CardList choice = (CardList)getCreature.execute(); + return choice.size() > 0; + } + + public boolean canPlayAI() + { + CardList c = CardFactoryUtil.AI_getHumanCreature(card, true); + CardListUtil.sortAttack(c); + CardListUtil.sortFlying(c); + + if(c.isEmpty()) + return false; + + if(2 <= c.get(0).getNetAttack() && c.get(0).getKeyword().contains("Flying")) + { + setTargetCard(c.get(0)); + return true; + } + + CardListUtil.sortAttack(c); + if(4 <= c.get(0).getNetAttack()) + { + setTargetCard(c.get(0)); + return true; + } + + return false; + } + }); + }//*************** END ************ END ************************** + + /* //*************** START *********** START ************************** //destroy doesn't work else if(cardName.equals("Sower of Temptation")) @@ -8593,8 +8789,8 @@ public class CardFactory_Creatures { }//execute() });//Command }//*************** END ************ END ************************** - - + */ + //*************** START *********** START ************************** else if(cardName.equals("Frostling")) { @@ -18420,6 +18616,36 @@ public class CardFactory_Creatures { card.addComesIntoPlayCommand(commandComes); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if (cardName.equals("Avenger of Zendikar")) + { + final Ability ability = new Ability(card, "0") + { + public void resolve() + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList land = new CardList(play.getCards()); + land = land.getType("Land"); + for (int i=0;i