Menu

Submission for Myojin of Seeing Winds

75

Config

name=Myojin of Seeing Winds
image=http://magiccards.info/scans/en/chk/75.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Spirit
cost={7}{U}{U}{U}
pt=3/3
ability=SN has indestructible as long as it has a divinity counter on it.
timing=main
requires_groovy_code
oracle=Myojin of Seeing Winds enters the battlefield with a divinity counter on it if you cast it from your hand. Myojin of Seeing Winds has indestructible as long as it has a divinity counter on it. Remove a divinity counter from Myojin of Seeing Winds: Draw a card for each permanent you control.

Script

def PERMANENT_YOU_CONTROL = new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.isController(player);
    } 
};
[
    new MagicComesIntoPlayWithCounterTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            if (permanent.hasState(MagicPermanentState.CastFromHand)) {
                game.doAction(new MagicChangeCountersAction(permanent, MagicCounterType.Divinity, 1));
            } 
            return MagicEvent.NONE;
        }
    },
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Draw),
        "Draw"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicRemoveCounterEvent(source,MagicCounterType.Divinity,1)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Draw a card for each permanent you control."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicDrawAction(
                event.getPlayer(),
                event.getPlayer().getNrOfPermanents(PERMANENT_YOU_CONTROL)
            ));
        }
    }
]
Pushed