magarena/release/Magarena/scripts/Leonin_Relic_Warder.groovy

30 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-26 22:26:51 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
final MagicTargetFilter<MagicPermanent> targetFilter = new MagicTargetFilter.MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_ARTIFACT_OR_ENCHANTMENT,permanent);
final MagicTargetChoice targetChoice = new MagicTargetChoice(
targetFilter,true,MagicTargetHint.Negative,"another artifact or enchantment to exile");
return new MagicEvent(
permanent,
new MagicMayChoice(targetChoice),
MagicExileTargetPicker.create(),
this,
"PN may\$ exile another artifact or enchantment\$."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent = event.getPermanent();
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent target) {
game.doAction(new MagicExileUntilThisLeavesPlayAction(permanent,target));
}
});
}
}
}
]