magarena/release/Magarena/scripts/Golden_Urn.groovy

31 lines
985 B
Groovy

[
new MagicPermanentActivation(
[MagicCondition.CAN_TAP_CONDITION],
new MagicActivationHints(MagicTiming.Pump),
"Gain life"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [
new MagicTapEvent(source),
new MagicSacrificeEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"PN gains life equal to the number of charge counters on SN."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int amount = event.getPermanent().getCounters(MagicCounterType.Charge);
game.doAction(new MagicChangeLifeAction(event.getPlayer(),amount));
}
}
]