magarena/release/Magarena/scripts/Marsh_Casualties.groovy

32 lines
1.3 KiB
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicKickerChoice(
MagicTargetChoice.NEG_TARGET_PLAYER,
MagicManaCost.create("{3}"),
false
),
this,
"Creatures target player\$ controls get -1/-1 until end of turn. " +
"If SN was kicked\$, those creatures get -2/-2 until end of turn instead."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
final int amount = event.isKicked() ? -2 : -1;
final Collection<MagicPermanent> targets=
game.filterPermanents(player,MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeTurnPTAction(target,amount,amount));
}
}
});
}
}
]