simplified using MagicLandfallTrigger

master
melvin 2012-08-30 20:21:51 +08:00
parent a673e02c43
commit c50f57a6eb
1 changed files with 8 additions and 11 deletions

View File

@ -6,21 +6,18 @@ import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicSetAbilityAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger;
import magic.model.trigger.MagicLandfallTrigger;
public class Snapping_Creeper {
public static final MagicWhenOtherComesIntoPlayTrigger T = new MagicWhenOtherComesIntoPlayTrigger() {
public static final MagicLandfallTrigger T = new MagicLandfallTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent played) {
final MagicPlayer player = permanent.getController();
return (player == played.getController() && played.isLand()) ?
new MagicEvent(
public MagicEvent getEvent(final MagicPermanent permanent) {
return new MagicEvent(
permanent,
player,
new Object[]{permanent},
permanent.getController(),
MagicEvent.NO_DATA,
this,
permanent + " gains vigilance until end of turn."):
MagicEvent.NONE;
permanent + " gains vigilance until end of turn.");
}
@Override
@ -30,7 +27,7 @@ public class Snapping_Creeper {
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicSetAbilityAction(
(MagicPermanent)data[0],
event.getPermanent(),
MagicAbility.Vigilance));
}
};