Menu

Submission for Armored Guardian

230

Config

name=Armored Guardian
image=http://magiccards.info/scans/en/in/230.jpg
value=2.500
rarity=R
type=Creature
subtype=Cat,Soldier
cost={3}{W}{U}
pt=2/5
ability={1}{U}{U}: SN gains shroud until end of turn.
timing=main
requires_groovy_code
oracle={1}{W}{W}: Target creature you control gains protection from the color of your choice until end of turn. {1}{U}{U}: Armored Guardian gains shroud until end of turn.

Script

def action = {
    final MagicGame game, final MagicEvent event ->
    game.doAction(new MagicGainAbilityAction(
        event.getRefPermanent(),
        event.getChosenColor().getProtectionAbility()
    ));
}

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Protection"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [new MagicPayManaCostEvent(source,"{1}{W}{W}")];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL,
                this,
                "Target creature you control\$ gains protection from the color of your choice until end of turn."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
                game.addEvent(new MagicEvent(
                    event.getSource(),
                    event.getPlayer(),
                    MagicColorChoice.ALL_INSTANCE,
                    it,
                    action,
                    "Chosen color\$."
                ));
            });
        }
    }
]
Pushed