magarena/release/Magarena/scripts/Leonin_Relic_Warder.groovy

34 lines
1.3 KiB
Groovy

[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPayedCost payedCost) {
final MagicTargetChoice targetChoice = new MagicTargetChoice(
new MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_ARTIFACT_OR_ENCHANTMENT,
permanent
),
MagicTargetHint.Negative,
"another target artifact or enchantment to exile"
);
return new MagicEvent(
permanent,
new MagicMayChoice(targetChoice),
MagicExileTargetPicker.create(),
this,
"PN may\$ exile target 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));
}
});
}
}
}
]