diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 317c7d2fdd6..24b7bf4be6b 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 +fabricate.jpg http://www.wizards.com/global/images/magic/general/fabricate.jpg disorient.jpg http://www.wizards.com/global/images/magic/general/disorient.jpg feldons_cane.jpg http://www.wizards.com/global/images/magic/general/feldons_cane.jpg mirror_sigil_sergeant.jpg http://www.wizards.com/global/images/magic/general/mirror_sigil_sergeant.jpg diff --git a/res/cards.txt b/res/cards.txt index 91a2d3757d0..17e23df6d8a 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Fabricate +2 U +Sorcery +Search your library for an artifact card, reveal it, and put it into your hand. Then shuffle your library. + Disorient 3 U Instant diff --git a/src/forge/AllZoneUtil.java b/src/forge/AllZoneUtil.java index 049d1fc3920..ad9eb56748e 100644 --- a/src/forge/AllZoneUtil.java +++ b/src/forge/AllZoneUtil.java @@ -278,4 +278,10 @@ public class AllZoneUtil { return cards; } + ////////////// cardListFilter for different types + public static CardListFilter artifacts = new CardListFilter() { + public boolean addCard(Card c) { + return c.isArtifact(); + } + }; } \ No newline at end of file diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 3964c278595..3851cb9f42c 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -19139,6 +19139,62 @@ public class CardFactory implements NewConstants { card.addSpellAbility(ability); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Fabricate")) { + SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = 5274602734116058876L; + + @Override + public boolean canPlayAI() { + return 4 < AllZone.Phase.getTurn(); + } + + @Override + public void resolve() { + String player = card.getController(); + if(player.equals(Constant.Player.Human)) humanResolve(); + else computerResolve(); + + } + + public void computerResolve() { + CardList list = AllZoneUtil.getPlayerCardsInLibrary(Constant.Player.Computer); + list = list.filter(AllZoneUtil.artifacts); + + if(list.size() != 0) { + //comp will just grab the first one it finds + Card c = list.get(0); + AllZone.GameAction.shuffle(card.getController()); + //move to hand + AllZone.Computer_Library.remove(c); + AllZone.Computer_Hand.add(c); + + CardList l = new CardList(); + l.add(c); + AllZone.Display.getChoiceOptional("Computer picked:", l.toArray()); + } + }//computerResolve() + + public void humanResolve() { + CardList list = AllZoneUtil.getPlayerCardsInLibrary(Constant.Player.Human); + list = list.filter(AllZoneUtil.artifacts); + + if(list.size() != 0) { + Object o = AllZone.Display.getChoiceOptional("Select an artifact", list.toArray()); + + AllZone.GameAction.shuffle(card.getController()); + if(o != null) { + //put card in hand + AllZone.Human_Library.remove(o); + AllZone.Human_Hand.add((Card) o); + } + }//if + }//resolve() + }; + card.clearSpellAbility(); + card.addSpellAbility(spell); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {