Menu

Submission for Keeper of the Flame

85

Config

name=Keeper of the Flame
image=http://magiccards.info/scans/en/ex/85.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Wizard
cost={R}{R}
pt=1/2
timing=main
requires_groovy_code
oracle={R}, {T}: Choose target opponent who had more life than you did as you activated this ability. Keeper of the Flame deals 2 damage to him or her.

Script

def OPPONENT_WHO_HAS_MORE_LIFE = new MagicPlayerFilterImpl() {
    public boolean accept(final MagicSource source,final MagicPlayer player,final MagicPlayer target) {
        return target.isEnemy(player) && target.getLife() > player.getLife();
    } 
};

def TARGET_OPPONENT_WHO_HAS_MORE_LIFE = new MagicTargetChoice(
    OPPONENT_WHO_HAS_MORE_LIFE,
    "target opponent who has more life than you"
);

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "Damage"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source,"{R}"),
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                TARGET_OPPONENT_WHO_HAS_MORE_LIFE,
                this,
                "SN deals 2 damage to RN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                game.doAction(new DealDamageAction(event.getSource(),it,2));
            });
        }
    }
]
Pushed