From 2b5f519d25e63e1cd93a87dac14b079c7c5b01fb Mon Sep 17 00:00:00 2001 From: melvin Date: Sun, 26 May 2013 20:08:46 +0800 Subject: [PATCH] convert from java code to groovy code --- .../Magarena/scripts/Grave_Titan.groovy | 32 +++++-------------- release/Magarena/scripts/Grave_Titan.txt | 2 +- 2 files changed, 9 insertions(+), 25 deletions(-) rename src/magic/card/Grave_Titan.java => release/Magarena/scripts/Grave_Titan.groovy (59%) diff --git a/src/magic/card/Grave_Titan.java b/release/Magarena/scripts/Grave_Titan.groovy similarity index 59% rename from src/magic/card/Grave_Titan.java rename to release/Magarena/scripts/Grave_Titan.groovy index 1e5bc69ab5..4f02db5312 100644 --- a/src/magic/card/Grave_Titan.java +++ b/release/Magarena/scripts/Grave_Titan.groovy @@ -1,16 +1,5 @@ -package magic.card; - -import magic.data.TokenCardDefinitions; -import magic.model.MagicGame; -import magic.model.MagicPermanent; -import magic.model.MagicPlayer; -import magic.model.action.MagicPlayTokensAction; -import magic.model.event.MagicEvent; -import magic.model.trigger.MagicWhenAttacksTrigger; -import magic.model.trigger.MagicWhenComesIntoPlayTrigger; - -public class Grave_Titan { - public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() { +[ + new MagicWhenComesIntoPlayTrigger() { @Override public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer player) { return new MagicEvent( @@ -20,18 +9,15 @@ public class Grave_Titan { ); } @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { + public void executeEvent(final MagicGame game, final MagicEvent event) { game.doAction(new MagicPlayTokensAction( event.getPlayer(), TokenCardDefinitions.get("Zombie"), 2 )); } - }; - - public static final MagicWhenAttacksTrigger T2 = new MagicWhenAttacksTrigger() { + }, + new MagicWhenAttacksTrigger() { @Override public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) { return (permanent==creature) ? @@ -43,14 +29,12 @@ public class Grave_Titan { MagicEvent.NONE; } @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { + public void executeEvent(final MagicGame game, final MagicEvent event) { game.doAction(new MagicPlayTokensAction( event.getPlayer(), TokenCardDefinitions.get("Zombie"), 2 )); } - }; -} + } +] diff --git a/release/Magarena/scripts/Grave_Titan.txt b/release/Magarena/scripts/Grave_Titan.txt index f3a307c2ae..821fbaa835 100644 --- a/release/Magarena/scripts/Grave_Titan.txt +++ b/release/Magarena/scripts/Grave_Titan.txt @@ -9,4 +9,4 @@ cost={4}{B}{B} pt=6/6 ability=deathtouch timing=fmain -requires_card_code +requires_groovy_code