21 lines
630 B
Groovy
21 lines
630 B
Groovy
|
[
|
||
|
new MagicIfDamageWouldBeDealtTrigger(MagicTrigger.PREVENT_DAMAGE) {
|
||
|
@Override
|
||
|
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicDamage damage) {
|
||
|
if (damage.getTarget() == permanent) {
|
||
|
|
||
|
// Prevention effect.
|
||
|
damage.prevent();
|
||
|
|
||
|
game.doAction(new MagicChangeCountersAction(
|
||
|
permanent,
|
||
|
MagicCounterType.PlusOne,
|
||
|
-1,
|
||
|
true
|
||
|
));
|
||
|
}
|
||
|
return MagicEvent.NONE;
|
||
|
}
|
||
|
}
|
||
|
]
|