convert from java code to groovy code

master
melvin 2013-05-18 11:50:10 +08:00
parent 55b27da38e
commit 200201d70e
3 changed files with 17 additions and 40 deletions

View File

@ -0,0 +1,16 @@
[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
if (game.getCreatureDiedThisTurn()) {
game.doAction(new MagicChangeCountersAction(
permanent,
MagicCounterType.PlusOne,
2,
true
));
}
return MagicEvent.NONE;
}
}
]

View File

@ -9,4 +9,4 @@ cost={3}{G}
pt=3/3
ability=trample
timing=smain
requires_card_code
requires_groovy_code

View File

@ -1,39 +0,0 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Festerhide_Boar {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
if (game.getCreatureDiedThisTurn()) {
return new MagicEvent(
permanent,
player,
this,
"SN enters the battlefield with two +1/+1 counters on it ");
}
return MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.PlusOne,
2,
true));
}
@Override
public boolean usesStack() {
return false;
}
};
}