replace groovy code with ability in card script

master
melvin 2013-10-20 11:31:18 +08:00
parent 91ee2bf890
commit cd75c5acb9
4 changed files with 6 additions and 36 deletions

View File

@ -29,41 +29,5 @@
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags|MagicType.Creature.getMask();
}
},
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Pump"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{1}{G}"),
new MagicSacrificePermanentEvent(
source,
new MagicTargetChoice("an Elf you control")
)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.create(),
this,
"Target creature\$ gets +3/+3 until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeTurnPTAction(creature,3,3));
}
});
}
}
]

View File

@ -7,5 +7,6 @@ type=Creature
subtype=Elf
cost={3}{G}{G}
pt=2/2
ability=pay {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.
timing=main
requires_groovy_code

View File

@ -444,6 +444,9 @@ public class MagicTargetChoice extends MagicChoice {
public static final MagicTargetChoice SACRIFICE_BAT =
new MagicTargetChoice("a Bat to sacrifice");
public static final MagicTargetChoice SACRIFICE_ELF =
new MagicTargetChoice("an Elf to sacrifice");
public static final MagicTargetChoice SACRIFICE_BEAST =
new MagicTargetChoice("a Beast to sacrifice");

View File

@ -140,6 +140,8 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
events.add(new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_BEAST));
} else if (cost.equals("Sacrifice a land")) {
events.add(new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_LAND));
} else if (cost.equals("Sacrifice an Elf")) {
events.add(new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_ELF));
} else if (cost.equals("Discard a card")) {
events.add(new MagicDiscardEvent(source));
} else if (cost.equals("{E}")) {