From 9ba9b331268575a65834e181a64dd16ad6fd2f5f Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:50:22 +0000 Subject: [PATCH] - Fixed Rebel/Merc fetch, can only get permanents now. - Added the rest of the Harbingers. - Added Meekstone and Qasali Pridemage. --- res/cards.txt | 32 +++ res/gui/display_layout.xml | 78 ++++---- res/main.properties | 2 +- src/forge/CardFactoryUtil.java | 15 +- src/forge/CardFactory_Creatures.java | 252 ++++++++++++++++++++++++ src/forge/Input_Untap.java | 12 +- src/forge/PlayerZone_ComesIntoPlay.java | 2 + 7 files changed, 348 insertions(+), 45 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 74f4b7b08ff..cc049cbe901 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,35 @@ +Qasali Pridemage +G W +Creature Cat Wizard +no text +2/2 +Exalted + +Meekstone +1 +Artifact +Creatures with power 3 or greater don't untap during their controllers' untap steps. + +Giant Harbinger +4 R +Creature Giant +When Giant Harbinger enters the battlefield, you may search your library for a Giant card, reveal it, then shuffle your library and put that card on top of it. +3/4 + +Flamekin Harbinger +R +Creature Elemental Shaman +When Flamekin Harbinger enters the battlefield, you may search your library for an Elemental card, reveal it, then shuffle your library and put that card on top of it. +1/1 + +Faerie Harbinger +3 U +Creature Faerie Wizard +When Faerie Harbinger enters the battlefield, you may search your library for a Faerie card, reveal it, then shuffle your library and put that card on top of it. +2/2 +Flying +Flash + Sword of the Meek 2 Artifact Equipment diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index 99dfcf0fcf6..6e437ee922b 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -16,7 +16,7 @@ 0 0 - 242 + 244 827 @@ -27,8 +27,8 @@ 0 0 - 242 - 145 + 244 + 144 @@ -47,8 +47,8 @@ 0 - 145 - 242 + 144 + 244 10 @@ -62,9 +62,9 @@ 0 - 155 - 242 - 174 + 154 + 244 + 175 @@ -84,7 +84,7 @@ 0 329 - 242 + 244 10 @@ -99,7 +99,7 @@ 0 339 - 242 + 244 115 @@ -120,7 +120,7 @@ 0 454 - 242 + 244 10 @@ -135,7 +135,7 @@ 0 464 - 242 + 244 107 @@ -156,7 +156,7 @@ 0 571 - 242 + 244 10 @@ -171,7 +171,7 @@ 0 581 - 242 + 244 246 @@ -202,7 +202,7 @@ - 242 + 244 0 10 827 @@ -217,9 +217,9 @@ - 252 + 254 0 - 911 + 909 827 @@ -228,9 +228,9 @@ - 252 + 254 0 - 911 + 909 163 @@ -249,9 +249,9 @@ - 252 + 254 163 - 911 + 909 10 @@ -264,9 +264,9 @@ - 252 + 254 173 - 911 + 909 166 @@ -285,9 +285,9 @@ - 252 + 254 339 - 911 + 909 10 @@ -300,10 +300,10 @@ - 252 + 254 349 - 911 - 140 + 909 + 142 @@ -321,9 +321,9 @@ - 252 - 489 - 911 + 254 + 491 + 909 10 @@ -336,10 +336,10 @@ - 252 - 499 - 911 - 150 + 254 + 501 + 909 + 148 @@ -357,9 +357,9 @@ - 252 + 254 649 - 911 + 909 10 @@ -372,9 +372,9 @@ - 252 + 254 659 - 911 + 909 168 diff --git a/res/main.properties b/res/main.properties index dac3377f142..6f6922c0196 100644 --- a/res/main.properties +++ b/res/main.properties @@ -1,6 +1,6 @@ program/mail=mtgerror@yahoo.com program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 -program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 95 +program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 96 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 2d9ca69f2ae..d9c000d45e2 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -973,7 +973,13 @@ public class CardFactoryUtil PlayerZone lib = AllZone.getZone(Constant.Zone.Library, sourceCard.getController()); CardList mercs = new CardList(); CardList list = new CardList(lib.getCards()); - list = list.getType("Mercenary"); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return (c.getType().contains("Mercenary") || c.getKeyword().contains("Changeling")) && c.isPermanent() ; + } + }); + if (list.size()==0) return false; @@ -1071,7 +1077,12 @@ public class CardFactoryUtil CardList rebels = new CardList(); CardList list = new CardList(lib.getCards()); - list = list.getType("Rebel"); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return (c.getType().contains("Rebel") || c.getKeyword().contains("Changeling")) && c.isPermanent() ; + } + }); if (list.size()==0) return false; diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index f6264da535e..704bcb60cd5 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -16333,6 +16333,258 @@ public class CardFactory_Creatures { card.addComesIntoPlayCommand(intoPlay); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Faerie Harbinger")) + { + final SpellAbility ability = new Ability(card, "0") + { + public void resolve() + { + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController()); + if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) + { + Card c = getTargetCard(); + AllZone.GameAction.shuffle(card.getController()); + lib.remove(c); + lib.add(c, 0); + + + } + }//resolve() + }; + Command intoPlay = new Command() + { + + private static final long serialVersionUID = -708639335039567945L; + + public void execute() + { + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController()); + CardList cards = new CardList(lib.getCards()); + CardList faeries = new CardList(); + + for (int i=0;i= 4; + } + }); + + if (list.size() > 0) + { + list.shuffle(); + setTargetCard(list.get(0)); + } + + return list.size() > 0; + } + + + }; + ability.setDescription("1, Sacrifice Qasali Pridemage: Destroy target artifact or enchantment."); + ability.setBeforePayMana(new Input() + { + private static final long serialVersionUID = -3565024591921095303L; + + public void showMessage() + { + PlayerZone hPlay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + PlayerZone cPlay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + + CardList list = new CardList(); + list.addAll(hPlay.getCards()); + list.addAll(cPlay.getCards()); + + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return c.isArtifact() || c.isEnchantment(); + } + }); + + stopSetNext(CardFactoryUtil.input_targetSpecific(ability, list, "Select an Artifact or Enchantment", true)); + } + }); + card.addSpellAbility(ability); + }//*************** END ************ END ************************** // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/Input_Untap.java b/src/forge/Input_Untap.java index 1f579b74be5..209ba3e48a6 100644 --- a/src/forge/Input_Untap.java +++ b/src/forge/Input_Untap.java @@ -34,13 +34,19 @@ public class Input_Untap extends Input if(c[i].getNetAttack() < 3) c[i].untap(); } - private boolean isMarbleTitanInPlay() + private boolean isMarbleTitanInPlay() //or Meekstone { CardList all = new CardList(); all.addAll(AllZone.Human_Play.getCards()); all.addAll(AllZone.Computer_Play.getCards()); - - all = all.getName("Marble Titan"); + + all = all.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return c.getName().equals("Meekstone") || c.getName().equals("Marble Titan"); + } + }); + return all.size() > 0; } private void regularUntap() diff --git a/src/forge/PlayerZone_ComesIntoPlay.java b/src/forge/PlayerZone_ComesIntoPlay.java index 09e46cafa4e..30607fe236e 100644 --- a/src/forge/PlayerZone_ComesIntoPlay.java +++ b/src/forge/PlayerZone_ComesIntoPlay.java @@ -112,6 +112,8 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); CardList meek = new CardList(grave.getCards()); + meek = meek.getName("Sword of the Meek"); + if (meek.size() > 0 && c.isCreature() && c.getNetAttack() == 1 && c.getNetDefense() == 1) { for (int i=0;i