30 lines
1.3 KiB
Groovy
30 lines
1.3 KiB
Groovy
|
[
|
||
|
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));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|