From 044b01088e5addb966ed027220c0fdfce51afe06 Mon Sep 17 00:00:00 2001 From: melvin Date: Fri, 31 May 2013 12:57:10 +0800 Subject: [PATCH] convert from java code to groovy code --- .../scripts/Kodama_of_the_Center_Tree.groovy | 61 +++++++------------ .../scripts/Kodama_of_the_Center_Tree.txt | 2 +- 2 files changed, 22 insertions(+), 41 deletions(-) rename src/magic/card/Kodama_of_the_Center_Tree.java => release/Magarena/scripts/Kodama_of_the_Center_Tree.groovy (54%) diff --git a/src/magic/card/Kodama_of_the_Center_Tree.java b/release/Magarena/scripts/Kodama_of_the_Center_Tree.groovy similarity index 54% rename from src/magic/card/Kodama_of_the_Center_Tree.java rename to release/Magarena/scripts/Kodama_of_the_Center_Tree.groovy index 334012b208..473264f26d 100644 --- a/src/magic/card/Kodama_of_the_Center_Tree.java +++ b/release/Magarena/scripts/Kodama_of_the_Center_Tree.groovy @@ -1,34 +1,12 @@ -package magic.card; - -import magic.model.MagicCard; -import magic.model.MagicGame; -import magic.model.MagicLocationType; -import magic.model.MagicPermanent; -import magic.model.MagicPlayer; -import magic.model.MagicPowerToughness; -import magic.model.action.MagicCardAction; -import magic.model.action.MagicMoveCardAction; -import magic.model.action.MagicRemoveCardAction; -import magic.model.choice.MagicMayChoice; -import magic.model.choice.MagicTargetChoice; -import magic.model.event.MagicEvent; -import magic.model.mstatic.MagicCDA; -import magic.model.target.MagicGraveyardTargetPicker; -import magic.model.target.MagicTargetFilter; -import magic.model.target.MagicTargetHint; -import magic.model.trigger.MagicGraveyardTriggerData; -import magic.model.trigger.MagicWhenPutIntoGraveyardTrigger; - -public class Kodama_of_the_Center_Tree { - public static final MagicCDA CDA = new MagicCDA() { +[ + new MagicCDA() { @Override public void modPowerToughness(final MagicGame game, final MagicPlayer player, final MagicPowerToughness pt) { final int amount = game.filterPermanents(player,MagicTargetFilter.TARGET_SPIRIT_YOU_CONTROL).size(); pt.set(amount, amount); } - }; - - public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() { + }, + new MagicWhenPutIntoGraveyardTrigger() { @Override public MagicEvent executeTrigger( final MagicGame game, @@ -49,13 +27,14 @@ public class Kodama_of_the_Center_Tree { targetFilter,false,MagicTargetHint.None, "a Spirit card from your graveyard)"); return new MagicEvent( - permanent, - new MagicMayChoice(targetChoice), - new MagicGraveyardTargetPicker(false), - this, - "PN may$ return target Spirit card$ with " + - "converted mana cost " + cmc + " or less " + - "from his or her graveyard to his or her hand."); + permanent, + new MagicMayChoice(targetChoice), + new MagicGraveyardTargetPicker(false), + this, + "PN may\$ return target Spirit card\$ with " + + "converted mana cost " + cmc + " or less " + + "from his or her graveyard to his or her hand." + ); } return MagicEvent.NONE; } @@ -67,15 +46,17 @@ public class Kodama_of_the_Center_Tree { event.processTargetCard(game,new MagicCardAction() { public void doAction(final MagicCard card) { game.doAction(new MagicRemoveCardAction( - card, - MagicLocationType.Graveyard)); + card, + MagicLocationType.Graveyard + )); game.doAction(new MagicMoveCardAction( - card, - MagicLocationType.Graveyard, - MagicLocationType.OwnersHand)); + card, + MagicLocationType.Graveyard, + MagicLocationType.OwnersHand + )); } }); } } - }; -} + } +] diff --git a/release/Magarena/scripts/Kodama_of_the_Center_Tree.txt b/release/Magarena/scripts/Kodama_of_the_Center_Tree.txt index d773dc7af8..2e830f8010 100644 --- a/release/Magarena/scripts/Kodama_of_the_Center_Tree.txt +++ b/release/Magarena/scripts/Kodama_of_the_Center_Tree.txt @@ -7,4 +7,4 @@ type=Legendary,Creature subtype=Spirit cost={4}{G} timing=main -requires_card_code +requires_groovy_code