From 1c6f2098c99887ea4e928dbfb3032ed1d3cc7933 Mon Sep 17 00:00:00 2001 From: melvin Date: Fri, 17 Aug 2012 23:50:11 +0800 Subject: [PATCH] added code for Pendelhaven's second ability --- .../{incomplete => scripts}/Pendelhaven.txt | 0 src/magic/card/Pendelhaven.java | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+) rename release/Magarena/{incomplete => scripts}/Pendelhaven.txt (100%) create mode 100644 src/magic/card/Pendelhaven.java diff --git a/release/Magarena/incomplete/Pendelhaven.txt b/release/Magarena/scripts/Pendelhaven.txt similarity index 100% rename from release/Magarena/incomplete/Pendelhaven.txt rename to release/Magarena/scripts/Pendelhaven.txt diff --git a/src/magic/card/Pendelhaven.java b/src/magic/card/Pendelhaven.java new file mode 100644 index 0000000000..1d22bc671e --- /dev/null +++ b/src/magic/card/Pendelhaven.java @@ -0,0 +1,52 @@ +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.MagicChangeTurnPTAction; +import magic.model.action.MagicPermanentAction; +import magic.model.choice.MagicTargetChoice; +import magic.model.condition.MagicCondition; +import magic.model.event.MagicActivationHints; +import magic.model.event.MagicEvent; +import magic.model.event.MagicTapEvent; +import magic.model.event.MagicPermanentActivation; +import magic.model.event.MagicTiming; +import magic.model.target.MagicPumpTargetPicker; + +public class Pendelhaven { + public static final MagicPermanentActivation A = new MagicPermanentActivation( + new MagicCondition[]{MagicCondition.CAN_TAP_CONDITION}, + new MagicActivationHints(MagicTiming.Pump,true), + "Pump") { + @Override + public MagicEvent[] getCostEvent(final MagicSource source) { + return new MagicEvent[]{new MagicTapEvent((MagicPermanent)source)}; + } + @Override + public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) { + return new MagicEvent( + source, + source.getController(), + MagicTargetChoice.POS_TARGET_1_1_CREATURE, + MagicPumpTargetPicker.create(), + MagicEvent.NO_DATA, + this, + "Target 1/1 creature$ gets +1/+2 until end of turn."); + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object[] data, + final Object[] choiceResults) { + event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() { + public void doAction(final MagicPermanent creature) { + game.doAction(new MagicChangeTurnPTAction(creature,1,2)); + } + }); + } + }; +}