Menu

Submission for Knight of the Mists

36

Config

name=Knight of the Mists
image=http://mtgimage.com/card/knight%20of%20the%20mists.jpg
value=2.500
rarity=C
type=Creature
subtype=Human,Knight
cost={2}{U}
pt=2/2
ability=Flanking
timing=main
requires_groovy_code
oracle=Flanking. When Knight of the Mists enters the battlefield, you may pay {U}. If you don't, destroy target Knight and it can't be regenerated.

Script

def KNIGHT=new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasSubType(MagicSubType.Knight);
    } 
};

def TARGET_KNIGHT = new MagicTargetChoice(
    KNIGHT,
    "target knight"
);

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice(
                    "Pay {U}?",
                    new MagicPayManaCostChoice(MagicManaCost.create("{U}")),
                    TARGET_KNIGHT
                ),
                this,
                "PN may\$ pay {U}\$. If PN doesn't, destroy target knight\$. It can't be regenerated."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
            if (event.isNo() && it.isValid()) {
                    game.doAction(MagicChangeStateAction.Set(it,MagicPermanentState.CannotBeRegenerated));
                    game.doAction(new MagicDestroyAction(it));
                }
            });
        }
    }
]
Pushed