diff --git a/TODO.txt b/TODO.txt index 390d33132..5e7bd0366 100644 --- a/TODO.txt +++ b/TODO.txt @@ -236,6 +236,7 @@ * bug: name not updating location in spawn phase DONE 12/12/2024 * add panama canal NA DONE 12/12/2024 * make boats work on oceania 12/12/2024 +* add capture alert DONE 12/13/2024 * allow longer names and allow them to be displayed in the Rank UI not be cut * make boats work on lakes * record game winner diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts index 18f1bde47..922b0dc53 100644 --- a/src/core/execution/TradeShipExecution.ts +++ b/src/core/execution/TradeShipExecution.ts @@ -99,8 +99,16 @@ export class TradeShipExecution implements Execution { const gold = this.mg.config().tradeShipGold(this.srcPort, this.dstPort) this.srcPort.owner().addGold(gold) this.dstPort.owner().addGold(gold) - this.mg.displayMessage(`Received ${renderNumber(gold)} gold from trade with ${this.tradeShip.owner().displayName()}`, MessageType.SUCCESS, this.dstPort.owner().id()) - this.mg.displayMessage(`Received ${renderNumber(gold)} gold from trade with ${this.tradeShip.owner().displayName()}`, MessageType.SUCCESS, this._owner) + this.mg.displayMessage( + `Received ${renderNumber(gold)} gold from trade with ${this.srcPort.owner().displayName()}`, + MessageType.SUCCESS, + this.dstPort.owner().id() + ) + this.mg.displayMessage( + `Received ${renderNumber(gold)} gold from trade with ${this.dstPort.owner().displayName()}`, + MessageType.SUCCESS, + this.srcPort.owner().id() + ) this.tradeShip.delete(false) return } diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 38d2b9602..594c24bed 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -335,6 +335,8 @@ export class PlayerImpl implements MutablePlayer { (unit as UnitImpl)._owner = this this._units.push(unit as UnitImpl) this.gs.fireUnitUpdateEvent(unit, unit.tile()) + this.gs.displayMessage(`${unit.type()} captured by ${this.displayName()}`, MessageType.ERROR, prev.id()) + this.gs.displayMessage(`Captured ${unit.type()} from ${prev.displayName()}`, MessageType.SUCCESS, this.id()) } buildUnit(type: UnitType, troops: number, spawnTile: Tile): UnitImpl {