From 8ff03496c6cd4daef370d3e08cb9246d6e71f494 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 7 Sep 2024 09:52:21 -0700 Subject: [PATCH] make bots receive half troops, update version --- src/client/index.html | 2 +- src/core/configuration/DefaultConfig.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/index.html b/src/client/index.html index 3cf6e96d0..5c538f342 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -10,7 +10,7 @@

OpenFront.io

-

(v0.2.0)

+

(v0.3.0)

diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 9ef8f3390..428f26ac5 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -16,7 +16,7 @@ export class DefaultConfig implements Config { return 100 } numBots(): number { - return 350 + return 400 } turnIntervalMs(): number { return 100 @@ -39,14 +39,14 @@ export class DefaultConfig implements Config { mag = 15 break case TerrainType.Mountain: - mag = 50 + mag = 40 break } if (defender.isPlayer()) { return { attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000), defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000), - tilesPerTickUsed: mag + 1 + tilesPerTickUsed: within(attacker.numTilesOwned() / defender.numTilesOwned(), 1, 5) * mag } } else { return { @@ -94,6 +94,10 @@ export class DefaultConfig implements Config { toAdd *= ratio // console.log(`to add ${toAdd}`) + if (player.type() == PlayerType.Bot) { + toAdd *= .5 + } + return Math.min(player.troops() + toAdd, max) } }