Menu

Submission for Putrid Warrior

117

Config

name=Putrid Warrior
image=http://mtgimage.com/card/putrid%20warrior.jpg
value=2.500
rarity=C
type=Creature
subtype=Zombie,Soldier,Warrior
cost={W}{B}
pt=2/2
timing=main
requires_groovy_code
oracle=Whenever Putrid Warrior deals damage, choose one — Each player loses 1 life; or each player gains 1 life.

Script

[
    new MagicWhenDamageIsDealtTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
	    return permanent == damage.getSource() ?
            new MagicEvent(
                permanent,
                new MagicOrChoice(
                    MagicChoice.NONE,
                    MagicChoice.NONE
                ),
                damage.getTarget(),
                this,
                "Choose one\$ - Each player loses 1 life; or each player gains 1 life."
            ):
		MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isMode(1)) {
                for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicChangeLifeAction(player,-1));
		}
            } else if (event.isMode(2)) {
                for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicChangeLifeAction(player,1));
		}
            }
        }
    }
]
Pushed