Menu

Submission for Ramosian Rally

38

Config

name=Ramosian Rally
image=http://mtgimage.com/card/ramosian%20rally.jpg
value=2.500
rarity=C
type=Instant
cost={3}{W}
effect=Creatures you control get +1/+1 until end of turn.
timing=pump
requires_groovy_code
oracle=If you control a Plains, you may tap an untapped creature you control rather than pay Ramosian Rally's mana cost. Creatures you control get +1/+1 until end of turn.

Script

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

def UNTAPPED_CREATURE_YOU_CONTROL=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target)
    {
        return target.hasType(MagicType.Creature) && 
               target.isUntapped() && 
               target.isController(player);
    }
};


def PLAINS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(PLAINS_YOU_CONTROL) >= 1 && 
        source.getController().getNrOfPermanents(UNTAPPED_CREATURE_YOU_CONTROL) >= 1;
    }
};

def AN_UNTAPPED_CREATURE_YOU_CONTROL = new MagicTargetChoice(UNTAPPED_CREATURE_YOU_CONTROL,"an untapped creature you control");

[
     new MagicCardActivation(
        [MagicCondition.PLAINS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Pump),
        "Tap"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [
                new MagicTapPermanentEvent(source, AN_UNTAPPED_CREATURE_YOU_CONTROL)
            ];
        }
    }
]
Pushed