replace card code for Flashfreeze with effect property in card script

master
melvin 2012-08-26 23:04:42 +08:00
parent 4a46b4635a
commit b51e320774
3 changed files with 3 additions and 42 deletions

View File

@ -6,4 +6,4 @@ rarity=U
type=Instant
cost={1}{U}
timing=counter
requires_card_code
effect=Counter target red or green spell

View File

@ -1,41 +0,0 @@
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.MagicMoveCardAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Flashfreeze {
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_RED_GREEN_SPELL,
new Object[]{cardOnStack},
this,
"Counter target red or green spell$.");
}
@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));
}
});
}
};
}

View File

@ -513,7 +513,9 @@ public class MagicTargetChoice extends MagicChoice {
factory.put("neg target permanent", NEG_TARGET_PERMANENT);
factory.put("neg target enchantment", NEG_TARGET_ENCHANTMENT);
factory.put("neg target non-vampire, non-werewolf, non-zombie creature", NEG_TARGET_NONVAMPIRE_NONWEREWOLF_NONZOMBIE);
factory.put("neg target spell", NEG_TARGET_SPELL);
factory.put("neg target red or green spell", NEG_TARGET_RED_GREEN_SPELL);
}
public static MagicTargetChoice build(String arg) {