magarena/release/Magarena/scripts/Dispatch.groovy

27 lines
1.0 KiB
Groovy
Raw Normal View History

2013-10-15 22:39:10 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE,
MagicTapTargetPicker.Tap,
this,
"Tap target creature\$. " +
"If you control three or more artifacts, exile it."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicTapAction(permanent,true));
if (MagicCondition.METALCRAFT_CONDITION.accept(event.getSource())) {
game.doAction(new MagicRemoveFromPlayAction(permanent,MagicLocationType.Exile));
}
}
});
}
}
]