From c9e0595b49b40af5ba8e0431211dedfc5d91ec5f Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:37:17 +0000 Subject: [PATCH] 1) Added Beached As' Stitch Together code and LQ pic url. 2) Fixed the caps problem with the LQ pic url for Symbiotic Wurm. --- res/card-pictures.txt | 3 +- res/cards.txt | 5 ++ src/forge/CardFactory.java | 96 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 58c485d7e2c..e2d8487cdf0 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,7 +38,8 @@ 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 -Symbiotic_Wurm.jpg http://www.wizards.com/global/images/magic/general/Symbiotic_Wurm.jpg +stitch_together.jpg http://www.wizards.com/global/images/magic/general/stitch_together.jpg +symbiotic_wurm.jpg http://www.wizards.com/global/images/magic/general/symbiotic_wurm.jpg windfall.jpg http://www.wizards.com/global/images/magic/general/windfall.jpg oath_of_druids.jpg http://www.wizards.com/global/images/magic/general/oath_of_druids.jpg forbidden_orchard.jpg http://www.wizards.com/global/images/magic/general/forbidden_orchard.jpg diff --git a/res/cards.txt b/res/cards.txt index e944449b8a7..3674772aa88 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Stitch Together +B B +Sorcery +Return target creature card from your graveyard to your hand. Threshold - Return that card from your graveyard to the battlefield instead if seven or more cards are in your graveyard. + Symbiotic Wurm 5 G G G Creature Wurm diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index ac6b2ec819e..527e2331257 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -19958,6 +19958,102 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Stitch Together")) { + final SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = -57996914115026814L; + + @Override + public void resolve() { + CardList threshold = new CardList(); + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + threshold.addAll(grave.getCards()); + Card c = getTargetCard(); + + if(threshold.size() >= 7) { + if(AllZone.GameAction.isCardInZone(c, grave)) { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + AllZone.GameAction.moveTo(play, c); + } + } + + else { + if(AllZone.GameAction.isCardInZone(c, grave)) { + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); + AllZone.GameAction.moveTo(hand, c); + } + } + }//resolve() + + @Override + public boolean canPlay() { + return getCreatures().length != 0; + } + + public boolean canPlayAI() { + CardList check = new CardList(); + PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + check.addAll(zone.getCards()); + return getCreaturesAI().length != 0 || check.size() >= 7; + } + + public Card[] getCreatures() { + CardList creature = new CardList(); + PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + creature.addAll(zone.getCards()); + creature = creature.getType("Creature"); + return creature.toArray(); + } + + public Card[] getCreaturesAI() { + CardList creature = new CardList(); + PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + creature.addAll(zone.getCards()); + creature = creature.getType("Creature"); + creature = creature.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.getNetAttack() > 4; + } + }); + return creature.toArray(); + } + + @Override + public void chooseTargetAI() { + Card c[] = getCreatures(); + Card biggest = c[0]; + for(int i = 0; i < c.length; i++) + if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i]; + + setTargetCard(biggest); + } + };//SpellAbility + card.clearSpellAbility(); + card.addSpellAbility(spell); + + Input target = new Input() { + private static final long serialVersionUID = -3717723884199321767L; + + @Override + public void showMessage() { + Object check = AllZone.Display.getChoiceOptional("Select creature", getCreatures()); + if(check != null) { + spell.setTargetCard((Card) check); + stopSetNext(new Input_PayManaCost(spell)); + } else stop(); + }//showMessage() + + public Card[] getCreatures() { + CardList creature = new CardList(); + PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + creature.addAll(zone.getCards()); + creature = creature.getType("Creature"); + return creature.toArray(); + } + };//Input + spell.setBeforePayMana(target); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found