Menu

Submission for Pandemonium

68

Config

name=Pandemonium
image=http://mtgimage.com/card/pandemonium.jpg
value=2.500
rarity=R
type=Enchantment
cost={3}{R}
timing=enchantment
requires_groovy_code
oracle=Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice.

Script

[
    new MagicWhenOtherComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
            return (otherPermanent.isCreature()) ?
                new MagicEvent(
                    permanent,
                    otherPermanent.getController(),
                    new MagicMayChoice(MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER),
                    new MagicDamageTargetPicker(otherPermanent.getPower()),
                    otherPermanent,
                    this,
                    "PN may\$ have RN deal damage equal to its power to target creature or player\$."
                ) :
                MagicEvent.NONE;
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicPermanent permanent = event.getRefPermanent();
            if (event.isYes()) {
                event.processTarget(game, {
                    final MagicDamage damage = new MagicDamage(permanent,it,permanent.getPower());
                    game.doAction(new MagicDealDamageAction(damage));
                });
            }
        }
    }
]
Pushed