Menu

Submission for Draco

3

Config

name=Draco
image=http://magiccards.info/scans/en/ps/131.jpg
value=2.500
rarity=R
type=Artifact,Creature
subtype=Dragon
cost={16}
pt=9/9
ability=Flying
timing=main
requires_groovy_code
oracle=Domain — Draco costs {2} less to cast for each basic land type among lands you control. Flying. Domain — At the beginning of your upkeep, sacrifice Draco unless you pay {10}. This cost is reduced by {2} for each basic land type among lands you control.

Script

[
     new MagicCardActivation(
        [MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "Cast"
    ) {
        @Override
        public void change(final MagicCardDefinition cdef) {
            cdef.setCardAct(this);
        }

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            final int n = 2 * source.getController().getDomain();
            return [
                new MagicPayManaCostEvent(
                    source,
                    source.getCost().reduce(MagicCostManaType.Colorless, n)
                )
            ];
        }
    },
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            final int n = 2 * permanent.getController().getDomain();
            return new MagicEvent(
                permanent,
                new MagicMayChoice(
                    "Pay SN's upkeep cost?",
                    new MagicPayManaCostChoice(MagicManaCost.create("{10}").reduce(MagicCostManaType.Colorless, n))
                ),
                this,
                "PN may\$ pay SN's upkeep cost. If PN doesn't, sacrifice SN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isNo()) {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed