From e6b2b411cfa9fb6b765cd2d38ec82532064a251e Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:10:19 +0000 Subject: [PATCH] adding Consume the Meek from Rise of the Eldrazi. I swear I'd submitted this before, but I guess not. --- res/card-pictures.txt | 1 + res/cards.txt | 5 ++++ src/forge/CardFactory.java | 56 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 99bfa4fb199..a348c26cd94 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 +consume_the_meek.jpg http://www.wizards.com/global/images/magic/general/consume_the_meek.jpg awakening_zone.jpg http://www.wizards.com/global/images/magic/general/awakening_zone.jpg chromatic_star.jpg http://www.wizards.com/global/images/magic/general/chromatic_star.jpg animate_artifact.jpg http://www.wizards.com/global/images/magic/general/animate_artifact.jpg diff --git a/res/cards.txt b/res/cards.txt index ba459de9d95..18faa3bdb7a 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Consume the Meek +3 B B +Instant +Destroy each creature with converted mana cost 3 or less. They can't be regenerated. + Eldrazi Conscription 8 Enchantment Aura diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 9ad5998ca49..eb8c123663e 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -18733,6 +18733,62 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Consume the Meek")) { + /* Destroy each creature with converted mana cost 3 or less. + * They can't be regenerated. + */ + SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = 9127892501403187034L; + + @Override + public void resolve() { + CardList all = new CardList(); + all.addAll(getHumanCreatures().toArray()); + all.addAll(getComputerCreatures().toArray()); + + for(int i = 0; i < all.size(); i++) { + Card c = all.get(i); + System.out.println("Consume the Meek: " + c); + AllZone.GameAction.destroyNoRegeneration(c); + } + }// resolve() + + CardListFilter filter = new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature() && CardUtil.getConvertedManaCost(c) <= 3; + } + }; + + private CardList getHumanCreatures() { + CardList human = new CardList(); + human.addAll(AllZone.Human_Play.getCards()); + human = human.filter(filter); + return human; + } + + private CardList getComputerCreatures() { + CardList comp = new CardList(); + comp.addAll(AllZone.Computer_Play.getCards()); + comp = comp.filter(filter); + return comp; + } + + @Override + public boolean canPlayAI() { + CardList human = getHumanCreatures(); + CardList computer = getComputerCreatures(); + + // the computer will at least destroy 2 more human creatures + return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) && + (computer.size() < human.size() - 1 + || (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty())); + } + };// SpellAbility + card.clearSpellAbility(); + card.addSpellAbility(spell); + }// *************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {