Menu

Submission for Natural Affinity

256

Config

name=Natural Affinity
image=http://mtgimage.com/card/natural%20affinity.jpg
value=2.500
rarity=R
type=Instant
cost={2}{G}
timing=pump
requires_groovy_code
oracle=All lands become 2/2 creatures until end of turn. They're still lands.

Script

def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
    @Override
    public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
        pt.set(2,2);
    }
};
def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
    @Override
    public int getTypeFlags(final MagicPermanent permanent,final int flags) {
        return flags|MagicType.Creature.getMask();
    }
};
[
    new MagicSpellCardEvent() {

        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                this,
                "All lands become 2/2 creatures until end of turn. They're still lands."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final Collection<MagicPermanent> targets = game.filterPermanents(MagicTargetFilterFactory.LAND);
            for (final MagicPermanent target : targets) {                game.doAction(new MagicBecomesCreatureAction(target,PT,ST));
            }
        }
    }
]
Pushed