diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 035da9f731..0fab4b49dd 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -7424,6 +7424,16 @@ converted=3 cost={2}{G} timing=enchantment +>Aura Shards +image=http://magiccards.info/scans/en/cmd/182.jpg +value=4 +rarity=U +type=Enchantment +color=gw +converted=3 +cost={1}{G}{W} +timing=enchantment + >Force Spike image=http://magiccards.info/scans/en/7e/76.jpg value=3 diff --git a/src/magic/card/Aura_Shards.java b/src/magic/card/Aura_Shards.java new file mode 100644 index 0000000000..70ea860502 --- /dev/null +++ b/src/magic/card/Aura_Shards.java @@ -0,0 +1,49 @@ +package magic.card; + +import magic.model.MagicGame; +import magic.model.MagicPermanent; +import magic.model.MagicPlayer; +import magic.model.action.MagicDestroyAction; +import magic.model.action.MagicPermanentAction; +import magic.model.choice.MagicMayChoice; +import magic.model.choice.MagicTargetChoice; +import magic.model.event.MagicEvent; +import magic.model.target.MagicDestroyTargetPicker; +import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger; + +public class Aura_Shards { + public static final MagicWhenOtherComesIntoPlayTrigger T = new MagicWhenOtherComesIntoPlayTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) { + final MagicPlayer player = permanent.getController(); + return (otherPermanent.isCreature() && + otherPermanent.getController() == player) ? + new MagicEvent( + permanent, + player, + new MagicMayChoice( + "You may destroy target artifact or enchantment.", + MagicTargetChoice.NEG_TARGET_ARTIFACT_OR_ENCHANTMENT), + new MagicDestroyTargetPicker(false), + MagicEvent.NO_DATA, + this, + "You may$ destroy target artifact or enchantment$."): + null; + } + + @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 permanent) { + game.doAction(new MagicDestroyAction(permanent)); + } + }); + } + } + }; +}