mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 21:19:04 +00:00
render emoji on top of name, better trade notification
This commit is contained in:
@@ -117,6 +117,7 @@ export class Executor {
|
||||
const execs = []
|
||||
for (const nation of this.gs.nations()) {
|
||||
execs.push(new FakeHumanExecution(
|
||||
this.gameID,
|
||||
this.workerClient,
|
||||
new PlayerInfo(
|
||||
nation.name,
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ParallelAStar, WorkerClient } from "../worker/WorkerClient";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { DestroyerExecution } from "./DestroyerExecution";
|
||||
import { BattleshipExecution } from "./BattleshipExecution";
|
||||
import { GameID } from "../Schemas";
|
||||
|
||||
export class FakeHumanExecution implements Execution {
|
||||
|
||||
@@ -25,8 +26,8 @@ export class FakeHumanExecution implements Execution {
|
||||
|
||||
private relations = new Map<Player, number>()
|
||||
|
||||
constructor(private worker: WorkerClient, private playerInfo: PlayerInfo, private cell: Cell, private strength: number) {
|
||||
this.random = new PseudoRandom(simpleHash(playerInfo.id))
|
||||
constructor(gameID: GameID, private worker: WorkerClient, private playerInfo: PlayerInfo, private cell: Cell, private strength: number) {
|
||||
this.random = new PseudoRandom(simpleHash(playerInfo.id) + simpleHash(gameID))
|
||||
}
|
||||
|
||||
init(mg: MutableGame, ticks: number) {
|
||||
|
||||
@@ -99,8 +99,8 @@ 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(`Trade ship from ${this.tradeShip.owner().displayName()} has reached your port, giving you ${renderNumber(gold)} gold`, MessageType.SUCCESS, this.dstPort.owner().id())
|
||||
this.mg.displayMessage(`Your trade ship reached ${this.dstPort.owner().displayName()}, giving you ${renderNumber(gold)} gold`, MessageType.SUCCESS, this._owner)
|
||||
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.tradeShip.delete()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user