Menu

Submission for Thunderbreak Regent

162

Config

name=Thunderbreak Regent
image=http://magiccards.info/scans/en/dtk/162.jpg
value=2.500
rarity=R
type=Creature
subtype=Dragon
cost={2}{R}{R}
pt=4/4
ability=Flying
timing=main
requires_groovy_code
oracle=Flying\nWhenever a Dragon you control becomes the target of a spell or ability an opponent controls, Thunderbreak Regent deals 3 damage to that player.

Script

MagicTargetFilter<MagicPermanent> DRAGON_YOU_CONTROL = Permanent("Dragon you control");

[
    new MagicWhenTargetedTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicItemOnStack itemOnStack) {
            final MagicTarget target = itemOnStack.getTarget();
            return target.isPermanent() &&
                   DRAGON_YOU_CONTROL.accept(permanent, permanent.getController(), (MagicPermanent)target) &&
                   itemOnStack.getController() == permanent.getOpponent() ?
                new MagicEvent(
                    permanent,
                    itemOnStack.getController(),
                    this,
                    "SN deals 3 damage to RN."
                ):
                MagicEvent.NONE;
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new DealDamageAction(event.getPermanent(),event.getRefPlayer(),3));
        }
    }
]
Pushed