29 lines
1.2 KiB
Groovy
29 lines
1.2 KiB
Groovy
|
[
|
||
|
new MagicSpellCardEvent() {
|
||
|
@Override
|
||
|
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||
|
final int amount=payedCost.getX();
|
||
|
return new MagicEvent(
|
||
|
cardOnStack,
|
||
|
this,
|
||
|
"SN deals "+amount+" damage to each creature with flying and each player."
|
||
|
);
|
||
|
}
|
||
|
@Override
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
final MagicSource source = event.getSource();
|
||
|
final int amount = event.getCardOnStack().getX();
|
||
|
final Collection<MagicPermanent> targets=
|
||
|
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE_WITH_FLYING);
|
||
|
for (final MagicPermanent target : targets) {
|
||
|
final MagicDamage damage=new MagicDamage(source,target,amount);
|
||
|
game.doAction(new MagicDealDamageAction(damage));
|
||
|
}
|
||
|
for (final MagicPlayer player : game.getPlayers()) {
|
||
|
final MagicDamage damage=new MagicDamage(source,player,amount);
|
||
|
game.doAction(new MagicDealDamageAction(damage));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|