From f1674977619167f5817a6f4a5c8e1aa318a4bb36 Mon Sep 17 00:00:00 2001 From: melvin Date: Thu, 30 May 2013 16:05:26 +0800 Subject: [PATCH] convert from java code to groovy code --- .../Magarena/scripts/Beguiler_of_Wills.groovy | 41 ++++--------------- .../Magarena/scripts/Beguiler_of_Wills.txt | 2 +- 2 files changed, 10 insertions(+), 33 deletions(-) rename src/magic/card/Beguiler_of_Wills.java => release/Magarena/scripts/Beguiler_of_Wills.groovy (52%) diff --git a/src/magic/card/Beguiler_of_Wills.java b/release/Magarena/scripts/Beguiler_of_Wills.groovy similarity index 52% rename from src/magic/card/Beguiler_of_Wills.java rename to release/Magarena/scripts/Beguiler_of_Wills.groovy index e52efb3182..8af171519c 100644 --- a/src/magic/card/Beguiler_of_Wills.java +++ b/release/Magarena/scripts/Beguiler_of_Wills.groovy @@ -1,38 +1,17 @@ -package magic.card; - -import magic.model.MagicGame; -import magic.model.MagicPayedCost; -import magic.model.MagicPermanent; -import magic.model.MagicType; -import magic.model.action.MagicGainControlAction; -import magic.model.action.MagicPermanentAction; -import magic.model.choice.MagicTargetChoice; -import magic.model.condition.MagicCondition; -import magic.model.event.MagicActivationHints; -import magic.model.event.MagicEvent; -import magic.model.event.MagicPermanentActivation; -import magic.model.event.MagicTapEvent; -import magic.model.event.MagicTiming; -import magic.model.target.MagicExileTargetPicker; -import magic.model.target.MagicTargetFilter; -import magic.model.target.MagicTargetHint; - -public class Beguiler_of_Wills { - public static final MagicPermanentActivation A = new MagicPermanentActivation( - new MagicCondition[]{MagicCondition.CAN_TAP_CONDITION}, +[ + new MagicPermanentActivation( + [MagicCondition.CAN_TAP_CONDITION], new MagicActivationHints(MagicTiming.Removal), "Control" ) { @Override public MagicEvent[] getCostEvent(final MagicPermanent source) { - return new MagicEvent[]{new MagicTapEvent(source)}; + return [new MagicTapEvent(source)]; } @Override - public MagicEvent getPermanentEvent( - final MagicPermanent source, - final MagicPayedCost payedCost) { + public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) { final MagicTargetFilter targetFilter = new MagicTargetFilter.MagicPowerTargetFilter( MagicTargetFilter.TARGET_CREATURE, source.getController().getNrOfPermanentsWithType(MagicType.Creature) @@ -48,15 +27,13 @@ public class Beguiler_of_Wills { targetChoice, MagicExileTargetPicker.create(), this, - "Gain control of target creature$ with power less " + + "Gain control of target creature\$ with power less " + "than or equal to the number of creatures you control." ); } @Override - public void executeEvent( - final MagicGame game, - final MagicEvent event) { + public void executeEvent(final MagicGame game, final MagicEvent event) { event.processTargetPermanent(game,new MagicPermanentAction() { public void doAction(final MagicPermanent creature) { if (creature.getPower() <= event.getPlayer().getNrOfPermanentsWithType(MagicType.Creature)) { @@ -65,5 +42,5 @@ public class Beguiler_of_Wills { } }); } - }; -} + } +] diff --git a/release/Magarena/scripts/Beguiler_of_Wills.txt b/release/Magarena/scripts/Beguiler_of_Wills.txt index ed992981af..106aa3e2af 100644 --- a/release/Magarena/scripts/Beguiler_of_Wills.txt +++ b/release/Magarena/scripts/Beguiler_of_Wills.txt @@ -8,4 +8,4 @@ subtype=Human,Wizard cost={3}{U}{U} pt=1/1 timing=main -requires_card_code +requires_groovy_code