Menu

Submission for Bioplasm

81

Config

name=Bioplasm
image=http://mtgimage.com/card/bioplasm.jpg
value=2.500
rarity=R
type=Creature
subtype=Ooze
cost={3}{G}{G}
pt=4/4
timing=main
requires_groovy_code
oracle=Whenever Bioplasm attacks, exile the top card of your library. If it's a creature card, Bioplasm gets +X/+Y until end of turn, where X is the exiled creature card's power and Y is its toughness.

Script

[
    new MagicWhenSelfAttacksTrigger() {
        @Override
         public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent attacker) {
            return new MagicEvent(
                permanent,
                this,
                "Exile the top card of PN's library. If it's a creature card, SN gets +X/+Y until end of turn," + "where X is the exiled creature card's power and Y is its toughness."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            for (final MagicCard card : event.getPlayer().getLibrary().getCardsFromTop(1)) {
                game.doAction(new MagicRemoveCardAction(
                    card,
                    MagicLocationType.OwnersLibrary
                ));
                game.doAction(new MagicMoveCardAction(
                    card,
                    MagicLocationType.OwnersLibrary,
                      MagicLocationType.Exile
                ));
            if (card.hasType(MagicType.Creature)) {
            final int X = card.getPower();
            final int Y = card.getToughness();
            game.doAction(new MagicChangeTurnPTAction(event.getPermanent(), +X, +Y));
            }
            }
        }
    }
]
Pushed