Menu

Submission for Zombie Trailblazer

89

Config

name=Zombie Trailblazer
image=http://mtgimage.com/card/zombie%20trailblazer.jpg
value=2.500
rarity=U
type=Creature
subtype=Zombie,Scout
cost={B}{B}{B}
pt=2/2
ability=Tap an untapped Zombie you control: Target creature gains swampwalk until end of turn.
timing=main
requires_groovy_code
oracle=Tap an untapped Zombie you control: Target land becomes a Swamp until end of turn. Tap an untapped Zombie you control: Target creature gains swampwalk until end of turn.

Script

def ST1 = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
    @Override
    public void modAbilityFlags(final MagicPermanent source, final MagicPermanent permanent, final Set<MagicAbility> flags) {
            permanent.loseAllAbilities();
            permanent.addAbility(new MagicTapManaActivation(MagicManaType.getList("{B}")));
	}
};

def ST2 = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
    @Override
    public void modSubTypeFlags(final MagicPermanent permanent,final Set<MagicSubType> flags) {
            flags.clear();
            flags.add(MagicSubType.Swamp);
	}
};

def UNTAPPED_ZOMBIE_YOU_CONTROL=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target)
    {
        return target.hasSubType(MagicSubType.Zombie) && 
               target.isUntapped() && 
               target.isController(player);
    }
};

def UNTAPPED_ZOMBIE_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(UNTAPPED_ZOMBIE_YOU_CONTROL) >= 1;
    }
};

def AN_UNTAPPED_ZOMBIE_YOU_CONTROL = new MagicTargetChoice(UNTAPPED_ZOMBIE_YOU_CONTROL,"an untapped Zombie you control");

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
		MagicTargetChoice.TARGET_LAND,
                this,
                "Target land\$ becomes a Swamp until end of turn."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
           event.processTargetPermanent(game, {
                game.doAction(new MagicAddStaticAction(it, ST1));
	        game.doAction(new MagicAddStaticAction(it, ST2));
            });
        }
    }
]
Pushed