magarena/release/Magarena/scripts/Chastise.groovy

26 lines
1004 B
Groovy
Raw Normal View History

2013-05-18 19:33:38 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_ATTACKING_CREATURE,
new MagicDestroyTargetPicker(false),
this,
2013-06-23 18:29:26 -07:00
"Destroy target attacking creature\$. " +
2013-05-18 19:33:38 -07:00
"PN gains life equal to its power."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
final int power=creature.getPower();
game.doAction(new MagicDestroyAction(creature));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),power));
}
});
}
}
]