From 4bdba2b07f22890312d22b84629b359f33b68c26 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:50:47 +0000 Subject: [PATCH] Celestial Purge added. --- res/cards.txt | 5 +++ res/main.properties | 2 +- src/forge/CardFactory.java | 83 +++++++++++++++++++++++++++++++++++++- 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 13001e4f7c6..055f353ef4f 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Celestial Purge +1 W +Instant +Exile target black or red permanent. + Ajani Vengeant 2 R W Planeswalker - Ajani diff --git a/res/main.properties b/res/main.properties index 16edd6687bc..5e157468d30 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: 98 +program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 99 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 08e21e06316..23a0b2686d5 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17062,7 +17062,88 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); card.clearSpellAbility(); card.addSpellAbility(spell); }//*************** END ************ END ************************** - + if (cardName.equals("Celestial Purge")) + { + final Spell spell = new Spell(card) + { + /** + * + */ + private static final long serialVersionUID = 2626237206744317044L; + + public void resolve() + { + Card c = getTargetCard(); + + if (AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) + { + AllZone.GameAction.removeFromGame(c); + } + } + + public void chooseTargetAI() + { + PlayerZone hplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + CardList human = new CardList(hplay.getCards()); + human = human.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return CardFactoryUtil.canTarget(card, c) + && (CardUtil.getColors(c).contains(Constant.Color.Black) + || CardUtil.getColors(c).contains(Constant.Color.Red)); + } + }); + + if (human.size() != 0) + { + setTargetCard(CardFactoryUtil.AI_getMostExpensivePermanent(human, card, true)); + } + } + + public boolean canPlayAI() + { + PlayerZone hplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + CardList human = new CardList(hplay.getCards()); + human = human.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return CardFactoryUtil.canTarget(card, c) + && (CardUtil.getColors(c).contains(Constant.Color.Black) + || CardUtil.getColors(c).contains(Constant.Color.Red)); + } + }); + return human.size() > 0; + } + + };//ability + + Input target = new Input() + { + private static final long serialVersionUID = -7279903055386088569L; + public void showMessage() + { + AllZone.Display.showMessage("Select target black or red permanent for " + card); + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() {stop();} + public void selectCard(Card crd, PlayerZone zone) + { + if(zone.is(Constant.Zone.Play) && CardFactoryUtil.canTarget(card, crd) + && (CardUtil.getColors(crd).contains(Constant.Color.Black) + || CardUtil.getColors(crd).contains(Constant.Color.Red))) + { + spell.setTargetCard(crd); + stopSetNext(new Input_PayManaCost(spell)); + } + } + };//Input + spell.setBeforePayMana(target); + card.clearSpellAbility(); + card.addSpellAbility(spell); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if (hasKeyword(card, "Cycling") != -1)