convert from java code to groovy code

master
melvin 2013-04-01 21:18:43 +08:00
parent c3d18330c4
commit 17683fc5e1
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.TARGET_PLAYER,
this,
"Target player$ draws three cards."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.doAction(new MagicDrawAction(player,3));
}
});
}
}
]

View File

@ -6,4 +6,4 @@ rarity=R
type=Instant type=Instant
cost={U} cost={U}
timing=draw timing=draw
requires_card_code requires_groovy_code

View File

@ -1,34 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPlayer;
import magic.model.action.MagicDrawAction;
import magic.model.action.MagicPlayerAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Ancestral_Recall {
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_PLAYER,
this,
"Target player$ draws three cards.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.doAction(new MagicDrawAction(player,3));
}
});
}
};
}