Menu

Submission for Atogatog

286

Config

name=Atogatog
image=http://mtgimage.com/card/atogatog.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Atog
cost={W}{U}{B}{R}{G}
pt=5/5
timing=main
requires_groovy_code
oracle=Sacrifice an Atog creature: Atogatog gets +X/+X until end of turn, where X is the sacrificed creature's power.

Script

def choice = new MagicTargetChoice("a Pegasus to sacrifice");

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Pump"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicSacrificePermanentEvent(source,choice)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                payedCost.getTarget(),
                this,
                "SN gets +X/+X until end of turn, where X is the sacrificed creature's power."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicPermanent sacrificed=event.getRefPermanent();
            final int X = sacrificed.getPower();
            game.doAction(new MagicChangeTurnPTAction(event.getPermanent(), X, X));
        }
    }
]
Pushed