rework PhantomReplacementEffect used by 7 Phantom cards (#12189)

This commit is contained in:
Susucre 2024-04-27 17:34:59 +02:00 committed by GitHub
parent 6193c9aee6
commit d645facdc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 366 additions and 62 deletions

View file

@ -1024,6 +1024,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
}
DamageEvent event = new DamagePermanentEvent(objectId, attackerId, controllerId, damageAmount, preventable, combat);
event.setAppliedEffects(appliedEffects);
// Even if no damage was dealt, some watchers would need a reset next time actions are processed.
// For instance PhantomPreventionWatcher used by the [[Phantom Wurm]] type of replacement effect.
game.getState().addBatchDamageCouldHaveBeenFired(combat, game);
if (game.replaceEvent(event)) {
return 0;
}