convert from java code to groovy code
parent
a4ea8daecc
commit
f13ce9879c
|
@ -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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
|
@ -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
|
||||||
|
|
|
@ -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));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue