From 6c64552fc09f0e5c6072d3fac1282fd62539119e Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:25:17 +0000 Subject: [PATCH] 1) Made similar repairs to Assembly-Worker. 2) Added another LQ pic url. --- res/card-pictures.txt | 1 + src/forge/CardFactory_Creatures.java | 52 +++++++++++++++++++++++----- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index d00c3f50e64..0c613332c7a 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 +wanderlust.jpg http://www.wizards.com/global/images/magic/general/wanderlust.jpg moonglove_extract.jpg http://www.wizards.com/global/images/magic/general/moonglove_extract.jpg artisan_of_kozilek.jpg http://www.wizards.com/global/images/magic/general/artisan_of_kozilek.jpg emrakul_the_aeons_torn.jpg http://www.wizards.com/global/images/magic/general/emrakul_the_aeons_torn.jpg diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 711ee8e36f7..b37e7c28505 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -15899,17 +15899,27 @@ public class CardFactory_Creatures { setTargetCard(getAttacker()); } + /* + * getAttacker() will now filter out non-Assembly-Worker and non-Changelings + */ + public Card getAttacker() { //target creature that is going to attack - Combat c = ComputerUtil.getAttackers(); - CardList att = new CardList(c.getAttackers()); - att = att.getType("Assembly-Worker"); // Should return only Assembly-Workers - att.remove(card); - att.shuffle(); + Combat attackers = ComputerUtil.getAttackers(); + CardList list = new CardList(attackers.getAttackers()); + list = list.filter(new CardListFilter() { + public boolean addCard(Card c) { + return CardFactoryUtil.canTarget(card, c) && + (c.getType().contains("Assembly-Worker") || c.getKeyword().contains("Changeling")); + } + }); +// list = list.getType("Assembly-Worker"); // Should return only Assembly-Workers + list.remove(card); + list.shuffle(); - if (att.size() != 0 && + if (list.size() != 0 && (AllZone.Phase.getPhase().equals(Constant.Phase.Main1)) && - CardFactoryUtil.canTarget(card, att.get(0))) return att.get(0); + CardFactoryUtil.canTarget(card, list.get(0))) return list.get(0); else return null; }//getAttacker() @@ -15961,7 +15971,33 @@ public class CardFactory_Creatures { } };//Input target */ - a2[0].setBeforePayMana(CardFactoryUtil.input_targetType(a2[0], "Assembly-Worker")); + + /* + * This input method will allow the human to select both Assembly-Workers and Changelings + */ + Input runtime = new Input() { + private static final long serialVersionUID = -2520339470741575052L; + + @Override + public void showMessage() { + PlayerZone comp = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + PlayerZone hum = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + CardList creatures = new CardList(); + creatures.addAll(comp.getCards()); + creatures.addAll(hum.getCards()); + creatures = creatures.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature() && CardFactoryUtil.canTarget(card, c) && + (c.getType().contains("Assembly-Worker") || c.getKeyword().contains("Changeling")); + } + }); + + stopSetNext(CardFactoryUtil.input_targetSpecific(a2[0], creatures, "Select target Assembly-Worker", true, false)); + } + };//Input target + a2[0].setBeforePayMana(runtime); + +// a2[0].setBeforePayMana(CardFactoryUtil.input_targetType(a2[0], "Assembly-Worker")); }//*************** END ************ END **************************