convert from java code to groovy code

master
melvin 2013-05-19 16:07:02 +08:00
parent 83923a1ff4
commit 1f3dbb526e
2 changed files with 8 additions and 21 deletions

View File

@ -1,16 +1,5 @@
package magic.card; [
new MagicWhenOtherComesIntoPlayTrigger() {
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPermanent;
import magic.model.action.MagicPlayTokenAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicPayManaCostChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger;
public class Mirrorworks {
public static final MagicWhenOtherComesIntoPlayTrigger T = new MagicWhenOtherComesIntoPlayTrigger() {
@Override @Override
public MagicEvent executeTrigger( public MagicEvent executeTrigger(
final MagicGame game, final MagicGame game,
@ -26,16 +15,14 @@ public class Mirrorworks {
), ),
otherPermanent, otherPermanent,
this, this,
"You may$ pay {2}$. If you do, put a token that's a " + "You may\$ pay {2}\$. If you do, put a token that's a " +
"copy of " + otherPermanent + " onto the battlefield." "copy of RN onto the battlefield."
): ):
MagicEvent.NONE; MagicEvent.NONE;
} }
@Override @Override
public void executeEvent( public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicGame game,
final MagicEvent event) {
if (event.isYes()) { if (event.isYes()) {
game.doAction(new MagicPlayTokenAction( game.doAction(new MagicPlayTokenAction(
event.getPlayer(), event.getPlayer(),
@ -43,5 +30,5 @@ public class Mirrorworks {
)); ));
} }
} }
};
} }
]

View File

@ -6,4 +6,4 @@ rarity=R
type=Artifact type=Artifact
cost={5} cost={5}
timing=main timing=main
requires_card_code requires_groovy_code