convert from java code to groovy code

master
melvin 2013-03-18 17:51:48 +08:00
parent f3ff2ee4db
commit 74e6db2856
3 changed files with 20 additions and 33 deletions

View File

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

View File

@ -9,4 +9,4 @@ cost={B}
pt=1/1
timing=main
ability=kicker {3}{B} it enters the battlefield with two +1/+1 counters on it and with fear
requires_card_code
requires_groovy_code

View File

@ -1,32 +0,0 @@
package magic.card;
import magic.model.MagicAbility;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicSetAbilityAction;
import magic.model.event.MagicEvent;
import magic.model.mstatic.MagicStatic;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Duskwalker {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer player) {
if (permanent.isKicked()) {
game.doAction(new MagicChangeCountersAction(
permanent,
MagicCounterType.PlusOne,
2,
true));
game.doAction(new MagicSetAbilityAction(permanent,MagicAbility.Fear,MagicStatic.Forever));
}
return MagicEvent.NONE;
}
};
}