magarena/release/Magarena/scripts/Eldrazi_Monument.groovy

45 lines
1.7 KiB
Groovy

[
new MagicStatic(
MagicLayer.Ability,
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL
) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.add(MagicAbility.Flying);
flags.add(MagicAbility.Indestructible);
}
},
new MagicStatic(
MagicLayer.ModPT,
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL
) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.add(1,1);
}
},
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
this,
"PN sacrifices a creature. If you can't, sacrifice SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent=event.getPermanent();
final MagicPlayer player=event.getPlayer();
if (player.controlsPermanentWithType(MagicType.Creature)) {
game.addEvent(new MagicSacrificePermanentEvent(permanent,player,MagicTargetChoice.SACRIFICE_CREATURE));
} else {
game.doAction(new MagicSacrificeAction(permanent));
}
}
}
]