From 3d36924bb5b45679868a1fb560b1e1388ef354cb Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:35:33 +0000 Subject: [PATCH] Added Windstorm and it's LQ pic url. --- res/card-pictures.txt | 1 + res/cards.txt | 5 ++++ src/forge/CardFactory.java | 55 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index ccf7a3d0f63..93e096fbcac 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 +windstorm.jpg http://www.wizards.com/global/images/magic/general/windstorm.jpg lightkeeper_of_emeria.jpg http://www.wizards.com/global/images/magic/general/lightkeeper_of_emeria.jpg bloodcurdling_scream.jpg http://www.wizards.com/global/images/magic/general/bloodcurdling_scream.jpg enrage.jpg http://www.wizards.com/global/images/magic/general/enrage.jpg diff --git a/res/cards.txt b/res/cards.txt index 864342439fc..e6e092f589c 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Windstorm +X G +Instant +no text + Lightkeeper of Emeria 3 W Creature Angel diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index e1d6b522064..b6b0f693659 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17022,6 +17022,61 @@ public class CardFactory implements NewConstants { } //*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if (cardName.equals("Windstorm")) + { + final SpellAbility spell = new Spell(card) + { + private static final long serialVersionUID = 6024081054401784073L; + public void resolve() + { + CardList all = new CardList(); + all.addAll(AllZone.Human_Play.getCards()); + all.addAll(AllZone.Computer_Play.getCards()); + all = all.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isCreature() && c.getKeyword().contains("Flying") && + CardFactoryUtil.canDamage(card, c); + } + }); + + for(int i = 0; i < all.size(); i++) + all.get(i).addDamage(card.getXManaCostPaid(), card); + + card.setXManaCostPaid(0); + } + public boolean canPlayAI() + { + final int maxX = ComputerUtil.getAvailableMana().size() - 1; + + CardListFilter filter = new CardListFilter(){ + public boolean addCard(Card c) + { + return c.isCreature() && c.getKeyword().contains("Flying") && + CardFactoryUtil.canDamage(card, c) && maxX >= (c.getNetDefense() + c.getDamage()); + } + }; + + CardList humanFliers = new CardList(AllZone.Human_Play.getCards()); + humanFliers = humanFliers.filter(filter); + + CardList compFliers = new CardList(AllZone.Computer_Play.getCards()); + compFliers = compFliers.filter(filter); + + return humanFliers.size() > (compFliers.size() + 2); + } + }; + spell.setDescription("Windstorm deals X damage to each creature with flying."); + spell.setStackDescription("Windstorm - deals X damage to each creature with flying."); + + card.clearSpellAbility(); + card.addSpellAbility(spell); + } + //*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {