simplify groovy code

master
melvin 2013-10-20 11:27:26 +08:00
parent a37d6ca061
commit 86808f3b33
1 changed files with 3 additions and 3 deletions

View File

@ -2,20 +2,20 @@
new MagicSpellCardEvent() { new MagicSpellCardEvent() {
@Override @Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int amount = payedCost.getX();
return new MagicEvent( return new MagicEvent(
cardOnStack, cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE, MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicWeakenTargetPicker(amount,amount), new MagicWeakenTargetPicker(amount,amount),
payedCost.getX(),
this, this,
"Target creature\$ gets -" + amount + "/-" + amount + " until end of turn." "Target creature\$ gets -RN/-RN until end of turn."
); );
} }
@Override @Override
public void executeEvent(final MagicGame game, final MagicEvent event) { public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() { event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) { public void doAction(final MagicPermanent creature) {
final int X = event.getCardOnStack().getX(); final int X = event.getRefInt();
game.doAction(new MagicChangeTurnPTAction(creature,-X,-X)); game.doAction(new MagicChangeTurnPTAction(creature,-X,-X));
} }
}); });