convert from java code to groovy code

master
melvin 2013-05-19 10:43:21 +08:00
parent 39bc21ec9a
commit c1bc40b1e6
3 changed files with 28 additions and 41 deletions

View File

@ -0,0 +1,27 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(3,true),
this,
"SN deals 3 damage to target creature or player\$. " +
"A creature dealt damage this way can't be regenerated this turn."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,3);
damage.setNoRegeneration();
game.doAction(new MagicDealDamageAction(damage));
}
});
}
}
]

View File

@ -7,4 +7,4 @@ rarity=C
type=Instant type=Instant
cost={1}{R} cost={1}{R}
timing=removal timing=removal
requires_card_code requires_groovy_code

View File

@ -1,40 +0,0 @@
package magic.card;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.action.MagicDealDamageAction;
import magic.model.action.MagicTargetAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicDamageTargetPicker;
import magic.model.target.MagicTarget;
public class Incinerate {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(3,true),
this,
"SN deals 3 damage to target creature or player$. " +
"A creature dealt damage this way can't be regenerated this turn.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,3);
damage.setNoRegeneration();
game.doAction(new MagicDealDamageAction(damage));
}
});
}
};
}