From d8a7ceea133fba340bdf733ace690998f1e264ba Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:50:48 +0000 Subject: [PATCH] Added Momentous Fall. --- res/card-pictures.txt | 1 + res/cards.txt | 5 ++++ src/forge/CardFactory.java | 59 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index af29f51f77e..9c527796039 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 +momentous_fall.jpg http://www.wizards.com/global/images/magic/general/momentous_fall.jpg hammer_of_bogardan.jpg http://www.wizards.com/global/images/magic/general/hammer_of_bogardan.jpg doomsday.jpg http://www.wizards.com/global/images/magic/general/doomsday.jpg eternal_dragon.jpg http://www.wizards.com/global/images/magic/general/eternal_dragon.jpg diff --git a/res/cards.txt b/res/cards.txt index 459e7807200..59423fbfcef 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Momentous Fall +2 G G +Instant +As an additional cost to cast Momentous Fall, sacrifice a creature. You draw cards equal to the sacrificed creature's power, then you gain life equal to its toughness. + Hammer of Bogardan 1 R R Sorcery diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 87bb00dd6fa..fda883c0243 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -13024,6 +13024,65 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Momentous Fall")) { + final SpellAbility spell = new Spell(card) { + + private static final long serialVersionUID = -56339412409L; + + + @Override + public void resolve() { + Card Sacrificed = getTargetCard(); + if(Sacrificed != null) { + for(int i = 0; i < Sacrificed.getNetAttack(); i++) { + AllZone.GameAction.drawCard(card.getController()); + } + PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController()); + life.addLife(Sacrificed.getNetDefense()); + } + } + + + @Override + public boolean canPlay() { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList Creatures = new CardList(play.getCards()); + Creatures = Creatures.getType("Creature"); + return Creatures.size() > 0 && super.canPlay(); + } + @Override + public boolean canPlayAI() { + return false; + } + }; + Input target = new Input() { + + private static final long serialVersionUID = 42466124531655L; + + @Override + public void showMessage() { + AllZone.Display.showMessage("Select a creature to sacrifice"); + ButtonUtil.enableOnlyCancel(); + } + + + @Override + public void selectCard(Card c, PlayerZone zone) { + PlayerZone Play = AllZone.getZone(Constant.Zone.Play, card.getController()); + if(AllZone.GameAction.isCardInZone(c, Play) && c.isCreature() == true) { + spell.setTargetCard(c); + AllZone.GameAction.sacrifice(c); + AllZone.Stack.add(spell); + stopSetNext(new ComputerAI_StackNotEmpty()); + } + }//selectCard() + };//Input + card.clearSpellAbility(); + card.addSpellAbility(spell); + spell.setAfterPayMana(target); + }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Culling Sun")) { SpellAbility spell = new Spell(card) {