From 53fc1b9a50c1bb0fd99ec52422e5fc510c0dcf27 Mon Sep 17 00:00:00 2001 From: melvin Date: Mon, 27 May 2013 22:36:17 +0800 Subject: [PATCH] convert from java code to groovy code --- .../Magarena/scripts/Black_Vise.groovy | 39 +++++-------------- release/Magarena/scripts/Black_Vise.txt | 2 +- 2 files changed, 10 insertions(+), 31 deletions(-) rename src/magic/card/Black_Vise.java => release/Magarena/scripts/Black_Vise.groovy (59%) diff --git a/src/magic/card/Black_Vise.java b/release/Magarena/scripts/Black_Vise.groovy similarity index 59% rename from src/magic/card/Black_Vise.java rename to release/Magarena/scripts/Black_Vise.groovy index 2660270241..9a22e7ec5d 100644 --- a/src/magic/card/Black_Vise.java +++ b/release/Magarena/scripts/Black_Vise.groovy @@ -1,18 +1,5 @@ -package magic.card; - -import magic.model.MagicDamage; -import magic.model.MagicGame; -import magic.model.MagicPermanent; -import magic.model.MagicPlayer; -import magic.model.action.MagicDealDamageAction; -import magic.model.event.MagicEvent; -import magic.model.target.MagicTarget; -import magic.model.trigger.MagicAtUpkeepTrigger; -import magic.model.trigger.MagicWhenComesIntoPlayTrigger; - - -public class Black_Vise { - public static final MagicAtUpkeepTrigger T1 = new MagicAtUpkeepTrigger() { +[ + new MagicAtUpkeepTrigger() { @Override public MagicEvent executeTrigger( final MagicGame game, @@ -25,13 +12,12 @@ public class Black_Vise { upkeepPlayer, this, "PN deals X damage to PN " + - "where X is the number of cards in his or her hand minus 4."): + "where X is the number of cards in his or her hand minus 4." + ): MagicEvent.NONE; } @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { + public void executeEvent(final MagicGame game, final MagicEvent event) { final MagicPlayer player = event.getPlayer(); final int amount = player.getHandSize() - 4; if (amount > 0) { @@ -43,9 +29,8 @@ public class Black_Vise { game.doAction(new MagicDealDamageAction(damage)); } } - }; - - public static final MagicWhenComesIntoPlayTrigger T2 = new MagicWhenComesIntoPlayTrigger() { + }, + new MagicWhenComesIntoPlayTrigger() { @Override public MagicEvent executeTrigger( final MagicGame game, @@ -54,11 +39,5 @@ public class Black_Vise { permanent.setChosenTarget(player.getOpponent()); return MagicEvent.NONE; } - - @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { - } - }; -} + } +] diff --git a/release/Magarena/scripts/Black_Vise.txt b/release/Magarena/scripts/Black_Vise.txt index 505db8cc40..7d2d599d44 100644 --- a/release/Magarena/scripts/Black_Vise.txt +++ b/release/Magarena/scripts/Black_Vise.txt @@ -6,4 +6,4 @@ rarity=U type=Artifact cost={1} timing=smain -requires_card_code +requires_groovy_code