Menu

Submission for Orim's Chant

11

Config

name=Orim's Chant
image=http://magiccards.info/scans/en/ps/11.jpg
value=2.500
rarity=R
type=Instant
cost={W}
ability=Kicker {W}
timing=tapping
requires_groovy_code
oracle=Kicker {W}. Target player can't cast spells this turn. If Orim's Chant was kicked, creatures can't attack this turn.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_PLAYER,
                this,
                "Target player\$ can't cast spells this turn. If SN was kicked, creatures 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
                ));
            });
            if (event.isKicked()) {
            final Collection<MagicPermanent> creatures = game.filterPermanents(MagicTargetFilterFactory.CREATURE);
            for (final MagicPermanent creature : creatures) {
                game.doAction(new MagicGainAbilityAction(creature, MagicAbility.CannotAttack));
                }
            }
        }
    }
]
Pushed