replace card code for Victim of Night with effect property in card script

master
melvin 2012-08-26 22:43:25 +08:00
parent 7fe22821e9
commit 6035f493a1
3 changed files with 3 additions and 43 deletions

View File

@ -8,4 +8,4 @@ rarity=C
type=Instant
cost={B}{B}
timing=removal
requires_card_code
effect=Destroy target non-Vampire, non-Werewolf, non-Zombie creature

View File

@ -1,42 +0,0 @@
package magic.card;
import magic.model.MagicGame;
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.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicDestroyTargetPicker;
public class Victim_of_Night {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
MagicTargetChoice.NEG_TARGET_NONVAMPIRE_NONWEREWOLF_NONZOMBIE,
new MagicDestroyTargetPicker(false),
new Object[]{cardOnStack},
this,
"Destroy target non-Vampire, non-Werewolf, non-Zombie creature$.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicDestroyAction(creature));
}
});
}
};
}

View File

@ -511,6 +511,8 @@ public class MagicTargetChoice extends MagicChoice {
factory.put("neg target enchantment ", NEG_TARGET_ENCHANTMENT);
factory.put("neg target creature with power 4 or greater", NEG_TARGET_CREATURE_POWER_4_OR_MORE);
factory.put("neg target creature with flying", NEG_TARGET_CREATURE_WITH_FLYING);
factory.put("neg target non-vampire, non-werewolf, non-zombie creature", NEG_TARGET_NONVAMPIRE_NONWEREWOLF_NONZOMBIE);
}
public static MagicTargetChoice build(String arg) {