convert from java code to groovy code

master
melvin 2013-05-18 12:09:03 +08:00
parent a4ea8daecc
commit f13ce9879c
3 changed files with 24 additions and 35 deletions

View File

@ -0,0 +1,23 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_SPELL,
this,
"Counter target spell\$. If you do, put it on top of its owner's library."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetCardOnStack(game,new MagicCardOnStackAction() {
public void doAction(final MagicCardOnStack targetSpell) {
game.doAction(new MagicCounterItemOnStackAction(targetSpell,MagicLocationType.TopOfOwnersLibrary));
}
});
}
}
]

View File

@ -6,4 +6,4 @@ rarity=C
type=Instant type=Instant
cost={1}{U} cost={1}{U}
timing=counter timing=counter
requires_card_code requires_groovy_code

View File

@ -1,34 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicPayedCost;
import magic.model.action.MagicCardOnStackAction;
import magic.model.action.MagicCounterItemOnStackAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Memory_Lapse {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_SPELL,
this,
"Counter target spell$. If you do, put it on top of its owner's library.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetCardOnStack(game,new MagicCardOnStackAction() {
public void doAction(final MagicCardOnStack targetSpell) {
game.doAction(new MagicCounterItemOnStackAction(targetSpell,MagicLocationType.TopOfOwnersLibrary));
}
});
}
};
}