replace card code for Essence Scatter with effect property in card script

master
melvin 2012-08-26 23:10:51 +08:00
parent f42cc187ef
commit 6b7cffc7d2
2 changed files with 1 additions and 42 deletions

View File

@ -6,4 +6,4 @@ rarity=C
type=Instant
cost={1}{U}
timing=counter
requires_card_code
effect=Counter target creature 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 Essence_Scatter {
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_CREATURE_SPELL,
new Object[]{cardOnStack},
this,
"Counter target creature 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));
}
});
}
};
}