replace card code for Demystify with effect property in card script
parent
9b56af4f19
commit
1d4c07e8de
|
@ -7,4 +7,4 @@ rarity=C
|
|||
type=Instant
|
||||
cost={W}
|
||||
timing=removal
|
||||
requires_card_code
|
||||
effect=Destroy target enchantment
|
||||
|
|
|
@ -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 Demystify {
|
||||
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_ENCHANTMENT,
|
||||
new MagicDestroyTargetPicker(false),
|
||||
new Object[]{cardOnStack},
|
||||
this,
|
||||
"Destroy target enchantment$.");
|
||||
}
|
||||
@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 permanent) {
|
||||
game.doAction(new MagicDestroyAction(permanent));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
|
@ -506,6 +506,7 @@ public class MagicTargetChoice extends MagicChoice {
|
|||
factory.put("neg target tapped creature", NEG_TARGET_TAPPED_CREATURE);
|
||||
factory.put("neg target spirit or enchantment", NEG_TARGET_SPIRIT_OR_ENCHANTMENT);
|
||||
factory.put("neg target permanent", NEG_TARGET_PERMANENT);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue