Menu

Submission for Land Tax

35

Config

name=Land Tax
image=http://mtgimage.com/card/land%20tax.jpg
value=2.500
rarity=U
type=Enchantment
cost={W}
timing=enchantment
requires_groovy_code
oracle=At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return upkeepPlayer.getOpponent().getNrOfPermanents(MagicType.Land) >=
                   upkeepPlayer.getNrOfPermanents(MagicType.Land) ?
                new MagicEvent(
                    permanent,
                    new MagicMayChoice(),
                    this,
                    "PN may\$ search your library for up to three basic land cards, reveal them, and put them into your hand. "+
                    "If you do, shuffle your library."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
            final List<MagicCard> choiceList = event.getPlayer().filterCards(MagicTargetFilterFactory.BASIC_LAND_CARD_FROM_LIBRARY);
                game.addEvent(new MagicSearchToLocationEvent(
                    event,
                    new MagicFromCardListChoice(choiceList, 3, true),
                    MagicLocationType.OwnersHand
                ));         
            }
        }
    }
]
Pushed