convert from java code to groovy code
parent
a8bcb65cbc
commit
c66a78046c
|
@ -0,0 +1,23 @@
|
|||
[
|
||||
new MagicWhenAttacksTrigger() {
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
|
||||
final MagicPlayer player=permanent.getController();
|
||||
return (creature.getController()==player&&player.getNrOfAttackers()==1)?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
player,
|
||||
creature,
|
||||
this,
|
||||
creature+" gains lifelink until end of turn."
|
||||
):
|
||||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
game.doAction(new MagicSetAbilityAction(event.getRefPermanent(),MagicAbility.LifeLink));
|
||||
}
|
||||
}
|
||||
]
|
|
@ -9,4 +9,4 @@ cost={3}{W}{W}
|
|||
pt=4/4
|
||||
ability=flying,exalted
|
||||
timing=fmain
|
||||
requires_card_code
|
||||
requires_groovy_code
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package magic.card;
|
||||
|
||||
import magic.model.MagicAbility;
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.action.MagicSetAbilityAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.trigger.MagicWhenAttacksTrigger;
|
||||
|
||||
|
||||
public class Battlegrace_Angel {
|
||||
public static final MagicWhenAttacksTrigger T = new MagicWhenAttacksTrigger() {
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
|
||||
final MagicPlayer player=permanent.getController();
|
||||
return (creature.getController()==player&&player.getNrOfAttackers()==1)?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
player,
|
||||
creature,
|
||||
this,
|
||||
creature+" gains lifelink until end of turn."):
|
||||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
game.doAction(new MagicSetAbilityAction(event.getRefPermanent(),MagicAbility.LifeLink));
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue