convert from java code to groovy code

master
melvin 2013-05-19 16:02:35 +08:00
parent 8fe2886b5a
commit fbc10c3885
3 changed files with 28 additions and 46 deletions

View File

@ -0,0 +1,27 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicKickerChoice(
MagicTargetChoice.TARGET_CREATURE,
MagicManaCost.create("{2}{U}"),
true,
true
),
MagicBounceTargetPicker.getInstance(),
this,
"Return target creature\$ to its owner's hand."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicRemoveFromPlayAction(creature,MagicLocationType.OwnersHand));
}
});
}
}
]

View File

@ -8,4 +8,4 @@ type=Sorcery
cost={2}{U}
ability=replicate
timing=removal
requires_card_code
requires_groovy_code

View File

@ -1,45 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.action.MagicPermanentAction;
import magic.model.action.MagicRemoveFromPlayAction;
import magic.model.choice.MagicKickerChoice;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicBounceTargetPicker;
public class Vacuumelt {
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(
final MagicCardOnStack cardOnStack,
final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicKickerChoice(
MagicTargetChoice.TARGET_CREATURE,
MagicManaCost.create("{2}{U}"),
true,
true),
MagicBounceTargetPicker.getInstance(),
this,
"Return target creature$ to its owner's hand.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicRemoveFromPlayAction(creature,MagicLocationType.OwnersHand));
}
});
}
};
}