From cc05dd096f5c82efd821bffc49579446d5bd8b0d Mon Sep 17 00:00:00 2001 From: beholder Date: Sun, 18 Mar 2012 09:49:05 +0100 Subject: [PATCH] added Magnivore and Terravore --- release/Magarena/scripts/Magnivore.txt | 13 +++++++++++ release/Magarena/scripts/Terravore.txt | 13 +++++++++++ src/magic/card/Magnivore.java | 22 +++++++++++++++++++ src/magic/card/Terravore.java | 22 +++++++++++++++++++ src/magic/model/target/MagicTargetFilter.java | 18 +++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 release/Magarena/scripts/Magnivore.txt create mode 100644 release/Magarena/scripts/Terravore.txt create mode 100644 src/magic/card/Magnivore.java create mode 100644 src/magic/card/Terravore.java diff --git a/release/Magarena/scripts/Magnivore.txt b/release/Magarena/scripts/Magnivore.txt new file mode 100644 index 0000000000..9c495b9394 --- /dev/null +++ b/release/Magarena/scripts/Magnivore.txt @@ -0,0 +1,13 @@ +>Magnivore +url=http://magiccards.info/od/en/204.html +image=http://magiccards.info/scans/en/od/204.jpg +value=3 +rarity=R +type=Creature +subtype=Lhurgoyf +color=r +converted=4 +cost={2}{R}{R} +ability=haste +timing=fmain +requires_card_code diff --git a/release/Magarena/scripts/Terravore.txt b/release/Magarena/scripts/Terravore.txt new file mode 100644 index 0000000000..eac4a1a140 --- /dev/null +++ b/release/Magarena/scripts/Terravore.txt @@ -0,0 +1,13 @@ +>Terravore +url=http://magiccards.info/od/en/278.html +image=http://magiccards.info/scans/en/od/278.jpg +value=3 +rarity=R +type=Creature +subtype=Lhurgoyf +color=g +converted=3 +cost={1}{G}{G} +ability=trample +timing=main +requires_card_code diff --git a/src/magic/card/Magnivore.java b/src/magic/card/Magnivore.java new file mode 100644 index 0000000000..7b102ab7a1 --- /dev/null +++ b/src/magic/card/Magnivore.java @@ -0,0 +1,22 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicPlayer; +import magic.model.MagicPowerToughness; +import magic.model.target.MagicTargetFilter; +import magic.model.mstatic.MagicCDA; + +public class Magnivore { + public static final MagicCDA CDA = new MagicCDA() { + @Override + public void getPowerToughness( + final MagicGame game, + final MagicPlayer player, + final MagicPowerToughness pt) { + final int size = game.filterTargets( + player, + MagicTargetFilter.TARGET_SORCERY_CARD_FROM_ALL_GRAVEYARDS).size(); + pt.set(size, size); + } + }; +} diff --git a/src/magic/card/Terravore.java b/src/magic/card/Terravore.java new file mode 100644 index 0000000000..e0ec4d832b --- /dev/null +++ b/src/magic/card/Terravore.java @@ -0,0 +1,22 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicPlayer; +import magic.model.MagicPowerToughness; +import magic.model.target.MagicTargetFilter; +import magic.model.mstatic.MagicCDA; + +public class Terravore { + public static final MagicCDA CDA = new MagicCDA() { + @Override + public void getPowerToughness( + final MagicGame game, + final MagicPlayer player, + final MagicPowerToughness pt) { + final int size = game.filterTargets( + player, + MagicTargetFilter.TARGET_LAND_CARD_FROM_ALL_GRAVEYARDS).size(); + pt.set(size, size); + } + }; +} diff --git a/src/magic/model/target/MagicTargetFilter.java b/src/magic/model/target/MagicTargetFilter.java index 124c7fcee7..e19dfa6b09 100644 --- a/src/magic/model/target/MagicTargetFilter.java +++ b/src/magic/model/target/MagicTargetFilter.java @@ -1643,6 +1643,24 @@ public interface MagicTargetFilter { return targetType==MagicTargetType.Graveyard||targetType==MagicTargetType.OpponentsGraveyard; } }; + + MagicTargetFilter TARGET_SORCERY_CARD_FROM_ALL_GRAVEYARDS=new MagicTargetFilter() { + public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) { + return ((MagicCard)target).getCardDefinition().isSorcery(); + } + public boolean acceptType(final MagicTargetType targetType) { + return targetType==MagicTargetType.Graveyard||targetType==MagicTargetType.OpponentsGraveyard; + } + }; + + MagicTargetFilter TARGET_LAND_CARD_FROM_ALL_GRAVEYARDS=new MagicTargetFilter() { + public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) { + return ((MagicCard)target).getCardDefinition().isLand(); + } + public boolean acceptType(final MagicTargetType targetType) { + return targetType==MagicTargetType.Graveyard||targetType==MagicTargetType.OpponentsGraveyard; + } + }; MagicTargetFilter TARGET_ARTIFACT_OR_CREATURE_CARD_FROM_ALL_GRAVEYARDS=new MagicTargetFilter() { public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {