From 1bb78b923335408af51082b527059a7ac647aa95 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Fri, 14 Oct 2011 20:15:02 +0000 Subject: [PATCH] - Converted Cerebral Eruption to script. --- res/cardsfolder/c/cerebral_eruption.txt | 6 ++- .../cardFactory/CardFactory_Sorceries.java | 54 +------------------ 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/res/cardsfolder/c/cerebral_eruption.txt b/res/cardsfolder/c/cerebral_eruption.txt index f1cb6e29c97..70d1092c9ba 100644 --- a/res/cardsfolder/c/cerebral_eruption.txt +++ b/res/cardsfolder/c/cerebral_eruption.txt @@ -1,7 +1,11 @@ Name:Cerebral Eruption ManaCost:2 R R Types:Sorcery -Text:Target opponent reveals the top card of his or her library. Cerebral Eruption deals damage equal to the revealed card's converted mana cost to that player and each creature he or she controls. If a land card is revealed this way, return Cerebral Eruption to its owner's hand. +Text:no text +A:SP$ Dig | Cost$ 2 R R | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card.YouDontCtrl | DestinationZone$ Library | RememberChanged$ True | SubAbility$ DBDamage | SpellDescription$ Target opponent reveals the top card of his or her library. Cerebral Eruption deals damage equal to the revealed card's converted mana cost to that player and each creature he or she controls. If a land card is revealed this way, return Cerebral Eruption to its owner's hand. +SVar:DBDamage:DB$ DamageAll | ValidCards$ Creature.YouDontCtrl | ValidPlayers$ EachOpponent | NumDmg$ X | SubAbility$ DBReturn +SVar:DBReturn:DB$ ChangeZone | Defined$ Self | Origin$ Stack | Destination$ Hand | ConditionDefined$ Remembered | ConditionPresent$ Land | ConditionCompare$ EQ1 +SVar:X:Remembered$CardManaCost SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/cerebral_eruption.jpg SetInfo:SOM|Rare|http://magiccards.info/scans/en/som/86.jpg diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java b/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java index e345ecc592e..0c96b14fb0f 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java @@ -1960,59 +1960,7 @@ public class CardFactory_Sorceries { }// *************** END ************ END ************************** - //*************** START *********** START ************************** - else if (cardName.equals("Cerebral Eruption")) { - /* - * Target opponent reveals the top card of his or her library. - * Cerebral Eruption deals damage equal to the revealed card's - * converted mana cost to that player and each creature he or - * she controls. If a land card is revealed this way, return - * Cerebral Eruption to its owner's hand. - */ - SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = -1365692178841929046L; - - @Override - public void resolve() { - Player player = card.getController(); - Player opponent = player.getOpponent(); - CardList lib = opponent.getCardsIn(Zone.Library); - if (lib.size() > 0) { - final Card topCard = lib.get(0); - int damage = CardUtil.getConvertedManaCost(topCard); - - GuiUtils.getChoiceOptional(card + " - Revealed card", new Card[]{topCard}); - - //deal damage to player - opponent.addDamage(damage, card); - - //deal damage to all opponent's creatures - CardList creatures = AllZoneUtil.getCreaturesInPlay(opponent); - for (Card creature : creatures) { - creature.addDamage(damage, card); - } - - card.addReplaceMoveToGraveyardCommand(new Command() { - private static final long serialVersionUID = -5912663572746146726L; - - public void execute() { - if (null != topCard && topCard.isLand()) { - AllZone.getGameAction().moveToHand(card); - } else AllZone.getGameAction().moveToGraveyard(card); - } - }); - } - }// resolve() - - @Override - public boolean canPlayAI() { - return !AllZone.getHumanPlayer().getZone(Zone.Library).isEmpty(); - } - - };// SpellAbility - card.addSpellAbility(spell); - }// *************** END ************ END ************************** - + //*************** START *********** START ************************** else if (cardName.equals("Sanity Grinding")) {