added Halt Order and Hoard-Smelter Dragon

master
beholder 2011-10-04 14:06:25 +02:00
parent b3176af468
commit 5423e74f8d
5 changed files with 143 additions and 0 deletions

View File

@ -11887,3 +11887,26 @@ type=Artifact
converted=2
cost={2}
timing=artifact
>Halt Order
image=http://magiccards.info/scans/en/som/34.jpg
value=3
rarity=U
type=Instant
color=u
converted=3
cost={2}{U}
timing=counter
>Hoard-Smelter Dragon
image=http://magiccards.info/scans/en/som/93.jpg
value=5
rarity=R
type=Creature
subtype=Dragon
color=r
converted=6
cost={4}{R}{R}
pt=5/5
ability=flying
timing=main

View File

@ -0,0 +1,43 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPlayer;
import magic.model.action.MagicCardOnStackAction;
import magic.model.action.MagicCounterItemOnStackAction;
import magic.model.action.MagicDrawAction;
import magic.model.action.MagicMoveCardAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Halt_Order {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player = cardOnStack.getController();
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_ARTIFACT_SPELL,
new Object[]{cardOnStack,player},
this,
"Counter target artifact spell$. Draw a card.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
event.processTargetCardOnStack(game,choiceResults,0,new MagicCardOnStackAction() {
public void doAction(final MagicCardOnStack targetSpell) {
game.doAction(new MagicCounterItemOnStackAction(targetSpell));
game.doAction(new MagicDrawAction((MagicPlayer)data[1],1));
}
});
}
};
}

View File

@ -0,0 +1,58 @@
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.MagicDestroyAction;
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.MagicPayManaCostEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicTiming;
import magic.model.target.MagicDestroyTargetPicker;
public class Hoard_Smelter_Dragon {
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{MagicManaCost.THREE_RED.getCondition()},
new MagicActivationHints(MagicTiming.Removal),
"Destroy") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.THREE_RED)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getController(),
MagicTargetChoice.TARGET_ARTIFACT,
new MagicDestroyTargetPicker(false),
new Object[]{source},
this,
"Destroy target artifact$. " + source + " gets +X/+0 " +
"until end of turn, where X is that artifact's converted mana cost.");
}
@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 permanent) {
game.doAction(new MagicDestroyAction(permanent));
game.doAction(new MagicChangeTurnPTAction(
(MagicPermanent)data[0],
permanent.getCardDefinition().getConvertedCost(),
0));
}
});
}
};
}

View File

@ -46,6 +46,9 @@ public class MagicTargetChoice extends MagicChoice {
public static final MagicTargetChoice NEG_TARGET_INSTANT_OR_SORCERY_SPELL=
new MagicTargetChoice(MagicTargetFilter.TARGET_INSTANT_OR_SORCERY_SPELL,true,MagicTargetHint.Negative,
"target instant or sorcery spell");
public static final MagicTargetChoice NEG_TARGET_ARTIFACT_SPELL =
new MagicTargetChoice(MagicTargetFilter.TARGET_ARTIFACT_SPELL,true,MagicTargetHint.Negative,
"target artifact spell");
public static final MagicTargetChoice TARGET_PLAYER=
new MagicTargetChoice(MagicTargetFilter.TARGET_PLAYER,true,MagicTargetHint.None,
"target player");
@ -90,6 +93,8 @@ public class MagicTargetChoice extends MagicChoice {
new MagicTargetChoice(MagicTargetFilter.TARGET_NONLAND_PERMANENT,true,MagicTargetHint.Negative,"target nonland permanent");
public static final MagicTargetChoice TARGET_ARTIFACT_YOU_CONTROL=
new MagicTargetChoice(MagicTargetFilter.TARGET_ARTIFACT_YOU_CONTROL,true,MagicTargetHint.None,"target artifact you control");
public static final MagicTargetChoice TARGET_ARTIFACT =
new MagicTargetChoice(MagicTargetFilter.TARGET_ARTIFACT,true,MagicTargetHint.None,"target artifact");
public static final MagicTargetChoice NEG_TARGET_ARTIFACT=
new MagicTargetChoice(MagicTargetFilter.TARGET_ARTIFACT,true,MagicTargetHint.Negative,"target artifact");
public static final MagicTargetChoice TARGET_NONCREATURE_ARTIFACT=

View File

@ -104,6 +104,20 @@ public interface MagicTargetFilter {
}
};
MagicTargetFilter TARGET_ARTIFACT_SPELL = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
if (target.isSpell()) {
final MagicCardOnStack cardOnStack = (MagicCardOnStack)target;
final MagicCardDefinition card = cardOnStack.getCardDefinition();
return card.isArtifact();
}
return false;
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Stack;
}
};
MagicTargetFilter TARGET_PLAYER=new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {