magarena/release/Magarena/scripts/Blowfly_Infestation.groovy

26 lines
1.0 KiB
Groovy

[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent.isCreature() &&
otherPermanent.getCounters(MagicCounterType.MinusOne) > 0) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE,
new MagicWeakenTargetPicker(1,1),
this,
"Put a -1/-1 counter on target creature\$."
):
MagicEvent.NONE;
}
@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.MinusOne,1,true));
}
});
}
}
]