convert from java code to groovy code

master
melvin 2013-05-31 13:01:42 +08:00
parent 1f218900e7
commit e331b13e6d
2 changed files with 14 additions and 38 deletions

View File

@ -1,24 +1,5 @@
package magic.card;
import magic.model.MagicColor;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicPowerToughness;
import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicDealDamageAction;
import magic.model.action.MagicPlayerAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.mstatic.MagicLayer;
import magic.model.mstatic.MagicStatic;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicTargetFilter;
import magic.model.trigger.MagicWhenOtherSpellIsCastTrigger;
public class Balefire_Liege {
public static final MagicStatic S1 = new MagicStatic(
[
new MagicStatic(
MagicLayer.ModPT,
MagicTargetFilter.TARGET_RED_CREATURE_YOU_CONTROL) {
@Override
@ -29,8 +10,8 @@ public class Balefire_Liege {
public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return source != target;
}
};
public static final MagicStatic S2 = new MagicStatic(
},
new MagicStatic(
MagicLayer.ModPT,
MagicTargetFilter.TARGET_WHITE_CREATURE_YOU_CONTROL) {
@Override
@ -41,8 +22,8 @@ public class Balefire_Liege {
public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return source != target;
}
};
public static final MagicWhenOtherSpellIsCastTrigger T = new MagicWhenOtherSpellIsCastTrigger() {
},
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
return (permanent.isFriend(cardOnStack) &&
@ -51,14 +32,12 @@ public class Balefire_Liege {
permanent,
MagicTargetChoice.NEG_TARGET_PLAYER,
this,
"SN deals 3 damage to target player$."
"SN deals 3 damage to target player\$."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
final MagicDamage damage=new MagicDamage(event.getSource(),player,3);
@ -66,9 +45,8 @@ public class Balefire_Liege {
}
});
}
};
public static final MagicWhenOtherSpellIsCastTrigger T2 = new MagicWhenOtherSpellIsCastTrigger() {
},
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
return (permanent.isFriend(cardOnStack) &&
@ -81,10 +59,8 @@ public class Balefire_Liege {
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
}
};
}
}
]

View File

@ -9,4 +9,4 @@ cost={2}{R/W}{R/W}{R/W}
pt=2/4
static=player
timing=fmain
requires_card_code
requires_groovy_code