mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 15:49:13 +00:00
add player death & quotes when win or lose
This commit is contained in:
@@ -19,7 +19,7 @@ export class DevConfig extends DefaultConfig {
|
||||
}
|
||||
|
||||
numSpawnPhaseTurns(): number {
|
||||
return this.gameConfig().gameType == GameType.Singleplayer ? 40 : 200
|
||||
return this.gameConfig().gameType == GameType.Singleplayer ? 40 : 100
|
||||
// return 100
|
||||
}
|
||||
|
||||
@@ -30,23 +30,23 @@ export class DevConfig extends DefaultConfig {
|
||||
return info
|
||||
}
|
||||
|
||||
// percentageTilesOwnedToWin(): number {
|
||||
// return 10
|
||||
// }
|
||||
percentageTilesOwnedToWin(): number {
|
||||
return 1
|
||||
}
|
||||
|
||||
// populationIncreaseRate(player: Player): number {
|
||||
// return this.maxPopulation(player)
|
||||
// }
|
||||
populationIncreaseRate(player: Player): number {
|
||||
return this.maxPopulation(player)
|
||||
}
|
||||
|
||||
// boatMaxDistance(): number {
|
||||
// return 5000
|
||||
// }
|
||||
|
||||
// numBots(): number {
|
||||
// return 0
|
||||
// }
|
||||
// spawnNPCs(): boolean {
|
||||
// return false
|
||||
// }
|
||||
numBots(): number {
|
||||
return 0
|
||||
}
|
||||
spawnNPCs(): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -162,7 +162,15 @@ export class GameView implements GameMap {
|
||||
private _units = new Map<number, UnitView>()
|
||||
private updatedTiles: TileRef[] = []
|
||||
|
||||
constructor(public worker: WorkerClient, private _config: Config, private _map: GameMap) {
|
||||
|
||||
private _myPlayer: PlayerView | null = null
|
||||
|
||||
constructor(
|
||||
public worker: WorkerClient,
|
||||
private _config: Config,
|
||||
private _map: GameMap,
|
||||
private _myClientID: ClientID
|
||||
) {
|
||||
this.lastUpdate = {
|
||||
tick: 0,
|
||||
packedTileUpdates: new BigUint64Array([]),
|
||||
@@ -210,6 +218,17 @@ export class GameView implements GameMap {
|
||||
return this.updatedTiles
|
||||
}
|
||||
|
||||
myClientID(): ClientID {
|
||||
return this._myClientID
|
||||
}
|
||||
|
||||
myPlayer(): PlayerView | null {
|
||||
if (this._myPlayer == null) {
|
||||
this._myPlayer = this.playerByClientID(this._myClientID)
|
||||
}
|
||||
return this._myPlayer
|
||||
}
|
||||
|
||||
player(id: PlayerID): PlayerView {
|
||||
if (this._players.has(id)) {
|
||||
return this._players.get(id)
|
||||
|
||||
Reference in New Issue
Block a user