mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-11 18:58:09 +00:00
fix nuke bug, make spawn phase longer, show trade ships in overview
This commit is contained in:
@@ -55,7 +55,7 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
|
||||
this.player = owner;
|
||||
this.setVisible(true);
|
||||
} else if (!tile.isLand()) {
|
||||
const units = this.game.units(UnitType.Destroyer, UnitType.Battleship)
|
||||
const units = this.game.units(UnitType.Destroyer, UnitType.Battleship, UnitType.TradeShip)
|
||||
.filter(u => euclideanDist(worldCoord, u.tile().cell()) < 50)
|
||||
.sort(distSortUnit(tile));
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export function initRemoteSender(eventBus: EventBus) {
|
||||
|
||||
consolex.error = (...args: any[]): void => {
|
||||
console.error(...args);
|
||||
eventBus.emit(new SendLogEvent(LogSeverity.Error, args.join(' ')))
|
||||
// eventBus.emit(new SendLogEvent(LogSeverity.Error, args.join(' ')))
|
||||
}
|
||||
}
|
||||
export class SendLogEvent implements GameEvent {
|
||||
|
||||
@@ -157,7 +157,7 @@ export abstract class DefaultConfig implements Config {
|
||||
return 500
|
||||
}
|
||||
numSpawnPhaseTurns(gameType: GameType): number {
|
||||
return gameType == GameType.Singleplayer ? 100 : 200
|
||||
return gameType == GameType.Singleplayer ? 100 : 300
|
||||
}
|
||||
numBots(): number {
|
||||
return 400
|
||||
|
||||
@@ -58,6 +58,7 @@ export class UnitImpl implements MutableUnit {
|
||||
|
||||
setOwner(newOwner: Player): void {
|
||||
const oldOwner = this._owner
|
||||
oldOwner._units = oldOwner._units.filter(u => u != this)
|
||||
this._owner = newOwner as PlayerImpl
|
||||
this.g.fireUnitUpdateEvent(this, this.tile())
|
||||
this.g.displayMessage(
|
||||
@@ -94,4 +95,8 @@ export class UnitImpl implements MutableUnit {
|
||||
hash(): number {
|
||||
return this.tile().cell().x + this.tile().cell().y + simpleHash(this.type())
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return `Unit:${this._type},owner:${this.owner().name()}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user