From c47de371fb577e474e106a7e4f2545971e2d5669 Mon Sep 17 00:00:00 2001 From: beholder Date: Sun, 9 Oct 2011 15:33:08 +0200 Subject: [PATCH] added Deepwood Wolverine and Dread Specter --- resources/magic/data/cards.txt | 24 ++++++++ src/magic/card/Deepwood_Wolverine.java | 7 +++ src/magic/card/Dread_Specter.java | 77 ++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 src/magic/card/Deepwood_Wolverine.java create mode 100644 src/magic/card/Dread_Specter.java diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 07acb1d769..c09ebf6ae3 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -13107,3 +13107,27 @@ converted=4 cost={3}{B} pt=2/2 timing=main + +>Deepwood Wolverine +image=http://magiccards.info/scans/en/mm/242.jpg +value=1 +rarity=C +type=Creature +subtype=Wolverine +color=g +converted=1 +cost={G} +pt=1/1 +timing=main + +>Dread Specter +image=http://magiccards.info/scans/en/mr/17.jpg +value=3 +rarity=U +type=Creature +subtype=Specter +color=b +converted=4 +cost={3}{B} +pt=2/2 +timing=main diff --git a/src/magic/card/Deepwood_Wolverine.java b/src/magic/card/Deepwood_Wolverine.java new file mode 100644 index 0000000000..d2616441c9 --- /dev/null +++ b/src/magic/card/Deepwood_Wolverine.java @@ -0,0 +1,7 @@ +package magic.card; + +import magic.model.trigger.MagicBecomesBlockedPumpTrigger; + +public class Deepwood_Wolverine { + public static final MagicBecomesBlockedPumpTrigger T = new MagicBecomesBlockedPumpTrigger(2,0); +} diff --git a/src/magic/card/Dread_Specter.java b/src/magic/card/Dread_Specter.java new file mode 100644 index 0000000000..f0f6d4acba --- /dev/null +++ b/src/magic/card/Dread_Specter.java @@ -0,0 +1,77 @@ +package magic.card; + +import magic.model.MagicColor; +import magic.model.MagicGame; +import magic.model.MagicPermanent; +import magic.model.MagicPermanentList; +import magic.model.MagicPermanentState; +import magic.model.action.MagicChangeStateAction; +import magic.model.event.MagicEvent; +import magic.model.trigger.MagicWhenBecomesBlockedTrigger; +import magic.model.trigger.MagicWhenBlocksTrigger; + +public class Dread_Specter { + 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(); + for (final MagicPermanent blocker : permanent.getBlockingCreatures()) { + final int colorFlags = blocker.getColorFlags(game); + if (!MagicColor.Black.hasColor(colorFlags)) { + plist.add(blocker); + } + } + if (!plist.isEmpty()) { + return new MagicEvent( + permanent, + permanent.getController(), + new Object[]{plist}, + this, + plist.size() > 1 ? + "Destroy blocking nonblack creatures at end of combat." : + "Destroy blocking nonblack creature at end of combat."); + } + } + 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 MagicChangeStateAction(blocker,MagicPermanentState.DestroyAtEndOfCombat,true)); + } + } + }; + + 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() && + !MagicColor.Black.hasColor(blocked.getColorFlags(game))) ? + new MagicEvent( + permanent, + permanent.getController(), + new Object[]{blocked}, + this, + "Destroy " + blocked + " at end of combat."): + MagicEvent.NONE; + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + final MagicPermanent creature = (MagicPermanent)data[0]; + game.doAction(new MagicChangeStateAction(creature,MagicPermanentState.DestroyAtEndOfCombat,true)); + } + }; +}