diff --git a/resources/lang/en.json b/resources/lang/en.json index 516d9645a..15ccf75d8 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -771,6 +771,8 @@ "received_gold_from_conquest": "Conquered {name}, received {gold} gold", "conquered_no_gold": "Conquered {name} (didn't play, no gold awarded)", "missile_intercepted": "Missile intercepted {unit}", + "interceptor_destroyed": "Interceptor destroyed, retargeting {unit}", + "interceptor_destroyed_attacker": "{unit} survived interception, new interceptor inbound", "mirv_warheads_intercepted": "{count, plural, one {{count} MIRV warhead intercepted} other {{count} MIRV warheads intercepted}}", "sent_troops_to_player": "Sent {troops} troops to {name}", "received_troops_from_player": "Received {troops} troops from {name}", diff --git a/src/core/execution/SAMMissileExecution.ts b/src/core/execution/SAMMissileExecution.ts index 657166a80..e1fa93a9c 100644 --- a/src/core/execution/SAMMissileExecution.ts +++ b/src/core/execution/SAMMissileExecution.ts @@ -39,6 +39,26 @@ export class SAMMissileExecution implements Execution { {}, ); if (!this.SAMMissile.isActive()) { + // Interceptor was destroyed (e.g. by nuke blast) — allow SAMs to re-target this nuke + if (this.target.isActive()) { + this.target.setTargetedBySAM(false); + // Notify defender their interceptor was destroyed + this.mg.displayMessage( + "events_display.interceptor_destroyed", + MessageType.SAM_MISS, + this._owner.id(), + undefined, + { unit: this.target.type() }, + ); + // Notify attacker their nuke survived interception + this.mg.displayMessage( + "events_display.interceptor_destroyed_attacker", + MessageType.SAM_MISS, + this.target.owner().id(), + undefined, + { unit: this.target.type() }, + ); + } this.active = false; return; } @@ -50,7 +70,7 @@ export class SAMMissileExecution implements Execution { this.target.owner() === this.SAMMissile.owner() || !nukesWhitelist.includes(this.target.type()) ) { - // Clear the flag so other SAMs can re-target this nuke + // If the nuke is still active but we're aborting (e.g. SAM destroyed), allow re-targeting if (this.target.isActive()) { this.target.setTargetedBySAM(false); }