fixed attackLogic bug

This commit is contained in:
evanpelle
2024-09-06 20:11:49 -07:00
parent 4caaaea140
commit 75adcd2989
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -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) {
+7 -4
View File
@@ -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 {