Menu

Submission for Oriss, Samite Guardian

28

Config

name=Oriss, Samite Guardian
image=http://magiccards.info/scans/en/fut/28.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Human,Cleric
cost={1}{W}{W}
pt=1/3
ability={T}: Prevent all damage that would be dealt to target creature this turn.
timing=main
requires_groovy_code
oracle={T}: Prevent all damage that would be dealt to target creature this turn. Grandeur — Discard another card named Oriss, Samite Guardian: Target player can't cast spells this turn, and creatures that player controls can't attack this turn.

Script

def CARD_NAMED_ORISS = new MagicCardFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicCard target) {
        return target.getName().equals("Oriss, Samite Guardian");
    }
    public boolean acceptType(final MagicTargetType targetType) {
        return targetType == MagicTargetType.Hand;
    }
};

def A_CARD_NAMED_ORISS = new MagicTargetChoice(
    CARD_NAMED_ORISS,  
    MagicTargetHint.None,
    "a card named Oriss, Samite Guardian from your hand"
);

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Tapping),
        "Grandeur"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [new MagicDiscardChosenEvent(source,A_CARD_NAMED_ORISS)];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.NEG_TARGET_PLAYER,
                this,
                "Target player\$ can't cast spells this turn, and creatures that player controls can't attack this turn."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                game.doAction(new MagicChangePlayerStateAction(
                    it,
                    MagicPlayerState.CantCastSpells
                ));
            final Collection<MagicPermanent> creatures = it.filterPermanents(MagicTargetFilterFactory.CREATURE_YOU_CONTROL);
            for (final MagicPermanent creature : creatures) {
                game.doAction(new MagicGainAbilityAction(creature, MagicAbility.CannotAttack));
                }
            });
        }
    }
]
Pushed