From cb72e3be5951218e801b3f2f5fd6ec84325aef73 Mon Sep 17 00:00:00 2001 From: beholder Date: Mon, 24 Oct 2011 08:23:12 +0200 Subject: [PATCH] added Nantuko Monastery and Treetop Village --- resources/magic/data/cards.txt | 19 +++++ src/magic/card/Dread_Statuary.java | 2 +- src/magic/card/Nantuko_Monastery.java | 96 ++++++++++++++++++++++++++ src/magic/card/Treetop_Village.java | 99 +++++++++++++++++++++++++++ src/magic/model/MagicManaCost.java | 1 + 5 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 src/magic/card/Nantuko_Monastery.java create mode 100644 src/magic/card/Treetop_Village.java diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 5fb21c86de..7a2cf866c6 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -16841,3 +16841,22 @@ type=Land mana=r3 timing=land mana_or_combat + +>Nantuko Monastery +url=http://magiccards.info/arc/en/131.html +image=http://magiccards.info/scans/en/arc/131.jpg +value=4 +rarity=U +type=Land +timing=land +mana_or_combat + +>Treetop Village +url=http://magiccards.info/10e/en/361.html +image=http://magiccards.info/scans/en/10e/361.jpg +value=4 +rarity=U +type=Land +mana=g3 +timing=land +mana_or_combat diff --git a/src/magic/card/Dread_Statuary.java b/src/magic/card/Dread_Statuary.java index d4a8589d5b..6e81b3d03a 100644 --- a/src/magic/card/Dread_Statuary.java +++ b/src/magic/card/Dread_Statuary.java @@ -62,7 +62,7 @@ public class Dread_Statuary { new Object[]{source}, this, "Until end of turn, " + source + - " becomes a 4/2 Golem artifact creature until end of turn. " + + " becomes a 4/2 Golem artifact creature. " + "It's still a land."); } @Override diff --git a/src/magic/card/Nantuko_Monastery.java b/src/magic/card/Nantuko_Monastery.java new file mode 100644 index 0000000000..7536331770 --- /dev/null +++ b/src/magic/card/Nantuko_Monastery.java @@ -0,0 +1,96 @@ +package magic.card; + +import magic.model.MagicAbility; +import magic.model.MagicColor; +import magic.model.MagicGame; +import magic.model.MagicManaCost; +import magic.model.MagicManaType; +import magic.model.MagicPayedCost; +import magic.model.MagicPermanent; +import magic.model.MagicPowerToughness; +import magic.model.MagicSource; +import magic.model.MagicSubType; +import magic.model.MagicType; +import magic.model.action.MagicBecomesCreatureAction; +import magic.model.condition.MagicCondition; +import magic.model.event.MagicActivationHints; +import magic.model.event.MagicEvent; +import magic.model.event.MagicManaActivation; +import magic.model.event.MagicPayManaCostEvent; +import magic.model.event.MagicPermanentActivation; +import magic.model.event.MagicTapManaActivation; +import magic.model.event.MagicTiming; +import magic.model.mstatic.MagicStatic; +import magic.model.mstatic.MagicLayer; + +import java.util.Arrays; +import java.util.EnumSet; + +public class Nantuko_Monastery { + private static final MagicStatic PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) { + @Override + public void getPowerToughness(final MagicGame game,final MagicPermanent permanent,final MagicPowerToughness pt) { + pt.set(4,4); + } + }; + private static final MagicStatic AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) { + @Override + public long getAbilityFlags(final MagicGame game,final MagicPermanent permanent,final long flags) { + return flags|MagicAbility.FirstStrike.getMask(); + } + }; + private static final MagicStatic ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) { + @Override + public EnumSet getSubTypeFlags(final MagicPermanent permanent,final EnumSet flags) { + final EnumSet mod = flags.clone(); + mod.add(MagicSubType.Insect); + mod.add(MagicSubType.Monk); + return mod; + } + @Override + public int getTypeFlags(final MagicPermanent permanent,final int flags) { + return flags | MagicType.Creature.getMask(); + } + }; + private static final MagicStatic C = new MagicStatic(MagicLayer.Color, MagicStatic.UntilEOT) { + @Override + public int getColorFlags(final MagicPermanent permanent,final int flags) { + return MagicColor.Green.getMask() | MagicColor.White.getMask(); + } + }; + + public static final MagicPermanentActivation A = new MagicPermanentActivation( + new MagicCondition[]{ + MagicCondition.THRESHOLD_CONDITION, + MagicManaCost.GREEN_WHITE.getCondition(), + }, + new MagicActivationHints(MagicTiming.Animate), + "Animate") { + @Override + public MagicEvent[] getCostEvent(final MagicSource source) { + return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.GREEN_WHITE)}; + } + @Override + public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) { + return new MagicEvent( + source, + source.getController(), + new Object[]{source}, + this, + "Until end of turn, " + source + + " becomes a 4/4 green and white Insect Monk creature with first strike. " + + "It's still a land."); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] data, + final Object[] choiceResults) { + game.doAction(new MagicBecomesCreatureAction((MagicPermanent)data[0],PT,AB,ST,C)); + } + }; + + public static final MagicManaActivation M = new MagicTapManaActivation( + Arrays.asList(MagicManaType.Colorless),0); +} diff --git a/src/magic/card/Treetop_Village.java b/src/magic/card/Treetop_Village.java new file mode 100644 index 0000000000..241e4a2802 --- /dev/null +++ b/src/magic/card/Treetop_Village.java @@ -0,0 +1,99 @@ +package magic.card; + +import magic.model.MagicAbility; +import magic.model.MagicColor; +import magic.model.MagicGame; +import magic.model.MagicManaCost; +import magic.model.MagicManaType; +import magic.model.MagicPayedCost; +import magic.model.MagicPermanent; +import magic.model.MagicPowerToughness; +import magic.model.MagicSource; +import magic.model.MagicSubType; +import magic.model.MagicType; +import magic.model.action.MagicBecomesCreatureAction; +import magic.model.condition.MagicArtificialCondition; +import magic.model.condition.MagicCondition; +import magic.model.event.MagicActivationHints; +import magic.model.event.MagicEvent; +import magic.model.event.MagicManaActivation; +import magic.model.event.MagicPayManaCostEvent; +import magic.model.event.MagicPermanentActivation; +import magic.model.event.MagicTapManaActivation; +import magic.model.event.MagicTiming; +import magic.model.trigger.MagicTappedIntoPlayTrigger; +import magic.model.trigger.MagicTrigger; +import magic.model.mstatic.MagicStatic; +import magic.model.mstatic.MagicLayer; + +import java.util.Arrays; +import java.util.EnumSet; + +public class Treetop_Village { + private static final MagicStatic PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) { + @Override + public void getPowerToughness(final MagicGame game,final MagicPermanent permanent,final MagicPowerToughness pt) { + pt.set(3,3); + } + }; + private static final MagicStatic AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) { + @Override + public long getAbilityFlags(final MagicGame game,final MagicPermanent permanent,final long flags) { + return flags|MagicAbility.Trample.getMask(); + } + }; + private static final MagicStatic ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) { + @Override + public EnumSet getSubTypeFlags(final MagicPermanent permanent,final EnumSet flags) { + final EnumSet mod = flags.clone(); + mod.add(MagicSubType.Ape); + return mod; + } + @Override + public int getTypeFlags(final MagicPermanent permanent,final int flags) { + return flags|MagicType.Creature.getMask(); + } + }; + private static final MagicStatic C = new MagicStatic(MagicLayer.Color, MagicStatic.UntilEOT) { + @Override + public int getColorFlags(final MagicPermanent permanent,final int flags) { + return MagicColor.Green.getMask(); + } + }; + + public static final MagicPermanentActivation A = new MagicPermanentActivation( + new MagicCondition[]{new MagicArtificialCondition( + MagicManaCost.ONE_GREEN.getCondition(), + MagicManaCost.GREEN_GREEN.getCondition())}, + new MagicActivationHints(MagicTiming.Animate), + "Animate") { + @Override + public MagicEvent[] getCostEvent(final MagicSource source) { + return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.ONE_GREEN)}; + } + @Override + public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) { + return new MagicEvent( + source, + source.getController(), + new Object[]{source}, + this, + "Until end of turn, " + source + + " becomes a 3/3 green Ape creature with trample. " + + "It's still a land."); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] data, + final Object[] choiceResults) { + game.doAction(new MagicBecomesCreatureAction((MagicPermanent)data[0],PT,AB,ST,C)); + } + }; + + public static final MagicTrigger T = new MagicTappedIntoPlayTrigger(); + + public static final MagicManaActivation M = new MagicTapManaActivation( + Arrays.asList(MagicManaType.Green),1); +} diff --git a/src/magic/model/MagicManaCost.java b/src/magic/model/MagicManaCost.java index 1e1bb9f129..1536744830 100644 --- a/src/magic/model/MagicManaCost.java +++ b/src/magic/model/MagicManaCost.java @@ -60,6 +60,7 @@ public class MagicManaCost { public static final MagicManaCost THREE_GREEN=MagicManaCost.createCost("{3}{G}"); public static final MagicManaCost TWO_GREEN_GREEN=MagicManaCost.createCost("{2}{G}{G}"); public static final MagicManaCost TWO_GREEN_GREEN_GREEN=MagicManaCost.createCost("{2}{G}{G}{G}"); + public static final MagicManaCost GREEN_GREEN=MagicManaCost.createCost("{G}{G}"); public static final MagicManaCost X_RED=MagicManaCost.createCost("{X}{R}"); public static final MagicManaCost ONE_RED=MagicManaCost.createCost("{1}{R}"); public static final MagicManaCost TWO_RED=MagicManaCost.createCost("{2}{R}");