From 2ea31149fb41a9039a4503bb819efc10a81fc3a5 Mon Sep 17 00:00:00 2001 From: melvin Date: Sun, 26 May 2013 10:31:51 +0800 Subject: [PATCH] convert from java code to groovy code --- .../Magarena/scripts/Mind_Peel.groovy | 31 +++++-------------- release/Magarena/scripts/Mind_Peel.txt | 2 +- 2 files changed, 8 insertions(+), 25 deletions(-) rename src/magic/card/Mind_Peel.java => release/Magarena/scripts/Mind_Peel.groovy (54%) diff --git a/src/magic/card/Mind_Peel.java b/release/Magarena/scripts/Mind_Peel.groovy similarity index 54% rename from src/magic/card/Mind_Peel.java rename to release/Magarena/scripts/Mind_Peel.groovy index 4192e62307..54e62a6ebf 100644 --- a/src/magic/card/Mind_Peel.java +++ b/release/Magarena/scripts/Mind_Peel.groovy @@ -1,21 +1,5 @@ -package magic.card; - -import magic.model.MagicGame; -import magic.model.MagicLocationType; -import magic.model.MagicManaCost; -import magic.model.MagicPayedCost; -import magic.model.MagicPlayer; -import magic.model.action.MagicChangeCardDestinationAction; -import magic.model.action.MagicPlayerAction; -import magic.model.choice.MagicBuybackChoice; -import magic.model.choice.MagicTargetChoice; -import magic.model.event.MagicDiscardEvent; -import magic.model.event.MagicEvent; -import magic.model.event.MagicSpellCardEvent; -import magic.model.stack.MagicCardOnStack; - -public class Mind_Peel { - public static final MagicSpellCardEvent E = new MagicSpellCardEvent() { +[ + new MagicSpellCardEvent() { @Override public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { return new MagicEvent( @@ -26,13 +10,12 @@ public class Mind_Peel { ), this, "Target player$ discards a card. " + - "If the buyback cost was payed$, return SN to its owner's hand as it resolves."); + "If the buyback cost was payed$, return SN to its owner's hand as it resolves." + ); } @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { + public void executeEvent(final MagicGame game, final MagicEvent event) { event.processTargetPlayer(game,new MagicPlayerAction() { public void doAction(final MagicPlayer player) { game.addEvent(new MagicDiscardEvent(event.getSource(),player,1,false)); @@ -42,5 +25,5 @@ public class Mind_Peel { } }); } - }; -} + } +] diff --git a/release/Magarena/scripts/Mind_Peel.txt b/release/Magarena/scripts/Mind_Peel.txt index 982b73a0d1..103efcacef 100644 --- a/release/Magarena/scripts/Mind_Peel.txt +++ b/release/Magarena/scripts/Mind_Peel.txt @@ -6,4 +6,4 @@ rarity=U type=Sorcery cost={B} timing=removal -requires_card_code +requires_groovy_code