Menu

Submission for Phyrexian Etchings

67

Config

name=Phyrexian Etchings
image=http://mtgimage.com/card/phyrexian%20etchings.jpg
value=2.500
rarity=R
type=Enchantment
cost={B}{B}{B}
ability=Cumulative upkeep {B}
timing=enchantment
requires_groovy_code
oracle=Cumulative upkeep {B}. At the beginning of your end step, draw a card for each age counter on Phyrexian Etchings. When Phyrexian Etchings is put into a graveyard from the battlefield, you lose 2 life for each age counter on it.

Script

[
    new MagicAtEndOfTurnTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer endOfTurnPlayer) {
            return permanent.isController(endOfTurnPlayer) ?
                new MagicEvent(
                    permanent,
                    this,
                    "PN draws a card for each age counter on SN."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = event.getPermanent().getCounters(MagicCounterType.Age);
            game.doAction(new MagicDrawAction(event.getPlayer(),amount));
        }
    },
    new MagicWhenDiesTrigger() {     
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent died) {    
            new MagicEvent(
                permanent,
                this,
                "PN loses 2 life for each age counter on SN."
            );
    }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = -2 * event.getPermanent().getCounters(MagicCounterType.Age);
            game.doAction(new MagicChangeLifeAction(event.getPermanent().getController(),amount));
        }
    }
]
Pushed