Menu

Submission for Viseling

269

Config

name=Viseling
image=http://mtgimage.com/card/viseling.jpg
value=2.500
rarity=U
type=Artifact,Creature
subtype=Construct
cost={4}
pt=2/2
timing=main
requires_groovy_code
oracle=At the beginning of each opponent's upkeep, Viseling deals X damage to that player, where X is the number of cards in his or her hand minus 4.

Script

[
    new MagicAtUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPlayer player) {
            return permanent.isOpponent(player) ?
			new MagicEvent(
                    permanent,
                    player,
                    this,
                    "SN deals X damage to PN, where X is the number of cards in his or her hand minus 4."
                ):
			MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicPlayer player = event.getPlayer();
            final int amount = player.getHandSize() - 4;
            final MagicDamage damage = new MagicDamage(
                event.getSource(),
                player,
                amount
            );
            game.doAction(new MagicDealDamageAction(damage));
        }
    }
]
Pushed