Menu

Submission for Bull Elephant

101

Config

name=Bull Elephant
image=http://mtgimage.com/card/bull%20elephant.jpg
value=2.500
rarity=C
type=Creature
subtype=Elephant
cost={3}{G}
pt=4/4
timing=main
requires_groovy_code
oracle=When Bull Elephant enters the battlefield, sacrifice it unless you return two Forests you control to their owner's hand.

Script

def choice = new MagicTargetChoice("a Forest you control");

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice("Return two Forests you control to their owner's hand?"),
                this,
                "PN may\$ return two Forests he controls to their owner's hands. If PN doesn't, sacrifice SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getPlayer().getNrOfPermanents(MagicSubType.Forest) >=2 && event.isYes()) {
                game.addEvent(new MagicBounceChosenPermanentEvent(
                    event.getSource(), 
                    choice
                ));		game.addEvent(new MagicBounceChosenPermanentEvent(
                    event.getSource(), 
                    choice
                ));            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed