alliances expire after 1000 ticks (~1.5 minutes)

This commit is contained in:
evanpelle
2024-09-22 19:54:12 -07:00
parent d874392467
commit 08672f68a9
8 changed files with 61 additions and 9 deletions
+7
View File
@@ -32,6 +32,13 @@ export class PlayerExecution implements Execution {
}
this.player.setTroops(this.config.troopAdditionRate(this.player))
const alliances = Array.from(this.player.alliances())
for (const alliance of alliances) {
if (this.mg.ticks() - alliance.createdAt() > this.mg.config().allianceDuration()) {
alliance.expire()
}
}
if (ticks - this.lastCalc > this.ticksPerClusterCalc) {
this.lastCalc = ticks
const start = performance.now()