Menu

Submission for Breaking Point

67

Comment

Will need future improvement, since this gives the choice to the opponent alone, but this should cover the vast majority of the times the card's used.

Config

name=Breaking Point
image=http://mtgimage.com/card/breaking%20point.jpg
value=2.500
rarity=R
type=Sorcery
cost={1}{R}{R}
timing=main
requires_groovy_code
oracle=Any player may have Breaking Point deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {   
            return new MagicEvent(
                cardOnStack,
                cardOnStack.getOpponent(),
                new MagicMayChoice("Have SN deal 6 damage to you?"),
                this,
                "PN may\$ have SN deal 6 damage to him or her. If PN doesn't, destroy all creatures."
                + " Creatures destroyed this way can't be regenerated."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.doAction(new MagicDealDamageAction(event.getCardOnStack(),event.getCardOnStack().getOpponent(),6));
            } else {
                 final Collection<MagicPermanent> targets = game.filterPermanents(MagicTargetFilterFactory.CREATURE);
            for (final MagicPermanent target : targets) {
                game.doAction(MagicChangeStateAction.Set(target,MagicPermanentState.CannotBeRegenerated));
            }
            final MagicDestroyAction destroy = new MagicDestroyAction(targets);         
                game.doAction(destroy); 
            }
        }
    }
]
Pushed