Menu

Submission for Chalice of the Void

203

Config

name=Chalice of the Void
image=http://mtgimage.com/card/chalice%20of%20the%20void.jpg
value=2.500
rarity=R
type=Artifact
cost={X}{X}
timing=artifact
requires_groovy_code
oracle=Chalice of the Void enters the battlefield with X charge counters on it. Whenever a player casts a spell with converted mana cost equal to the number of charge counters on Chalice of the Void, counter that spell.

Script

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPayedCost payedCost) {
            game.doAction(new MagicChangeCountersAction(permanent,MagicCounterType.Charge,payedCost.getX()));
            return MagicEvent.NONE;
        }
    },
    new MagicWhenOtherSpellIsCastTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
            return new MagicEvent(
                permanent,
                cardOnStack,
                this,
                "Counter RN if its converted mana cost is equal to the number of charge counters on SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getRefCardOnStack().getConvertedCost() == event.getPermanent().getCounters(MagicCounterType.Charge)) {
                game.doAction(new MagicCounterItemOnStackAction(event.getRefCardOnStack()));
            }
        }
    }
]
Pushed