simplified using MagicLandfallTrigger
parent
a673e02c43
commit
c50f57a6eb
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue