add capture alert

This commit is contained in:
Evan
2024-12-13 11:05:01 -08:00
parent 2816ba1807
commit 05746ebecd
3 changed files with 13 additions and 2 deletions
+1
View File
@@ -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
+10 -2
View File
@@ -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
}
+2
View File
@@ -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 {