Menu

Scripts for Ghalta, Primal Hunger

Config

CodeRay output
name=Ghalta, Primal Hunger
image=https://magiccards.info/scans/en/rix/130.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Elder,Dinosaur
cost={10}{G}{G}
pt=12/12
ability=Trample
timing=main
requires_groovy_code
oracle=Ghalta, Primal Hunger costs {X} less to cast, where X is the total power of creatures you control.\nTrample

Script

CodeRay output
[
    new MagicHandCastActivation(
        [MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Draw, true),
        "Cast"
    ) {
        @Override
        public void change(final MagicCardDefinition cdef) {
            cdef.setHandAct(this);
        }

        @Override
        public Iterable<? extends MagicEvent> getCostEvent(final MagicCard source) {
            final int x = (int)CREATURE_YOU_CONTROL.filter(source)*.getPower().sum(0);
            return [
                new MagicPayManaCostEvent(source, source.getGameCost().reduce(x))
            ];
        }
    }
]