convert from java code to groovy code

master
melvin 2013-05-18 13:51:47 +08:00
parent 6110caf904
commit d27656d91d
3 changed files with 26 additions and 38 deletions

View File

@ -0,0 +1,25 @@
[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
MagicTargetChoice.TARGET_ATTACKING_OR_BLOCKING_CREATURE,
this,
"Remove target attacking or blocking creature\$ from combat."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicRemoveFromCombatAction(creature));
}
});
}
}
]

View File

@ -9,4 +9,4 @@ cost={3}{W}
pt=2/2
ability=flash,flying
timing=flash
requires_card_code
requires_groovy_code

View File

@ -1,37 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicPermanentAction;
import magic.model.action.MagicRemoveFromCombatAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Hollowhenge_Spirit {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
MagicTargetChoice.TARGET_ATTACKING_OR_BLOCKING_CREATURE,
this,
"Remove target attacking or blocking creature$ from combat.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicRemoveFromCombatAction(creature));
}
});
}
};
}