magarena/release/Magarena/scripts/Defender_en_Vec.groovy

36 lines
1.1 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Prevent"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicRemoveCounterEvent(source,MagicCounterType.Charge,1)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_CREATURE_OR_PLAYER,
MagicPreventTargetPicker.getInstance(),
this,
"Prevent the next 2 damage that would be dealt " +
"to target creature or player\$ this turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
game.doAction(new MagicPreventDamageAction(target,2));
}
});
}
}
]