Menu

Submission for Decree of Justice

70

Config

name=Decree of Justice
image=http://mtgimage.com/card/decree%20of%20justice.jpg
value=2.500
rarity=R
type=Sorcery
cost={X}{X}{2}{W}{W}
ability=Cycling {2}{W}
timing=main
requires_groovy_code
oracle=Put X 4/4 white Angel creature tokens with flying onto the battlefield. Cycling {2}{W}. When you cycle Decree of Justice, you may pay {X}. If you do, put X 1/1 white Soldier creature tokens onto the battlefield.

Script

[
   new MagicSpellCardEvent() {

        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            final int amount = payedCost.getX();
            return new MagicEvent(
                cardOnStack,
                amount,
                this,
                "Put X white Angel creature tokens with flying onto the battlefield. (X="+amount+")"
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
			game.doAction(new MagicPlayTokensAction(
                    event.getPlayer(),
                    TokenCardDefinitions.get("4/4 white Angel creature token with flying"),
                    event.getRefInt()
                ));
        }
    },

	new MagicWhenCycleTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicCard card) {
            return new MagicEvent(
                card,
                new MagicMayChoice(
                    new MagicPayManaCostChoice(MagicManaCost.create("{X}"))
                ),
                this,
                "You may pay\$ {X}\$. If you do, put X 1/1 white Soldier creature tokens onto the battlefield."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.doAction(new MagicPlayTokensAction(
                    event.getPlayer(),
                    TokenCardDefinitions.get("1/1 white Soldier creature token"),
                    event.getPaidMana().getX()
                ));
            }
        }
    }
]
Pushed