Menu

Submission for Copy Enchantment

42

Config

name=Copy Enchantment
image=http://mtgimage.com/card/copy%20enchantment.jpg
value=3.917
rarity=R
type=Enchantment
cost={2}{U}
timing=main
requires_groovy_code
oracle=You may have Copy Enchantment enter the battlefield as a copy of any enchantment on the battlefield.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                new MagicMayChoice(new MagicTargetChoice("an enchantment")),
                MagicCopyPermanentPicker.create(),
                this,
                "You may\$ have SN enter the battlefield as a copy of any enchantment\$ on the battlefield."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                event.processTargetPermanent(game, {
                    final MagicPermanent chosen ->
                    game.doAction(new MagicEnterAsCopyAction(event.getCardOnStack(), chosen))
                });
            } else {
                game.logAppendMessage(event.getPlayer(), "Put ${event.getCardOnStack()} onto the battlefield.");
                game.doAction(new MagicPlayCardFromStackAction(
                    event.getCardOnStack()
                ));
            }
        }
    }
]
Pushed