magarena/release/Magarena/scripts/Death_s_Caress.groovy

30 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-25 19:32:53 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicDestroyTargetPicker(false),
this,
2013-05-25 19:43:47 -07:00
"Destroy target creature\$. If that creature was " +
2013-05-25 19:32:53 -07:00
"a Human, you gain life equal to its toughness."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicDestroyAction(creature));
if (creature.hasSubType(MagicSubType.Human)) {
game.doAction(new MagicChangeLifeAction(
event.getPlayer(),
creature.getToughness()
));
}
}
});
}
}
]