magarena/release/Magarena/scripts/Noble_Vestige.groovy

32 lines
1.0 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Prevent 1"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_PLAYER,
MagicPreventTargetPicker.getInstance(),
this,
"Prevent the next 1 damage that would be dealt to target 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,1));
}
});
}
}
]