Menu

Submission for Sudden Spoiling

164

Config

name=Sudden Spoiling
image=http://magiccards.info/scans/en/c14/164.jpg
value=2.500
rarity=R
type=Instant
cost={1}{B}{B}
ability=Split second.
timing=removal
requires_groovy_code
oracle=Split second\nUntil end of turn, creatures target player controls lose all abilities and have base power and toughness 0/2.

Script

def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
    @Override
    public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
        pt.set(0,2);
    }
};
def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
    @Override
    public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
        permanent.loseAllAbilities();
    }
};
[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                NEG_TARGET_PLAYER,
                this,
                "Until end of turn, creatures target player\$ controls lose all abilities and have base power and toughness 0/2."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                CREATURE_YOU_CONTROL.filter(it) each {
                    final MagicPermanent creature ->

                    game.doAction(new BecomesCreatureAction(creature,PT,AB));
                }
            });
        }
    }
]
Pushed