Remove unit capture event messages

Drop the "Your {unit} was captured by {name}" and "Captured {unit} from
{name}" display messages on unit ownership change in UnitImpl. They fired
on every capture — dominated by warships taking trade ships — and were
too spammy to be useful, so players tuned them out.

Also clean up the now-unused pieces:
- Remove the UNIT_CAPTURED_BY_ENEMY message type, its category mapping,
  and its case in getMessageTypeClasses.
- Remove the orphaned unit_captured_by_enemy and captured_enemy_unit
  en.json keys.

CAPTURED_ENEMY_UNIT is kept — still used by the trade-ship gold message.
This commit is contained in:
evanpelle
2026-06-10 15:58:25 -07:00
parent 042820d56c
commit 9396df1ca4
4 changed files with 0 additions and 21 deletions
-2
View File
@@ -1135,8 +1135,6 @@
"received_troops_from_player": "Received {troops} troops from {name}",
"sent_gold_to_player": "Sent {gold} gold to {name}",
"received_gold_from_player": "Received {gold} gold from {name}",
"unit_captured_by_enemy": "Your {unit} was captured by {name}",
"captured_enemy_unit": "Captured {unit} from {name}",
"unit_destroyed": "Your {unit} was destroyed",
"no_boats_available": "No boats available, max {max}"
},
-1
View File
@@ -516,7 +516,6 @@ export function getMessageTypeClasses(type: MessageType): string {
case MessageType.ATTACK_FAILED:
case MessageType.ALLIANCE_REJECTED:
case MessageType.ALLIANCE_BROKEN:
case MessageType.UNIT_CAPTURED_BY_ENEMY:
case MessageType.UNIT_DESTROYED:
case MessageType.NUKE_DETONATED:
return severityColors["fail"];
-2
View File
@@ -1063,7 +1063,6 @@ export enum MessageType {
SAM_MISS,
SAM_HIT,
CAPTURED_ENEMY_UNIT,
UNIT_CAPTURED_BY_ENEMY,
UNIT_DESTROYED,
ALLIANCE_ACCEPTED,
ALLIANCE_REJECTED,
@@ -1099,7 +1098,6 @@ export const MESSAGE_TYPE_CATEGORIES: Record<MessageType, MessageCategory> = {
[MessageType.SAM_MISS]: MessageCategory.ATTACK,
[MessageType.SAM_HIT]: MessageCategory.ATTACK,
[MessageType.CAPTURED_ENEMY_UNIT]: MessageCategory.ATTACK,
[MessageType.UNIT_CAPTURED_BY_ENEMY]: MessageCategory.ATTACK,
[MessageType.UNIT_DESTROYED]: MessageCategory.ATTACK,
[MessageType.ALLIANCE_ACCEPTED]: MessageCategory.ALLIANCE,
[MessageType.ALLIANCE_REJECTED]: MessageCategory.ALLIANCE,
-16
View File
@@ -213,22 +213,6 @@ export class UnitImpl implements Unit {
this._owner = newOwner;
this._owner._units.push(this);
this.mg.addUpdate(this.toUpdate());
this.mg.displayMessage(
"events_display.unit_captured_by_enemy",
MessageType.UNIT_CAPTURED_BY_ENEMY,
this._lastOwner.id(),
undefined,
{ unit: this.type(), name: newOwner.displayName() },
this.id(),
);
this.mg.displayMessage(
"events_display.captured_enemy_unit",
MessageType.CAPTURED_ENEMY_UNIT,
newOwner.id(),
undefined,
{ unit: this.type(), name: this._lastOwner.displayName() },
this.id(),
);
}
modifyHealth(delta: number, attacker?: Player): void {