make NPCs less likely build boat

This commit is contained in:
Evan
2024-12-21 13:24:29 -08:00
parent 41e9087f8b
commit 2e2eea82e9
2 changed files with 9 additions and 3 deletions
+3
View File
@@ -171,6 +171,9 @@ export class FakeHumanExecution implements Execution {
}
private maybeSpawnWarship(shipType: UnitType.Destroyer | UnitType.Battleship): boolean {
if (!this.random.chance(10)) {
return false
}
const ports = this.player.units(UnitType.Port)
const ships = this.player.units(shipType)
if (ports.length > 0 && ships.length == 0 && this.player.gold() > this.cost(shipType)) {