mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-09 05:13:14 +00:00
update win condtion: 80% non fallout tiles
This commit is contained in:
@@ -27,8 +27,13 @@ export class WinCheckExecution implements Execution {
|
||||
return
|
||||
}
|
||||
const max = sorted[0]
|
||||
if (max.numTilesOwned() / this.mg.map().numLandTiles() * 100 > this.mg.config().percentageTilesOwnedToWin()) {
|
||||
const numTilesWithoutFallout = this.mg.numLandTiles() - this.mg.numTilesWithFallout()
|
||||
if (this.mg.ticks() % 10 == 0) {
|
||||
console.log(`player: ${max.name()} owns ${max.numTilesOwned()} tiles, ${numTilesWithoutFallout}`)
|
||||
}
|
||||
if (max.numTilesOwned() / numTilesWithoutFallout * 100 > this.mg.config().percentageTilesOwnedToWin()) {
|
||||
this.mg.setWinner(max)
|
||||
console.log(`${max.name()} has won the game`)
|
||||
this.active = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user