Menu

Submission for Humble Defector

129

Config

name=Humble Defector
image=http://mtgimage.com/card/humble%20defector.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Rogue
cost={1}{R}
pt=2/1
timing=main
requires_groovy_code
oracle={T}: Draw two cards. Target opponent gains control of Humble Defector. Activate this ability only during your turn.

Script

[
    new MagicPermanentActivation(
        [MagicCondition.YOUR_UPKEEP_CONDITION],
        new MagicActivationHints(MagicTiming.Draw),
        "Draw"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.TARGET_OPPONENT,
                this,
                "PN draws two cards. Target opponent\$ gains control of SN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicDrawAction(event.getPlayer(),2));
            event.processTargetPlayer(game, {
                game.doAction(new MagicGainControlAction(it,event.getPermanent()));
            });
        }
    }
]
Pushed