Menu

Submission for Opalescence

13

Config

name=Opalescence
image=http://mtgimage.com/card/opalescence.jpg
value=4.283
rarity=R
type=Enchantment
cost={2}{W}{W}
timing=main
requires_groovy_code
oracle=Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost.

Script

[
    new MagicStatic(MagicLayer.SetPT, MagicTargetFilterFactory.NON_AURA_ENCHANTMENT) {
		@Override
		public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
			final int cmc = permanent.getConvertedCost();
			pt.set(cmc,cmc);
		}
		@Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source != target;
        }
    },
    new MagicStatic(MagicLayer.Type, MagicTargetFilterFactory.NON_AURA_ENCHANTMENT) {
        @Override
        public int getTypeFlags(final MagicPermanent permanent, final int flags) {
            return flags | MagicType.Creature.getMask();
        }
		@Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source != target;
        }
    }
]
Pushed