convert from java code to groovy code

master
melvin 2013-05-19 10:51:58 +08:00
parent 4a91fd5b27
commit fd5d3f065f
2 changed files with 8 additions and 20 deletions

View File

@ -1,16 +1,5 @@
package magic.card; [
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicDrawAction;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.event.MagicDiscardEvent;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenOtherPutIntoGraveyardFromPlayTrigger;
public class Murder_of_Crows {
public static final MagicWhenOtherPutIntoGraveyardFromPlayTrigger T = new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (permanent != otherPermanent && otherPermanent.isCreature()) ? return (permanent != otherPermanent && otherPermanent.isCreature()) ?
@ -23,18 +12,17 @@ public class Murder_of_Crows {
MagicSimpleMayChoice.DEFAULT_NONE MagicSimpleMayChoice.DEFAULT_NONE
), ),
this, this,
"You may$ draw a card. If you do, discard a card."): "You may\$ draw a card. If you do, discard a card."
):
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()) {
final MagicPlayer player=event.getPlayer(); final MagicPlayer player=event.getPlayer();
game.doAction(new MagicDrawAction(player,1)); game.doAction(new MagicDrawAction(player,1));
game.addEvent(new MagicDiscardEvent(event.getSource(),player,1,false)); game.addEvent(new MagicDiscardEvent(event.getSource(),player,1,false));
} }
} }
};
} }
]

View File

@ -9,4 +9,4 @@ cost={3}{U}{U}
pt=4/4 pt=4/4
ability=flying ability=flying
timing=main timing=main
requires_card_code requires_groovy_code