Menu

Submission for Toxic Stench

74

Config

name=Toxic Stench
image=http://mtgimage.com/card/toxic%20stench.jpg
value=2.500
rarity=C
type=Instant
cost={1}{B}
timing=removal
requires_groovy_code
oracle=Target nonblack creature gets -1/-1 until end of turn. Threshold — If seven or more cards are in your graveyard, instead destroy that creature. It can't be regenerated.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_NONBLACK_CREATURE,
                this,
                "Target nonblack creature\$ gets -1/-1 until end of turn. " +
                "If seven or more cards are in your graveyard, destroy that creature. It can't be regenerated."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
            if (MagicCondition.THRESHOLD_CONDITION.accept(event.getSource())) {
                game.doAction(MagicChangeStateAction.Set(
                    it,
                    MagicPermanentState.CannotBeRegenerated
                ));
                game.doAction(new MagicDestroyAction(it));
            } else {
                game.doAction(new MagicChangeTurnPTAction(it,-1,-1));
            }
            });
        }
    }
]
Pushed