added Shattering Pulse and Lim-Dul the Necromancer

master
beholder 2011-10-29 18:48:01 +02:00
parent 5b376d7690
commit c54a476046
4 changed files with 204 additions and 0 deletions

View File

@ -17750,3 +17750,28 @@ color=r
converted=1
cost={R}
timing=pump
>Shattering Pulse
url=http://magiccards.info/ex/en/102.html
image=http://magiccards.info/scans/en/ex/102.jpg
value=2
removal=1
rarity=C
type=Instant
color=r
converted=2
cost={1}{R}
timing=removal
>Lim-Dul the Necromancer
url=http://magiccards.info/ts/en/114.html
image=http://magiccards.info/scans/en/ts/114.jpg
value=5
rarity=R
type=Legendary,Creature
subtype=Human,Wizard
color=b
converted=7
cost={5}{B}{B}
pt=4/4
timing=fmain

View File

@ -0,0 +1,119 @@
package magic.card;
import java.util.EnumSet;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicSource;
import magic.model.MagicSubType;
import magic.model.action.MagicAddStaticAction;
import magic.model.action.MagicPermanentAction;
import magic.model.action.MagicPlayCardAction;
import magic.model.action.MagicRegenerateAction;
import magic.model.action.MagicRemoveCardAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicPayManaCostChoice;
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.mstatic.MagicLayer;
import magic.model.mstatic.MagicStatic;
import magic.model.target.MagicRegenerateTargetPicker;
import magic.model.trigger.MagicWhenOtherPutIntoGraveyardFromPlayTrigger;
public class Lim_Dul_the_Necromancer {
private static final MagicStatic Zombie = new MagicStatic(MagicLayer.Type) {
@Override
public EnumSet<MagicSubType> getSubTypeFlags(final MagicPermanent permanent,final EnumSet<MagicSubType> flags) {
final EnumSet<MagicSubType> mod = flags.clone();
mod.add(MagicSubType.Zombie);
return mod;
}
};
public static final MagicWhenOtherPutIntoGraveyardFromPlayTrigger T = new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
final MagicPlayer player = permanent.getController();
final MagicPlayer otherController = otherPermanent.getController();
return (otherController != player &&
otherPermanent.isCreature(game)) ?
new MagicEvent(
permanent,
player,
new MagicMayChoice(
"You may pay {1}{B}.",
new MagicPayManaCostChoice(MagicManaCost.ONE_BLACK)),
new Object[]{player,otherPermanent.getCard()},
this,
"You may$ pay {1}{B}$. If you do, return " + otherPermanent +
" to the battlefield under your control. If it's a " +
"creature, it's a Zombie in addition to its other creature types."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
final MagicCard card = (MagicCard)data[1];
if (card.getOwner().getGraveyard().contains(card)) {
final MagicPlayCardAction action = new MagicPlayCardAction(card,(MagicPlayer)data[0],MagicPlayCardAction.NONE);
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
game.doAction(action);
final MagicPermanent permanent = action.getPermanent();
if (permanent.isCreature(game)) {
game.doAction(new MagicAddStaticAction(permanent,Zombie));
}
}
}
}
};
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{MagicManaCost.ONE_BLACK.getCondition()},
new MagicActivationHints(MagicTiming.Pump,true),
"Regen") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.ONE_BLACK)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getController(),
MagicTargetChoice.POS_TARGET_ZOMBIE,
MagicRegenerateTargetPicker.getInstance(),
MagicEvent.NO_DATA,
this,
"Regenerate target Zombie$.");
}
@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 MagicRegenerateAction(creature));
}
});
}
};
}

View File

@ -0,0 +1,57 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.action.MagicDestroyAction;
import magic.model.action.MagicMoveCardAction;
import magic.model.action.MagicPermanentAction;
import magic.model.choice.MagicBuybackChoice;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicDestroyTargetPicker;
public class Shattering_Pulse {
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
new MagicBuybackChoice(
MagicTargetChoice.TARGET_ARTIFACT,
MagicManaCost.THREE),
new MagicDestroyTargetPicker(false),
new Object[]{cardOnStack},
this,
"Destroy target artifact$. If the buyback cost was payed$, " +
"return " + cardOnStack + " to its owner's hand as it resolves.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack = (MagicCardOnStack)data[0];
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicDestroyAction(permanent));
}
});
if (MagicBuybackChoice.isYesChoice(choiceResults[1])) {
game.doAction(new MagicMoveCardAction(
cardOnStack.getCard(),
MagicLocationType.Stack,
MagicLocationType.OwnersHand));
} else {
game.doAction(new MagicMoveCardAction(cardOnStack));
}
}
};
}

View File

@ -242,6 +242,9 @@ public class MagicTargetChoice extends MagicChoice {
public static final MagicTargetChoice POS_TARGET_INSECT_RAT_SPIDER_OR_SQUIRREL =
new MagicTargetChoice(MagicTargetFilter.TARGET_INSECT_RAT_SPIDER_OR_SQUIRREL,true,MagicTargetHint.Positive,
"target Insect, Rat, Spider, or Squirrel");
public static final MagicTargetChoice POS_TARGET_ZOMBIE =
new MagicTargetChoice(MagicTargetFilter.TARGET_ZOMBIE,true,MagicTargetHint.Positive,
"target Zombie");
private static final MagicTargetChoice SACRIFICE_PERMANENT=
new MagicTargetChoice(MagicTargetFilter.TARGET_PERMANENT_YOU_CONTROL,false,MagicTargetHint.None,"a permanent to sacrifice");
public static final MagicTargetChoice SACRIFICE_CREATURE=