Menu

Submission for Goblin Diplomats

141

Config

name=Goblin Diplomats
image=http://mtgimage.com/card/goblin%20diplomats.jpg
value=2.500
rarity=R
type=Creature
subtype=Goblin
cost={1}{R}
pt=2/1
timing=main
requires_groovy_code
oracle={T}: Each creature attacks this turn if able.

Script

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

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Each creature attacks this turn if able."
            );
        }

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