Merge remote-tracking branch 'upstream/main' into local-attack

This commit is contained in:
Aotumuri
2026-01-12 12:22:52 +09:00
63 changed files with 2826 additions and 2277 deletions
+3 -1
View File
@@ -192,9 +192,11 @@ export class AttackExecution implements Execution {
const deaths = this.attack.troops() * (malusPercent / 100);
if (deaths) {
this.mg.displayMessage(
`Attack cancelled, ${renderTroops(deaths)} soldiers killed during retreat.`,
"events_display.attack_cancelled_retreat",
MessageType.ATTACK_CANCELLED,
this._owner.id(),
undefined,
{ troops: renderTroops(deaths) },
);
}
if (this.removeTroops === false && this.sourceTile === null) {
+3 -1
View File
@@ -272,9 +272,11 @@ export class SAMLauncherExecution implements Execution {
// Message
this.mg.displayMessage(
`${mirvWarheadTargets.length} MIRV warheads intercepted`,
"events_display.mirv_warheads_intercepted",
MessageType.SAM_HIT,
samOwner.id(),
undefined,
{ count: mirvWarheadTargets.length },
);
mirvWarheadTargets.forEach(({ unit: u }) => {
+3 -1
View File
@@ -61,9 +61,11 @@ export class SAMMissileExecution implements Execution {
);
if (result === true) {
this.mg.displayMessage(
`Missile intercepted ${this.target.type()}`,
"events_display.missile_intercepted",
MessageType.SAM_HIT,
this._owner.id(),
undefined,
{ unit: this.target.type() },
);
this.active = false;
this.target.delete(true, this._owner);
+15 -3
View File
@@ -142,10 +142,14 @@ export class TradeShipExecution implements Execution {
if (this.wasCaptured) {
this.tradeShip!.owner().addGold(gold, this._dstPort.tile());
this.mg.displayMessage(
`Received ${renderNumber(gold)} gold from ship captured from ${this.origOwner.displayName()}`,
"events_display.received_gold_from_captured_ship",
MessageType.CAPTURED_ENEMY_UNIT,
this.tradeShip!.owner().id(),
gold,
{
gold: renderNumber(gold),
name: this.origOwner.displayName(),
},
);
// Record stats
this.mg
@@ -155,16 +159,24 @@ export class TradeShipExecution implements Execution {
this.srcPort.owner().addGold(gold);
this._dstPort.owner().addGold(gold, this._dstPort.tile());
this.mg.displayMessage(
`Received ${renderNumber(gold)} gold from trade with ${this.srcPort.owner().displayName()}`,
"events_display.received_gold_from_trade",
MessageType.RECEIVED_GOLD_FROM_TRADE,
this._dstPort.owner().id(),
gold,
{
gold: renderNumber(gold),
name: this.srcPort.owner().displayName(),
},
);
this.mg.displayMessage(
`Received ${renderNumber(gold)} gold from trade with ${this._dstPort.owner().displayName()}`,
"events_display.received_gold_from_trade",
MessageType.RECEIVED_GOLD_FROM_TRADE,
this.srcPort.owner().id(),
gold,
{
gold: renderNumber(gold),
name: this._dstPort.owner().displayName(),
},
);
// Record stats
this.mg
+6 -2
View File
@@ -77,9 +77,11 @@ export class TransportShipExecution implements Execution {
mg.config().boatMaxNumber()
) {
mg.displayMessage(
`No boats available, max ${mg.config().boatMaxNumber()}`,
"events_display.no_boats_available",
MessageType.ATTACK_FAILED,
this.attacker.id(),
undefined,
{ max: mg.config().boatMaxNumber() },
);
this.active = false;
return;
@@ -270,9 +272,11 @@ export class TransportShipExecution implements Execution {
.boatArriveTroops(this.attacker, this.target, survivors);
if (deaths) {
this.mg.displayMessage(
`Attack cancelled, ${renderTroops(deaths)} soldiers killed during retreat.`,
"events_display.attack_cancelled_retreat",
MessageType.ATTACK_CANCELLED,
this.attacker.id(),
undefined,
{ troops: renderTroops(deaths) },
);
}
return;