Menu

Submission for Ixidor's Will

90

Config

name=Ixidor's Will
image=http://mtgimage.com/card/ixidor%27s%20will.jpg
value=2.500
rarity=C
type=Instant
cost={2}{U}
timing=counter
requires_groovy_code
oracle=Counter target spell unless its controller pays {2} for each Wizard on the battlefield.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_SPELL,
                this,
                "Counter target spell\$ unless its controller pays {2} for each Wizard on the battlefield. "
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetCardOnStack(game, {
                final int amount = game.getNrOfPermanents(MagicSubType.Wizard) * 2;
                game.addEvent(new MagicCounterUnlessEvent(event.getSource(),it,MagicManaCost.create("{"+amount+"}")));
            });
        }
    }
]
Pushed