Menu

Submission for Alesha, Who Smiles at Death

119

Config

name=Alesha, Who Smiles at Death
image=http://mtgimage.com/card/alesha%2C%20who%20smiles%20at%20death.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Human,Warrior
cost={2}{R}
pt=3/2
ability=First strike
timing=main
requires_groovy_code
oracle=First strike. Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking.

Script

def CREATURE_WITH_POWER_2_OR_OR_LESS_FROM_GRAVEYARD = new MagicCardFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicCard target) {
        return target.hasType(MagicType.Creature) &&
               target.getPower() <= 2;
    }
    public boolean acceptType(final MagicTargetType targetType) {
        return targetType == MagicTargetType.Graveyard;
    }
}; 
def A_CREATURE_WITH_POWER_2_OR_OR_LESS_FROM_GRAVEYARD = new MagicTargetChoice(
    CREATURE_WITH_POWER_2_OR_OR_LESS_FROM_GRAVEYARD ,  
    MagicTargetHint.None,
    "a creature with power 2 or less from your graveyard"
);

[
    new MagicWhenSelfAttacksTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPermanent creature) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice(
                    new MagicPayManaCostChoice(MagicManaCost.create("{W/B}{W/B}"))
                ),
                this,
                "PN may\$ pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.addEvent(new MagicPutOntoBattlefieldEvent(
                    event,                    A_CREATURE_WITH_POWER_2_OR_OR_LESS_FROM_GRAVEYARD,
                    [MagicPlayMod.TAPPED,MagicPlayMod.ATTACKING]
                )); 
            }    
        }
    }
]
Pushed