Menu

Submission for Phelddagrif

150

Config

name=Phelddagrif
image=http://mtgimage.com/card/phelddagrif.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Phelddagrif
cost={1}{G}{W}{U}
pt=4/4
timing=main
requires_groovy_code
oracle={G}: Phelddagrif gains trample until end of turn. Target opponent puts a 1/1 green Hippo creature token onto the battlefield. {W}: Phelddagrif gains flying until end of turn. Target opponent gains 2 life. {U}: Return Phelddagrif to its owner's hand. Target opponent may draw a card.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Flying"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source, "{W}")
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.TARGET_OPPONENT,
                this,
                "SN gains flying until end of turn. Target opponent\$ gains 2 life."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicGainAbilityAction(event.getPermanent(),MagicAbility.Flying));
            event.processTargetPlayer(game, {
                game.doAction(new MagicChangeLifeAction(it,2));
            });
        }
    },
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "Bounce"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source,"{U}")
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                source.getOpponent(),
                new MagicMayChoice("Draw a card?"),
                this,
                "Return SN to its owner's hand. Opponent may draw a card."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicRemoveFromPlayAction(event.getPermanent(),MagicLocationType.OwnersHand));
            if (event.isYes()) {
                game.doAction(new MagicDrawAction(event.getPlayer(),1));
            }
        }
    },
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Trample"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source,"{G}")
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.TARGET_OPPONENT,
                this,
                "SN gains trample until end of turn. " +
                "Target opponent\$ puts a 1/1 green Hippo creature token onto the battlefield."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicGainAbilityAction(event.getPermanent(),MagicAbility.Trample));
           event.processTargetPlayer(game, {
               game.doAction(new MagicPlayTokensAction(
                   it,
                   TokenCardDefinitions.get("1/1 green Hippo creature token"),
                   1
                ));
            });
        }
    }
]
Pushed