magarena/release/Magarena/scripts/Dauntless_Escort.groovy

29 lines
1.0 KiB
Groovy

[
new MagicPermanentActivation(
MagicActivation.NO_COND,
new MagicActivationHints(MagicTiming.Pump),
"Indestr"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicSacrificeEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Creatures PN control are indestructible this turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> creatures=
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent creature : creatures) {
game.doAction(new MagicSetAbilityAction(creature,MagicAbility.Indestructible));
}
}
}
]