mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-20 01:50:21 +00:00
add # troops to UI
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user