30 lines
1.1 KiB
Groovy
30 lines
1.1 KiB
Groovy
[
|
|
new MagicWhenAttacksUnblockedTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
|
|
return (creature == permanent) ?
|
|
new MagicEvent(
|
|
permanent,
|
|
new MagicMayChoice(MagicTargetChoice.NEG_TARGET_CREATURE),
|
|
MagicExileTargetPicker.create(),
|
|
this,
|
|
"PN may\$ sacrifice SN. " +
|
|
"If you do, gain control of target creature\$."
|
|
):
|
|
MagicEvent.NONE;
|
|
}
|
|
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
if (event.isYes()) {
|
|
game.doAction(new MagicSacrificeAction(event.getPermanent()));
|
|
event.processTargetPermanent(game,new MagicPermanentAction() {
|
|
public void doAction(final MagicPermanent creature) {
|
|
game.doAction(new MagicGainControlAction(event.getPlayer(),creature));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
]
|