magarena/release/Magarena/scripts/Asceticism.groovy

42 lines
1.4 KiB
Groovy

[
new MagicStatic(
MagicLayer.Ability,
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.add(MagicAbility.Hexproof);
}
},
new MagicPermanentActivation(
[MagicConditionFactory.ManaCost("{1}{G}")],
new MagicActivationHints(MagicTiming.Pump,true),
"Regen"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostEvent(source,"{1}{G}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_CREATURE,
MagicRegenerateTargetPicker.getInstance(),
this,
"Regenerate 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 MagicRegenerateAction(creature));
}
});
}
}
]