diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index b8e19a80e1..9774a62371 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -13202,3 +13202,28 @@ converted=1 cost={G} pt=1/1 timing=main + +>Engulfing Slagwurm +image=http://magiccards.info/scans/en/som/118.jpg +value=5 +rarity=R +type=Creature +subtype=Wurm +color=g +converted=7 +cost={5}{G}{G} +pt=7/7 +timing=main + +>Escaped Null +image=http://magiccards.info/scans/en/roe/109.jpg +value=2 +rarity=U +type=Creature +subtype=Zombie,Berserker +color=b +converted=4 +cost={3}{B} +pt=1/2 +ability=lifelink +timing=main diff --git a/src/magic/card/Engulfing_Slagwurm.java b/src/magic/card/Engulfing_Slagwurm.java new file mode 100644 index 0000000000..8a5644f63e --- /dev/null +++ b/src/magic/card/Engulfing_Slagwurm.java @@ -0,0 +1,73 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicPermanent; +import magic.model.MagicPermanentList; +import magic.model.MagicPlayer; +import magic.model.action.MagicChangeLifeAction; +import magic.model.action.MagicDestroyAction; +import magic.model.event.MagicEvent; +import magic.model.trigger.MagicWhenBecomesBlockedTrigger; +import magic.model.trigger.MagicWhenBlocksTrigger; + +public class Engulfing_Slagwurm { + public static final MagicWhenBecomesBlockedTrigger T1 = new MagicWhenBecomesBlockedTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) { + if (creature == permanent) { + final MagicPermanentList plist = new MagicPermanentList(permanent.getBlockingCreatures()); + return new MagicEvent( + permanent, + permanent.getController(), + new Object[]{plist,permanent.getController()}, + this, + plist.size() > 1 ? + "Destroy blocking creatures. You gain life equal to those creature's toughness." : + "Destroy blocking creature. You gain life equal to its toughness."); + } + return MagicEvent.NONE; + } + + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + final MagicPermanentList plist = (MagicPermanentList)data[0]; + for (final MagicPermanent blocker : plist) { + game.doAction(new MagicDestroyAction(blocker)); + game.doAction(new MagicChangeLifeAction( + (MagicPlayer)data[1], + blocker.getToughness(game))); + } + } + }; + + public static final MagicWhenBlocksTrigger T2 = new MagicWhenBlocksTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) { + final MagicPermanent blocked = permanent.getBlockedCreature(); + return (permanent == data && blocked.isValid()) ? + new MagicEvent( + permanent, + permanent.getController(), + new Object[]{blocked,permanent.getController()}, + this, + "Destroy " + blocked + ". You gain life equal to its toughness."): + MagicEvent.NONE; + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + final MagicPermanent blocker = (MagicPermanent)data[0]; + game.doAction(new MagicDestroyAction(blocker)); + game.doAction(new MagicChangeLifeAction( + (MagicPlayer)data[1], + blocker.getToughness(game))); + } + }; +} diff --git a/src/magic/card/Escaped_Null.java b/src/magic/card/Escaped_Null.java new file mode 100644 index 0000000000..8bd19539f0 --- /dev/null +++ b/src/magic/card/Escaped_Null.java @@ -0,0 +1,10 @@ +package magic.card; + +import magic.model.trigger.MagicBecomesBlockedPumpTrigger; +import magic.model.trigger.MagicWhenBlocksPumpTrigger; + +public class Escaped_Null { + public static final MagicBecomesBlockedPumpTrigger T1 = new MagicBecomesBlockedPumpTrigger(5,0); + + public static final MagicWhenBlocksPumpTrigger T2 = new MagicWhenBlocksPumpTrigger(5,0); +}