diff --git a/res/cards.txt b/res/cards.txt index 9385a10785a..937be01c598 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,14 @@ +Academy Rector +3 W +Creature Human Cleric +When Academy Rector is put into a graveyard from the battlefield, you may exile it. If you do, search your library for an enchantment card and put that card onto the battlefield. Then shuffle your library. +1/2 + +Kaervek's Spite +B B B +Instant +As an additional cost to cast Kaervek's Spite, sacrifice all permanents you control and discard your hand. Target player loses 5 life. + Sea Monster 4 U U Creature Serpent diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index c43dbe9b6fb..99dfcf0fcf6 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -219,7 +219,7 @@ 252 0 - 926 + 911 827 @@ -230,7 +230,7 @@ 252 0 - 926 + 911 163 @@ -251,7 +251,7 @@ 252 163 - 926 + 911 10 @@ -266,7 +266,7 @@ 252 173 - 926 + 911 166 @@ -287,7 +287,7 @@ 252 339 - 926 + 911 10 @@ -302,7 +302,7 @@ 252 349 - 926 + 911 140 @@ -323,7 +323,7 @@ 252 489 - 926 + 911 10 @@ -338,7 +338,7 @@ 252 499 - 926 + 911 150 @@ -359,7 +359,7 @@ 252 649 - 926 + 911 10 @@ -374,7 +374,7 @@ 252 659 - 926 + 911 168 @@ -408,7 +408,7 @@ - 1178 + 1163 0 10 827 @@ -423,9 +423,9 @@ - 1188 + 1173 0 - 252 + 267 827 @@ -434,9 +434,9 @@ - 1188 + 1173 0 - 252 + 267 424 @@ -455,9 +455,9 @@ - 1188 + 1173 424 - 252 + 267 10 @@ -470,9 +470,9 @@ - 1188 + 1173 434 - 252 + 267 393 diff --git a/res/main.properties b/res/main.properties index b09f76662da..596ee639cb6 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: 89 +program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 90 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 5a4586ebcbb..0936add3383 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -16878,6 +16878,87 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Kaervek's Spite")) + { + final SpellAbility spell = new Spell(card) + { + private static final long serialVersionUID = -6259614160639535500L; + + public boolean canPlayAI() + { + if(AllZone.Human_Life.getLife() <= 5) + return true; + PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer); + + CardList playList = new CardList(play.getCards()); + CardList libList = new CardList(lib.getCards()); + + playList = playList.getName("Academy Rector"); + libList = libList.getName("Barren Glory"); + + return (AllZone.Human_Life.getLife() <= 5) || (playList.size() == 1 && libList.size() >= 1); + } + + public void resolve() + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + PlayerZone hand = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList list = new CardList(play.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return !c.getName().equals("Mana Pool"); + } + }); + CardList handList = new CardList(hand.getCards()); + + for (Card c : list) + { + AllZone.GameAction.sacrifice(c); + } + AllZone.GameAction.discardRandom(card.getController(), handList.size()); + + PlayerLife life = AllZone.GameAction.getPlayerLife(getTargetPlayer()); + life.subtractLife(5); + } + }; + spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman()); + card.clearSpellAbility(); + card.addSpellAbility(spell); + + /* + final Command sac = new Command(){ + private static final long serialVersionUID = 1643946454479782123L; + + public void execute() { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + PlayerZone hand = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList list = new CardList(play.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return !c.getName().equals("Mana Pool"); + } + }); + CardList handList = new CardList(hand.getCards()); + + for (Card c : list) + { + AllZone.GameAction.sacrifice(c); + } + AllZone.GameAction.discardRandom(card.getController(), handList.size()); + } + + }; + */ + + spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); + }//*************** END ************ END ************************** + + + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if (hasKeyword(card, "Cycling") != -1) diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 58ad1a884f3..3c45c440319 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1444,6 +1444,35 @@ public class CardFactoryUtil }; return target; }//input_targetPlayer() + + public static Input input_targetPlayer(final SpellAbility spell, final Command command) + { + Input target = new Input() + { + private static final long serialVersionUID = 8736682807625129068L; + + public void showMessage() + { + AllZone.Display.showMessage("Select target player"); + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() {stop();} + public void selectPlayer(String player) + { + command.execute(); + + spell.setTargetPlayer(player); + if(spell.getManaCost().equals("0")) + { + AllZone.Stack.add(spell); + stop(); + } + else + stopSetNext(new Input_PayManaCost(spell)); + } + }; + return target; + }//input_targetPlayer() public static CardList AI_getHumanCreature(final Card spell, boolean targeted) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 4fcf548b441..397ae5799fc 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -1420,7 +1420,7 @@ public class CardFactory_Creatures { }//*************** END ************ END ************************** //*************** START *********** START ************************** - else if(cardName.equals("Loxodon Hierarch")) + if(cardName.equals("Loxodon Hierarch")) { final Ability ability = new Ability(card, "G W") { @@ -16085,6 +16085,74 @@ public class CardFactory_Creatures { a1.setDescription("1 U: Return Fleeting Image to its owner's hand."); }//*************** END ************ END ************************** + + else if (cardName.equals("Academy Rector")) + { + final Command destroy = new Command() + { + private static final long serialVersionUID = -4352349741511065318L; + + public void execute() { + if (card.getController().equals("Human")) + { + String[] choices = { "Yes", "No" }; + Object q = null; + + q = AllZone.Display.getChoiceOptional("Exile " + card.getName() + "?", choices); + + if (q == null || q.equals("No")) + ; + else + { + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Human); + CardList list = new CardList(lib.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return c.isEnchantment(); + } + }); + + if (list.size() > 0) + { + Object o = AllZone.Display.getChoiceOptional("Choose enchantment card to put onto the battlefield", list.toArray()); + if (o != null) + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + Card c = (Card)o; + lib.remove(c); + play.add(c); + } + } + AllZone.GameAction.removeFromGame(card); + } + }//if human + else + { + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer); + CardList list = new CardList(lib.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return c.isEnchantment() && !c.isAura(); + } + }); + + if (list.size() > 0) + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + Card c = CardFactoryUtil.AI_getBestEnchantment(list, card, false); + lib.remove(c); + play.add(c); + AllZone.GameAction.removeFromGame(card); + + } + } + } + }; + + card.addDestroyCommand(destroy); + } // Cards with Cycling abilities diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 367ecb0c65b..a2c667c97d6 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -3951,6 +3951,12 @@ public class GameActionUtil CardList list = new CardList(playZone.getCards()); CardList playList = new CardList(playZone.getCards()); + playList = playList.filter(new CardListFilter() + { + public boolean addCard(Card c) { + return !c.getName().equals("Mana Pool"); + } + }); list = list.getName("Barren Glory");