Menu

Submission for Unyaro Griffin

49

Config

name=Unyaro Griffin
image=http://magiccards.info/scans/en/6e/49.jpg
value=2.500
rarity=U
type=Creature
subtype=Griffin
cost={3}{W}
pt=2/2
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. Sacrifice Unyaro Griffin: Counter target red instant or sorcery spell.

Script

def RED_INSTANT_OR_SORCERY = new MagicStackFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicItemOnStack target) {
        return target.hasColor(MagicColor.Red) && target.isInstantOrSorcerySpell();
    } 
};

def TARGET_RED_INSTANT_OR_SORCERY = new MagicTargetChoice(
    RED_INSTANT_OR_SORCERY,
    "target red instant or sorcery spell"
);

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Counter),
        "Counter"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicSacrificeEvent(source)
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                TARGET_RED_INSTANT_OR_SORCERY,
                this,
                "Counter target red instant or sorcery spell\$."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
             event.processTargetCardOnStack(game, {
                 game.doAction(new MagicCounterItemOnStackAction(it));
            });
        }
    }
]
Pushed