convert from java code to groovy code
parent
a7f7b76c99
commit
06e1de1c32
|
@ -0,0 +1,24 @@
|
||||||
|
[
|
||||||
|
new MagicWhenComesIntoPlayTrigger() {
|
||||||
|
@Override
|
||||||
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
|
||||||
|
return MagicCondition.METALCRAFT_CONDITION.accept(permanent) ?
|
||||||
|
new MagicEvent(
|
||||||
|
permanent,
|
||||||
|
MagicTargetChoice.TARGET_CREATURE,
|
||||||
|
MagicBounceTargetPicker.getInstance(),
|
||||||
|
this,
|
||||||
|
"Return target creature\$ to its owner's hand."
|
||||||
|
) :
|
||||||
|
MagicEvent.NONE;
|
||||||
|
}
|
||||||
|
@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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
|
@ -9,4 +9,4 @@ cost={3}{U}
|
||||||
pt=2/2
|
pt=2/2
|
||||||
ability=flying
|
ability=flying
|
||||||
timing=main
|
timing=main
|
||||||
requires_card_code
|
requires_groovy_code
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
package magic.card;
|
|
||||||
|
|
||||||
import magic.model.MagicGame;
|
|
||||||
import magic.model.MagicLocationType;
|
|
||||||
import magic.model.MagicPermanent;
|
|
||||||
import magic.model.MagicPlayer;
|
|
||||||
import magic.model.action.MagicPermanentAction;
|
|
||||||
import magic.model.action.MagicRemoveFromPlayAction;
|
|
||||||
import magic.model.choice.MagicTargetChoice;
|
|
||||||
import magic.model.condition.MagicCondition;
|
|
||||||
import magic.model.event.MagicEvent;
|
|
||||||
import magic.model.target.MagicBounceTargetPicker;
|
|
||||||
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
|
|
||||||
|
|
||||||
public class Lumengrid_Drake {
|
|
||||||
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
|
|
||||||
@Override
|
|
||||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
|
|
||||||
return MagicCondition.METALCRAFT_CONDITION.accept(permanent) ?
|
|
||||||
new MagicEvent(
|
|
||||||
permanent,
|
|
||||||
MagicTargetChoice.TARGET_CREATURE,
|
|
||||||
MagicBounceTargetPicker.getInstance(),
|
|
||||||
this,
|
|
||||||
"Return target creature$ to its owner's hand."
|
|
||||||
) :
|
|
||||||
MagicEvent.NONE;
|
|
||||||
}
|
|
||||||
@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));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue