mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-15 09:12:55 +00:00
Merge remote-tracking branch 'upstream/main' into local-attack
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user