From f8ad4cfccf86df7864bdc75aa4621acfba7d2849 Mon Sep 17 00:00:00 2001 From: beholder Date: Wed, 19 Oct 2011 15:46:22 +0200 Subject: [PATCH] added Admonition Angel. corrected Cosi's Ravager --- resources/magic/data/cards.txt | 14 +++++ src/magic/card/Admonition_Angel.java | 92 ++++++++++++++++++++++++++++ src/magic/card/Cosi_s_Ravager.java | 2 +- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 src/magic/card/Admonition_Angel.java diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 9c590498e4..94624f3617 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -15661,3 +15661,17 @@ converted=4 cost={3}{B} pt=7/6 timing=main + +>Admonition Angel +url=http://magiccards.info/wwk/en/1.html +image=http://magiccards.info/scans/en/wwk/1.jpg +value=5 +rarity=M +type=Creature +subtype=Angel +color=w +converted=6 +cost={3}{W}{W}{W} +pt=6/6 +ability=flying +timing=main diff --git a/src/magic/card/Admonition_Angel.java b/src/magic/card/Admonition_Angel.java new file mode 100644 index 0000000000..c9d944f275 --- /dev/null +++ b/src/magic/card/Admonition_Angel.java @@ -0,0 +1,92 @@ +package magic.card; + +import magic.model.MagicCardList; +import magic.model.MagicGame; +import magic.model.MagicLocationType; +import magic.model.MagicPermanent; +import magic.model.MagicPlayer; +import magic.model.action.MagicExileUntilThisLeavesPlayAction; +import magic.model.action.MagicPermanentAction; +import magic.model.action.MagicReturnExiledUntilThisLeavesPlayAction; +import magic.model.choice.MagicChoice; +import magic.model.choice.MagicMayChoice; +import magic.model.choice.MagicTargetChoice; +import magic.model.event.MagicEvent; +import magic.model.target.MagicExileTargetPicker; +import magic.model.target.MagicTargetFilter; +import magic.model.target.MagicTargetHint; +import magic.model.trigger.MagicWhenLeavesPlayTrigger; +import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger; + +public class Admonition_Angel { + public static final MagicWhenOtherComesIntoPlayTrigger T1 = new MagicWhenOtherComesIntoPlayTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent played) { + final MagicPlayer player = permanent.getController(); + if (player == played.getController() && played.isLand()) { + final MagicTargetFilter targetFilter = + new MagicTargetFilter.MagicOtherPermanentTargetFilter( + MagicTargetFilter.TARGET_NONLAND_PERMANENT,permanent); + final MagicTargetChoice targetChoice = + new MagicTargetChoice( + targetFilter,true,MagicTargetHint.None,"another target nonland permanent"); + final MagicChoice mayChoice = + new MagicMayChoice( + player + " may exile another target nonland permanent.", + targetChoice); + return new MagicEvent( + permanent, + player, + mayChoice, + MagicExileTargetPicker.getInstance(), + new Object[]{permanent}, + this, + player + " may$ exile another target nonland permanent$."); + } + return MagicEvent.NONE; + } + + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + if (MagicMayChoice.isYesChoice(choiceResults[0])) { + event.processTargetPermanent(game,choiceResults,1,new MagicPermanentAction() { + public void doAction(final MagicPermanent target) { + game.doAction(new MagicExileUntilThisLeavesPlayAction((MagicPermanent)data[0],target)); + } + }); + } + } + }; + + public static final MagicWhenLeavesPlayTrigger T2 = new MagicWhenLeavesPlayTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPermanent data) { + if (permanent == data && + !permanent.getExiledCards().isEmpty()) { + final MagicCardList clist = new MagicCardList(permanent.getExiledCards()); + return new MagicEvent( + permanent, + permanent.getController(), + new Object[]{permanent}, + this, + clist.size() > 1 ? + "Return exiled cards to the battlefield." : + "Return " + clist.get(0) + " to the battlefield."); + } + return MagicEvent.NONE; + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + final MagicPermanent permanent = (MagicPermanent)data[0]; + game.doAction(new MagicReturnExiledUntilThisLeavesPlayAction(permanent,MagicLocationType.Play)); + } + }; +} diff --git a/src/magic/card/Cosi_s_Ravager.java b/src/magic/card/Cosi_s_Ravager.java index 13d09a1e18..a31367f3f3 100644 --- a/src/magic/card/Cosi_s_Ravager.java +++ b/src/magic/card/Cosi_s_Ravager.java @@ -28,7 +28,7 @@ public class Cosi_s_Ravager { new MagicDamageTargetPicker(1), new Object[]{permanent}, this, - player + " may have " + permanent + " deal 1 damage to target player"): + player + " may$ have " + permanent + " deal 1 damage to target player$"): MagicEvent.NONE; }