From d226caad3963de464947ece05d0da5a1eff86351 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:12:12 +0000 Subject: [PATCH] add All is Dust from Rise of the Eldrazi --- res/card-pictures.txt | 1 + res/cards.txt | 5 +++++ src/forge/CardFactory.java | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index c723f9934d1..f1a3b11f33a 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 +all_is_dust.jpg http://www.wizards.com/global/images/magic/general/all_is_dust.jpg tranquil_path.jpg http://www.wizards.com/global/images/magic/general/tranquil_path.jpg buried_alive.jpg http://www.wizards.com/global/images/magic/general/buried_alive.jpg ulamog_the_infinite_gyre.jpg http://www.wizards.com/global/images/magic/general/ulamog_the_infinite_gyre.jpg diff --git a/res/cards.txt b/res/cards.txt index 2f85101a706..e7f7b92fb27 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +All is Dust +7 +Tribal Sorcery Eldrazi +Each player sacrifices all colored permanents he or she controls. + Tranquil Path 4 G Sorcery diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index b9893846257..e8e18352110 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -18861,6 +18861,51 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("All is Dust")) { + /* + * Each player sacrifices all colored permanents he or she controls. + */ + SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = -8228522411909468245L; + + @Override + public void resolve() { + CardList all = AllZoneUtil.getCardsInPlay(); + all = all.filter(colorless); + + CardListUtil.sortByIndestructible(all); + CardListUtil.sortByDestroyEffect(all); + + for(Card c: all) { + AllZone.GameAction.sacrifice(c); + } + }// resolve() + + @Override + public boolean canPlayAI() { + //same basic AI as Wrath of God, Damnation, Consume the Meek, etc. + CardList human = AllZoneUtil.getPlayerCardsInPlay(Constant.Player.Human); + human = human.filter(colorless); + CardList computer = AllZoneUtil.getPlayerCardsInPlay(Constant.Player.Computer); + computer = computer.filter(colorless); + + // the computer will at least destroy 2 more human permanents + return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) && + (computer.size() < human.size() - 1 + || (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty())); + } + + private CardListFilter colorless = new CardListFilter() { + public boolean addCard(Card c) { + return !CardUtil.getColors(c).contains(Constant.Color.Colorless) && !c.getName().equals("Mana Pool"); + } + }; + };// SpellAbility + card.clearSpellAbility(); + card.addSpellAbility(spell); + }// *************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {