Menu

Submission for Immortal Servitude

220

Comment

tested in magarena 1.43

Config

name=Immortal Servitude
url=http://magiccards.info/gtc/en/220.html
image=http://magiccards.info/scans/en/gtc/220.jpg
value=3.650
rarity=R
type=Sorcery
cost={X}{W/B}{W/B}{W/B}
timing=main
requires_groovy_code

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            final int amount=payedCost.getX();
			return new MagicEvent(
                cardOnStack,
                this,
                "PN returns each creature card with converted mana cost " + amount + 
				"from his or her graveyard to the battlefield."
            );
        }

       @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = event.getCardOnStack().getX();
			final MagicPlayer player = event.getPlayer();
            final Collection<MagicCard> targets = game.filterCards(
                player,
                MagicTargetFilter.TARGET_CREATURE_CARD_FROM_GRAVEYARD
            );
            for (final MagicCard card : targets) {
				if(card.getConvertedCost() == amount){
					game.doAction(new MagicReanimateAction(
						card, 
						player
					));
				}
            }
        }
    }
]
Pushed