add # troops to UI

This commit is contained in:
evanpelle
2024-09-03 19:13:42 -07:00
parent cac66c2186
commit 1f590d0f4a
7 changed files with 121 additions and 87 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
import {PlayerInfo} from "../Game";
import {Player, PlayerInfo} from "../Game";
import {DefaultConfig} from "./DefaultConfig";
export const devConfig = new class extends DefaultConfig {
@@ -25,4 +25,13 @@ export const devConfig = new class extends DefaultConfig {
}
return 5000
}
troopAdditionRate(player: Player): number {
let max = Math.sqrt(player.numTilesOwned()) * 2000 + 10000 + 10000
max = Math.min(max, 1_000_000)
let toAdd = 10 + (player.troops() + Math.sqrt(player.troops() * player.numTilesOwned())) / 200 * 100
return Math.min(player.troops() + toAdd, max)
}
}