magarena/release/Magarena/scripts/Wrack_with_Madness.groovy

29 lines
1000 B
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(
final MagicCardOnStack cardOnStack,
final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE,
this,
"Target creature\$ deals damage to itself 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 MagicDamage damage = new MagicDamage(
creature,
creature,
creature.getPower()
);
game.doAction(new MagicDealDamageAction(damage));
}
});
}
}
]