32 lines
1.4 KiB
Groovy
32 lines
1.4 KiB
Groovy
[
|
|
new MagicSpellCardEvent() {
|
|
@Override
|
|
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
|
return new MagicEvent(
|
|
cardOnStack,
|
|
new MagicBuybackChoice(MagicManaCost.create("{3}")),
|
|
this,
|
|
"SN deals 2 damage to each creature and each player. " +
|
|
"If the buyback cost was payed\$, return SN to its owner's hand as it resolves."
|
|
);
|
|
}
|
|
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
final Collection<MagicPermanent> targets =
|
|
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE);
|
|
for (final MagicPermanent target : targets) {
|
|
final MagicDamage damage = new MagicDamage(event.getSource(),target,2);
|
|
game.doAction(new MagicDealDamageAction(damage));
|
|
}
|
|
for (final MagicPlayer player : game.getPlayers()) {
|
|
final MagicDamage damage = new MagicDamage(event.getSource(),player,2);
|
|
game.doAction(new MagicDealDamageAction(damage));
|
|
}
|
|
if (event.isBuyback()) {
|
|
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
|
|
}
|
|
}
|
|
}
|
|
]
|