Menu

Submission for Devour Flesh

63

Config

name=Devour Flesh
url=http://magiccards.info/gtc/en/63.html
image=http://magiccards.info/scans/en/gtc/63.jpg
value=0.100
removal=3
rarity=C
type=Instant
cost={1}{B}
timing=removal
requires_groovy_code

Script

def action = {
    final MagicGame game, final MagicEvent event ->
    event.processTargetPermanent(game, {
        final MagicPermanent permanent ->
        game.doAction(new MagicSacrificeAction(permanent));
        game.doAction(new MagicChangeLifeAction(event.getPlayer(), permanent.getToughness()));
    });
}

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.TARGET_PLAYER,
                this,
                "Target player\$ sacrifices a creature, then gains life equal to that creature's toughness."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                final MagicPlayer player ->
                game.addEvent(new MagicEvent(
                    event.getSource(),
                    player,
                    MagicTargetChoice.SACRIFICE_CREATURE,
                    MagicSacrificeTargetPicker.create(),
                    action,
                    "Choose a creature to sacrifice\$."
                ));
            });
        }
    }
]
Pushed