rebalance, expansion terrain agnostic

This commit is contained in:
evanpelle
2024-09-13 09:10:26 -07:00
parent 254013e2cd
commit 006da79b80
3 changed files with 22 additions and 28 deletions
-3
View File
@@ -112,10 +112,7 @@
--- v3 Release
* store cookies
* BUG: when clicking on enemy sometimes boat goes all the way around
* names dissappear too much (maybe screen size)
* names dissapear on bottom of screen
* UI: win condition & popup
* UI: boats
+7 -7
View File
@@ -42,15 +42,15 @@ export class DefaultConfig implements Config {
speed = 10
break
case TerrainType.Highland:
mag = 30
mag = 20
speed = 20
break
case TerrainType.Mountain:
mag = 90
mag = 40
speed = 40
break
}
// speed = mag
speed = mag
if (attacker.isPlayer() && defender.isPlayer()) {
if (attacker.type() == PlayerType.Bot && defender.type() == PlayerType.FakeHuman) {
@@ -69,9 +69,9 @@ export class DefaultConfig implements Config {
}
} else {
return {
attackerTroopLoss: mag,
attackerTroopLoss: Math.max(10, mag / 1.5),
defenderTroopLoss: 0,
tilesPerTickUsed: within(this.startTroops(attacker.info()) / (attackTroops * 5), .2, 3) * speed
tilesPerTickUsed: within(this.startTroops(attacker.info()) / (attackTroops * 5), .2, 3) * Math.max(10, speed / 1.5)
}
}
}
@@ -105,7 +105,7 @@ export class DefaultConfig implements Config {
maxTroops(player: Player): number {
let max = Math.sqrt(player.numTilesOwned()) * 3000 + 50000
return Math.min(max, 1_000_000)
return Math.min(max, 2_000_000)
}
troopAdditionRate(player: Player): number {
@@ -118,7 +118,7 @@ export class DefaultConfig implements Config {
// console.log(`to add ${toAdd}`)
if (player.type() == PlayerType.FakeHuman) {
toAdd *= 1.2
toAdd *= 1.1
}
if (player.type() == PlayerType.Bot) {
toAdd *= .8
+15 -18
View File
@@ -152,27 +152,24 @@ export class AttackExecution implements Execution {
if (this.targetCell != null) {
dist = manhattanDist(tile.cell(), this.targetCell)
}
// if() {
// if (numOwnedByMe > 2) {
// numOwnedByMe = 10
// }
// let mag = 0
// switch (tile.terrain()) {
// case TerrainType.Plains:
// mag = 1
// break
// case TerrainType.Highland:
// mag = 2
// break
// case TerrainType.Mountain:
// mag = 3
// break
// }
if (numOwnedByMe > 2) {
numOwnedByMe = 10
}
let mag = 0
switch (tile.terrain()) {
case TerrainType.Plains:
mag = 1
break
case TerrainType.Highland:
mag = 2
break
case TerrainType.Mountain:
mag = 3
break
}
this.toConquer.enqueue(new TileContainer(
neighbor,
dist / 100 + this.random.nextInt(0, 3) - numOwnedByMe * 2 + mag,
dist / 100 + this.random.nextInt(0, 2) - numOwnedByMe, // + mag,
this.mg.ticks()
))
}