magarena/release/Magarena/scripts/Hurricane.groovy

29 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-25 19:33:18 -07:00
[
new MagicSpellCardEvent() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int amount=payedCost.getX();
return new MagicEvent(
2013-05-25 19:33:18 -07:00
cardOnStack,
this,
"SN deals "+amount+" damage to each creature with flying and each player."
);
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-25 19:33:18 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2012-09-16 03:46:41 -07:00
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);
2012-06-17 05:19:08 -07:00
game.doAction(new MagicDealDamageAction(damage));
}
for (final MagicPlayer player : game.getPlayers()) {
final MagicDamage damage=new MagicDamage(source,player,amount);
2012-06-17 05:19:08 -07:00
game.doAction(new MagicDealDamageAction(damage));
}
}
2013-05-25 19:33:18 -07:00
}
]