magarena/release/Magarena/scripts/Lavacore_Elemental.groovy

23 lines
861 B
Groovy

[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicSource source = damage.getSource();
return (source.isCreature() &&
permanent.isFriend(source) &&
damage.isCombat() &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
this,
"PN puts a time counter on SN."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.Charge,1,true));
}
}
]