From ee1ac482472e8c3d3224884778b2324345cd345e Mon Sep 17 00:00:00 2001 From: melvin Date: Wed, 13 Mar 2013 21:22:03 +0800 Subject: [PATCH] convert from java code to groovy code --- release/Magarena/scripts/Tidings.groovy | 19 +++++++++++++++++ release/Magarena/scripts/Tidings.txt | 2 +- src/magic/card/Tidings.java | 27 ------------------------- 3 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 release/Magarena/scripts/Tidings.groovy delete mode 100644 src/magic/card/Tidings.java diff --git a/release/Magarena/scripts/Tidings.groovy b/release/Magarena/scripts/Tidings.groovy new file mode 100644 index 0000000000..823278d08b --- /dev/null +++ b/release/Magarena/scripts/Tidings.groovy @@ -0,0 +1,19 @@ +[ + new MagicSpellCardEvent() { + @Override + public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { + return new MagicEvent( + cardOnStack, + this, + "Draw four cards." + ); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] choiceResults) { + game.doAction(new MagicDrawAction(event.getPlayer(),4)); + } + } +] diff --git a/release/Magarena/scripts/Tidings.txt b/release/Magarena/scripts/Tidings.txt index 56aca377fd..f730ded4d8 100644 --- a/release/Magarena/scripts/Tidings.txt +++ b/release/Magarena/scripts/Tidings.txt @@ -6,4 +6,4 @@ rarity=U type=Sorcery cost={3}{U}{U} timing=draw -requires_card_code +requires_groovy_code diff --git a/src/magic/card/Tidings.java b/src/magic/card/Tidings.java deleted file mode 100644 index 1a89c9199a..0000000000 --- a/src/magic/card/Tidings.java +++ /dev/null @@ -1,27 +0,0 @@ -package magic.card; - -import magic.model.MagicGame; -import magic.model.MagicPayedCost; -import magic.model.action.MagicDrawAction; -import magic.model.event.MagicEvent; -import magic.model.event.MagicSpellCardEvent; -import magic.model.stack.MagicCardOnStack; - -public class Tidings { - public static final MagicSpellCardEvent S = new MagicSpellCardEvent() { - @Override - public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { - return new MagicEvent( - cardOnStack, - this, - "Draw four cards."); - } - @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event, - final Object[] choiceResults) { - game.doAction(new MagicDrawAction(event.getPlayer(),4)); - } - }; -}