Menu

Submission for Altar Golem

166

Config

name=Altar Golem
image=http://mtgimage.com/card/altar%20golem.jpg
value=2.500
rarity=R
type=Artifact,Creature
subtype=Golem
cost={7}
pt=*/*
ability=Trample;\
        SN's power and toughness are each equal to the number of creatures on the battlefield.;\
        SN doesn't untap during your untap step.
timing=main
requires_groovy_code
oracle=Trample. Altar Golem's power and toughness are each equal to the number of creatures on the battlefield. Altar Golem doesn't untap during your untap step. Tap five untapped creatures you control: Untap Altar Golem.

Script

def UNTAPPED_CREATURE_YOU_CONTROL=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target)
    {
        return target.hasType(MagicType.Creature) && 
               target.isUntapped() && 
               target.isController(player);
    }
};

def FIVE_UNTAPPED_CREATURE_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(UNTAPPED_CREATURE_YOU_CONTROL) >= 5;
    }
};

def AN_UNTAPPED_CREATURE_YOU_CONTROL = new MagicTargetChoice(UNTAPPED_CREATURE_YOU_CONTROL,"an untapped creature you control");

[
    new MagicPermanentActivation(
        [FIVE_UNTAPPED_CREATURE_CONDITION],
        new MagicActivationHints(MagicTiming.Removal),
        "Untap"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL),
                new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Untap SN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicUntapAction(event.getPermanent()));
        }
    }
]
Pushed