Menu

Submission for Bullwhip

126

Config

name=Bullwhip
image=http://mtgimage.com/card/bullwhip.jpg
value=2.500
rarity=U
type=Artifact
cost={4}
timing=artifact
requires_groovy_code
oracle={2}, {T}: Bullwhip deals 1 damage to target creature. That creature attacks this turn if able.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.MustAttack),
        "Attacks"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                    new MagicPayManaCostEvent(source,"{2}"),                  
                    new MagicTapEvent(source)
                ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.NEG_TARGET_CREATURE,
                MagicMustAttackTargetPicker.create(),
                this,
                "SN deals 1 damage to target creature\$. That creature attacks this turn if able."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
                game.doAction(new MagicDealDamageAction(event.getSource(),it,2));
                game.doAction(new MagicGainAbilityAction(it,MagicAbility.AttacksEachTurnIfAble));
            });
        }
    }
]
Pushed