From 717d215d3fc29cbe2ca2ddb155d3d0f3fb381e39 Mon Sep 17 00:00:00 2001 From: beholder Date: Wed, 21 Sep 2011 16:01:25 +0200 Subject: [PATCH] added Holy Day, Honor Guard, Horseshoe Crab --- resources/magic/data/cards.txt | 34 +++++++++++++++++++++ src/magic/card/Holy_Day.java | 37 +++++++++++++++++++++++ src/magic/card/Honor_Guard.java | 9 ++++++ src/magic/card/Horseshoe_Crab.java | 47 ++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 src/magic/card/Holy_Day.java create mode 100644 src/magic/card/Honor_Guard.java create mode 100644 src/magic/card/Horseshoe_Crab.java diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index eafe9451ad..580ad40bd9 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -1,3 +1,27 @@ +>Horseshoe Crab +image=http://magiccards.info/scans/en/10e/87.jpg +value=2 +rarity=C +type=Creature +subtype=Crab +color=u +converted=3 +cost={2}{U} +pt=1/3 +timing=main + +>Honor Guard +image=http://magiccards.info/scans/en/10e/23.jpg +value=1 +rarity=C +type=Creature +subtype=Human,Soldier +color=w +converted=1 +cost={W} +pt=1/1 +timing=main + >Highway Robber image=http://magiccards.info/scans/en/10e/150.jpg value=3 @@ -3602,6 +3626,16 @@ converted=1 cost={G} timing=pump +>Holy Day +image=http://magiccards.info/scans/en/10e/21.jpg +value=2 +rarity=C +type=Instant +color=w +converted=1 +cost={W} +timing=pump + >Guardians' Pledge image=http://magiccards.info/scans/en/m12/22.jpg value=3 diff --git a/src/magic/card/Holy_Day.java b/src/magic/card/Holy_Day.java new file mode 100644 index 0000000000..dbfb8ca4f0 --- /dev/null +++ b/src/magic/card/Holy_Day.java @@ -0,0 +1,37 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicPayedCost; +import magic.model.MagicPlayer; +import magic.model.MagicPlayerState; +import magic.model.action.MagicChangePlayerStateAction; +import magic.model.action.MagicMoveCardAction; +import magic.model.event.MagicEvent; +import magic.model.event.MagicSpellCardEvent; +import magic.model.stack.MagicCardOnStack; + +public class Holy_Day { + public static final MagicSpellCardEvent E = new MagicSpellCardEvent() { + @Override + public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { + final MagicPlayer player = cardOnStack.getController(); + return new MagicEvent( + cardOnStack.getCard(), + player, + new Object[]{cardOnStack,player}, + this, + "Prevent all combat damage that would be dealt this turn."); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] data, + final Object[] choiceResults) { + final MagicPlayer player = (MagicPlayer)data[1]; + game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0])); + game.doAction(new MagicChangePlayerStateAction(player,MagicPlayerState.PreventAllCombatDamage,true)); + game.doAction(new MagicChangePlayerStateAction(game.getOpponent(player),MagicPlayerState.PreventAllCombatDamage,true)); + } + }; +} diff --git a/src/magic/card/Honor_Guard.java b/src/magic/card/Honor_Guard.java new file mode 100644 index 0000000000..8956720026 --- /dev/null +++ b/src/magic/card/Honor_Guard.java @@ -0,0 +1,9 @@ +package magic.card; + +import magic.model.MagicManaCost; +import magic.model.event.MagicPermanentActivation; +import magic.model.event.MagicPumpActivation; + +public class Honor_Guard { + public static final MagicPermanentActivation A = new MagicPumpActivation(MagicManaCost.WHITE,0,1); +} diff --git a/src/magic/card/Horseshoe_Crab.java b/src/magic/card/Horseshoe_Crab.java new file mode 100644 index 0000000000..2194d4b0e1 --- /dev/null +++ b/src/magic/card/Horseshoe_Crab.java @@ -0,0 +1,47 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicManaCost; +import magic.model.MagicPayedCost; +import magic.model.MagicPermanent; +import magic.model.MagicSource; +import magic.model.action.MagicUntapAction; +import magic.model.condition.MagicCondition; +import magic.model.condition.MagicSingleActivationCondition; +import magic.model.event.MagicActivationHints; +import magic.model.event.MagicEvent; +import magic.model.event.MagicPayManaCostEvent; +import magic.model.event.MagicPermanentActivation; +import magic.model.event.MagicTiming; + +public class Horseshoe_Crab { + public static final MagicPermanentActivation A = new MagicPermanentActivation( + new MagicCondition[]{ + MagicCondition.TAPPED_CONDITION, + MagicManaCost.BLUE.getCondition(), + new MagicSingleActivationCondition()}, + new MagicActivationHints(MagicTiming.Tapping), + "Untap") { + @Override + public MagicEvent[] getCostEvent(final MagicSource source) { + return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.BLUE)}; + } + @Override + public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) { + return new MagicEvent( + source, + source.getController(), + new Object[]{source}, + this, + "Untap " + source + "."); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] data, + final Object[] choiceResults) { + game.doAction(new MagicUntapAction((MagicPermanent)data[0])); + } + }; +}