magarena/release/Magarena/scripts/Stun_Sniper.groovy

36 lines
1.3 KiB
Groovy

[
new MagicPermanentActivation(
[
MagicCondition.CAN_TAP_CONDITION,
MagicConditionFactory.ManaCost("{1}")
],
new MagicActivationHints(MagicTiming.Removal),
"Damage"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostTapEvent(source,"{1}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicTapTargetPicker(true,false),
this,
"SN deals 1 damage to target creature\$. Tap that creature."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
final MagicDamage damage=new MagicDamage(event.getPermanent(),creature,1);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicTapAction(creature,true));
}
});
}
}
]