Menu

Submission for Wild Slash

118

Config

name=Wild Slash
image=http://magiccards.info/scans/en/frf/118.jpg
value=2.500
rarity=U
type=Instant
cost={R}
timing=removal
requires_groovy_code
oracle=Ferocious — If you control a creature with power 4 or greater, damage can't be prevented this turn.\nWild Slash deals 2 damage to target creature or player.

Script

def cantBePrevented = new MagicIfDamageWouldBeDealtTrigger(MagicTrigger.CANT_BE_PREVENTED) {
    @Override
    public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
        damage.setUnpreventable();
        return MagicEvent.NONE;
    }
}

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                NEG_TARGET_CREATURE_OR_PLAYER,
                this,
                "If you control a creature with power 4 or greater, damage can't be prevented this turn." +
                " SN deals 2 damage to target creature or player\$."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTarget(game, {
                if (event.getPlayer().controlsPermanent(CREATURE_POWER_4_OR_MORE)) {
                    game.doAction(new AddTurnTriggerAction(cantBePrevented));
                }
                game.doAction(new DealDamageAction(event.getSource(),it,2));
            });
        }
    }
]
Pushed