magarena/release/Magarena/scripts/Solemn_Offering.groovy

25 lines
934 B
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_ARTIFACT_OR_ENCHANTMENT,
new MagicDestroyTargetPicker(false),
this,
"Destroy target artifact or enchantment\$. " +
"PN gains 4 life."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicDestroyAction(permanent));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),4));
}
});
}
}
]