Menu

Submission for Thunder of Hooves

242

Config

name=Thunder of Hooves
image=http://mtgimage.com/card/thunder%20of%20hooves.jpg
value=2.500
rarity=U
type=Sorcery
cost={3}{R}
timing=main
requires_groovy_code
oracle=Thunder of Hooves deals X damage to each creature without flying and each player, where X is the number of Beasts on the battlefield.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            final int X = cardOnStack.getGame().getNrOfPermanents(MagicSubType.Beast);
            return new MagicEvent(
                cardOnStack,
                this,
                "SN deals X damage to each creature without flying and each player, where X is the number of Beasts on the battlefield."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
		final MagicSource source=event.getSource();
                final int X = game.getNrOfPermanents(MagicSubType.Beast);
                final Collection<MagicPermanent> targets=
                game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_WITHOUT_FLYING);
            for (final MagicPermanent target : targets) {
                final MagicDamage damage=new MagicDamage(source,target,X);
                game.doAction(new MagicDealDamageAction(damage));
            }
            for (final MagicPlayer player : game.getAPNAP()) {
                final MagicDamage damage=new MagicDamage(source,player,X);
                game.doAction(new MagicDealDamageAction(damage)); 
	    }
        }
    }
]
Pushed