Menu

Submission for Jeweled Spirit

12

Config

name=Jeweled Spirit
image=http://mtgimage.com/card/jeweled%20spirit.jpg
value=2.500
rarity=R
type=Creature
subtype=Spirit
cost={3}{W}{W}
pt=3/3
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. Sacrifice two lands: Jeweled Spirit gains protection from artifacts or from the color of your choice until end of turn.

Script

def ProtectionFromArtifacts = MagicAbility.getAbilityList("protection from artifacts");

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Color"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_LAND),
                new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_LAND)
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicColorChoice.ALL_INSTANCE,
                this,
                "SN gains protection from the color\$ of your choice until end of turn."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicGainAbilityAction(
                event.getPermanent(),
                event.getChosenColor().getProtectionAbility()
            ));
        }
    },
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Artifacts"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_LAND),
                new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_LAND)
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "SN gains protection from artifacts until end of turn."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicGainAbilityAction(event.getPermanent(),ProtectionFromArtifacts))

        }
    }
]
Pushed