Menu

Submission for Nath of the Gilt-Leaf

213

Comment

tested in magarena 1.44

Config

name=Nath of the Gilt-Leaf
url=http://magiccards.info/lw/en/250.html
image=http://magiccards.info/scans/en/lw/250.jpg
value=3.991
rarity=R
type=Legendary,Creature
subtype=Elf,Warrior
cost={3}{B}{G}
pt=4/4
timing=main
requires_groovy_code

Script

[
    new MagicAtUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return permanent.isController(upkeepPlayer) ?
                new MagicEvent(
                    permanent,
                    new MagicMayChoice(
                        MagicTargetChoice.TARGET_OPPONENT
                    ),
                    this,
                    "Target opponent\$ discards a card at random."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if(event.isYes()){
				event.processTargetPlayer(game,new MagicPlayerAction() {
					public void doAction(final MagicPlayer player) {
						game.addEvent(MagicDiscardEvent.Random(event.getSource(),player));
					}
				});
			}
        }
    },
	new MagicWhenDiscardedTrigger() {
        @Override
        public MagicEvent getEvent(final MagicPermanent permanent,final MagicCard card) {
            return permanent.isEnemy(card) ?
                new MagicEvent(
                    permanent,
                    new MagicMayChoice(),
                    this,
                    "PN may\$ put a 1/1 green Elf Warrior creature token onto the battlefield."
                ) :
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.doAction(new MagicPlayTokenAction(
                    event.getPlayer(), 
                    TokenCardDefinitions.get("1/1 green Elf Warrior creature token")
                ));
            }
        }
    }
]
Pushed