Menu

Submission for Raving Oni-Slave

86

Comment

Adapted from Takenuma Bleeder

Config

name=Raving Oni-Slave
image=http://mtgimage.com/card/raving%20oni-slave.jpg
value=2.500
rarity=C
type=Creature
subtype=Ogre,Warrior
cost={1}{B}
pt=3/3
timing=main
requires_groovy_code
oracle=When Raving Oni-Slave enters the battlefield or leaves the battlefield, you lose 3 life if you don't control a Demon.

Script

def action = {
    final MagicGame game, final MagicEvent event ->
    if (event.getPlayer().controlsPermanent(MagicSubType.Demon) == false) {
        game.doAction(new MagicChangeLifeAction(event.getPlayer(),-3));
    }
}

def event = {
    final MagicPermanent permanent ->
    return new MagicEvent(
        permanent,
        action,
        "If PN controls no Demons, lose 3 life."
    );
}

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPayedCost payedcost) {
            return permanent.getController().controlsPermanent(MagicSubType.Demon) == false ?
                event(permanent):
                MagicEvent.NONE;
        }
    },    
    new MagicWhenLeavesPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicRemoveFromPlayAction act) {
            return permanent.getController().controlsPermanent(MagicSubType.Demon) == false ?
                event(permanent):
                MagicEvent.NONE;
        }
    }
]
Pushed