diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 69a8b366cbe..fff3bc86893 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,8 @@ 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 +lavalanche.jpg http://www.wizards.com/global/images/magic/general/lavalanche.jpg +ley_druid.jpg http://www.wizards.com/global/images/magic/general/ley_druid.jpg goblin_offensive.jpg http://www.wizards.com/global/images/magic/general/goblin_offensive.jpg stream_of_life.jpg http://www.wizards.com/global/images/magic/general/stream_of_life.jpg vitalizing_cascade.jpg http://www.wizards.com/global/images/magic/general/vitalizing_cascade.jpg diff --git a/res/cards.txt b/res/cards.txt index 0ec392c6b0a..42953368985 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Lavalanche +X B R G +Sorcery +no text + Ley Druid 2 G Creature Human Druid diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 0fc35e26372..0961952fb03 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17504,6 +17504,67 @@ public class CardFactory implements NewConstants { } //*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if (cardName.equals("Lavalanche")) + { + final SpellAbility spell = new Spell(card) + { + private static final long serialVersionUID = 3571646571415945308L; + public void resolve() + { + int damage = card.getXManaCostPaid(); + + String player = getTargetPlayer(); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); + CardList list = new CardList(play.getCards()); + + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isCreature() && CardFactoryUtil.canDamage(card, c); + } + }); + + for(int i = 0; i < list.size(); i++) { + list.get(i).addDamage(card.getXManaCostPaid(), card); + } + + AllZone.GameAction.addDamage(player, damage); + card.setXManaCostPaid(0); + } + public boolean canPlayAI() + { + final int maxX = ComputerUtil.getAvailableMana().size() - 3; + + if (AllZone.Human_Life.getLife() <= maxX) + return true; + + CardListFilter filter = new CardListFilter(){ + public boolean addCard(Card c) + { + return c.isCreature() && CardFactoryUtil.canDamage(card, c) && + maxX >= (c.getNetDefense() + c.getDamage()); + } + }; + + CardList killableCreatures = new CardList(AllZone.Human_Play.getCards()); + killableCreatures = killableCreatures.filter(filter); + + return (killableCreatures.size() >= 2); // kill at least two of the human's creatures + } + }; + spell.setDescription("Lavalanche deals X damage to target player and each creature he or she controls."); + spell.setStackDescription("Lavalanche - deals X damage to target player and each creature he or she controls."); + spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman()); + spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); + + card.clearSpellAbility(); + card.addSpellAbility(spell); + } + //*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {