From 287d30513bb44ab42981c24141865a24bea03924 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 20 Sep 2024 20:30:36 -0700 Subject: [PATCH] added back preferential conquer --- src/core/execution/AttackExecution.ts | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 930deb904..e0b4b7cc3 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -171,24 +171,24 @@ export class AttackExecution implements Execution { if (this.targetCell != null) { dist = manhattanDist(tile.cell(), this.targetCell) } - // 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, 2) - numOwnedByMe, // + mag, + dist / 100 + this.random.nextInt(0, 2) - numOwnedByMe + mag, this.mg.ticks() )) }