magarena/release/Magarena/scripts/War_Elemental.groovy

47 lines
1.5 KiB
Groovy

[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPayedCost payedCost) {
return (!permanent.getOpponent().hasState(MagicPlayerState.WasDealtDamage)) ?
new MagicEvent(
permanent,
this,
"Sacrifice SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicSacrificeAction(event.getPermanent()));
}
},
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicDamage damage) {
return permanent.isOpponent(damage.getTarget()) ?
new MagicEvent(
permanent,
damage.getDealtAmount(),
this,
"PN puts RN +1/+1 counters on SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.PlusOne,
event.getRefInt(),
true
));
}
}
]