Menu

Submission for Waterspout Djinn

11

Config

name=Waterspout Djinn
image=http://mtgimage.com/card/waterspout%20djinn.jpg
value=2.500
rarity=U
type=Creature
subtype=Djinn
cost={2}{U}{U}
pt=4/4
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. At the beginning of your upkeep, sacrifice Waterspout Djinn unless you return an untapped Island you control to its owner's hand.

Script

def UNTAPPED_ISLAND_YOU_CONTROL = new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.isUntapped() && target.hasSubType(MagicSubType.Island) && target.isController(player);
    } 
};

def AN_UNTAPPED_ISLAND_YOU_CONTROL = new MagicTargetChoice(
    UNTAPPED_ISLAND_YOU_CONTROL,
    "an untapped Island you control"
);

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice("Return an untapped Island to your hand?"),
                this,
                "PN may\$ return an untapped Island to his or her hand. If PN doesn't, sacrifice SN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes() && event.getPlayer().controlsPermanent(UNTAPPED_ISLAND_YOU_CONTROL) == true) {
                game.addEvent(new MagicBounceChosenPermanentEvent(
                    event.getSource(), 
                    event.getPlayer(), 
                    AN_UNTAPPED_ISLAND_YOU_CONTROL
                ));      
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed