Menu

Submission for Rhystic Shield

20

Config

name=Rhystic Shield
image=http://mtgimage.com/card/rhystic%20shield.jpg
value=2.500
rarity=C
type=Instant
cost={1}{W}
timing=pump
requires_groovy_code
oracle=Creatures you control get +0/+1 until end of turn. They get an additional +0/+2 until end of turn unless any player pays {2}.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                cardOnStack.getOpponent(),
                new MagicMayChoice(
                    "Pay {2}?",
                    new MagicPayManaCostChoice(MagicManaCost.create("{2}"))
                ),
                this,
                "PN may\$ pay {2}\$.If you do, ${cardOnStack} gives +0/+1 to it's controller's creatures until end of turn. " +
                "If you don't, they get an additional +0/+2."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final Collection<MagicPermanent> targets = event.getPlayer().getOpponent().filterPermanents(MagicTargetFilterFactory.CREATURE_YOU_CONTROL);
            if (event.isYes()) {
                for (final MagicPermanent target : targets) {
                    game.doAction(new MagicChangeTurnPTAction(target, 0, 1));
                }
            } else {
                for (final MagicPermanent target : targets) {
                    game.doAction(new MagicChangeTurnPTAction(target, 0, 3));
                }
            }
        }
    }
]
Pushed