magarena/release/Magarena/scripts/Quest_for_the_Gemblades.groovy

68 lines
2.5 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Pump"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [
new MagicRemoveCounterEvent(source,MagicCounterType.Charge,1),
new MagicSacrificeEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.create(),
this,
"Put four +1/+1 counters on target creature\$."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeCountersAction(creature,MagicCounterType.PlusOne,4,true));
}
});
}
},
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicSource source=damage.getSource();
final MagicTarget target=damage.getTarget();
return (damage.isCombat() &&
permanent.isFriend(source) &&
source.isPermanent() &&
target.isPermanent() &&
(source).isCreature() &&
target.isCreature()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.ADD_CHARGE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ put a quest counter on SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.Charge,
1,
true
));
}
}
}
]