From 75adcd29890fe22fab93fa3bc6e7ac948be2e718 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 6 Sep 2024 20:11:49 -0700 Subject: [PATCH] fixed attackLogic bug --- src/client/ClientGame.ts | 2 +- src/core/configuration/DefaultConfig.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client/ClientGame.ts b/src/client/ClientGame.ts index cc706cfce..74abb9aad 100644 --- a/src/client/ClientGame.ts +++ b/src/client/ClientGame.ts @@ -245,7 +245,7 @@ export class ClientGame { if (bordersWithDists.length > 0) { borderTileClosest = borderWithDists[0].dist } - if (enemyShoreDists.length > 0 && bordersOcean) { + if (enemyShoreDists.length > 0) { enemyShoreClosest = enemyShoreDists[0].dist } if (enemyShoreClosest < borderTileClosest / 6) { diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 079b203d2..95bd1d0e6 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -34,15 +34,18 @@ export class DefaultConfig implements Config { switch (tileToConquer.terrain()) { case TerrainType.Plains: mag = 1 + break case TerrainType.Highland: - mag = 3 + mag = 20 + break case TerrainType.Mountain: - mag = 10 + mag = 100 + break } if (defender.isPlayer()) { return { - attackerTroopLoss: within(defender.troops() / attacker.troops() / 10 * mag, 1, 100), - defenderTroopLoss: within(attacker.troops() / defender.troops() / 10, 1, 100), + attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000), + defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000), tilesPerTickUsed: mag + 1 } } else {