Menu

Submission for Even the Odds

6

Config

name=Even the Odds
image=http://mtgimage.com/card/even%20the%20odds.jpg
value=2.500
rarity=U
type=Instant
cost={2}{W}
timing=token
requires_groovy_code
oracle=Cast Even the Odds only if you control fewer creatures than each opponent. Put three 1/1 white Soldier creature tokens onto the battlefield.

Script

def FEWER_CREATURES_CONDITION = new MagicCondition() {
        public boolean accept(final MagicSource source) {
            return source.getController().getNrOfPermanents(MagicType.Creature) < source.getOpponent().getNrOfPermanents(MagicType.Creature);
        }
    };
[
    new MagicCardActivation(
        [FEWER_CREATURES_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Token),
        "Tokens"
    ) {
        @Override
        public void change(final MagicCardDefinition cdef) {
            cdef.setCardAct(this);
        }
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                this,
                "Put three 1/1 white Soldier creature tokens onto the battlefield."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
                game.doAction(new MagicPlayTokensAction(
                event.getPlayer(),
                TokenCardDefinitions.get("1/1 white Soldier creature token"),
                3
            ));   
        }
    }
]
Pushed