diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 5fbec6111..8d62debb5 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -21,13 +21,6 @@ export class AttackExecution implements Execution { private active: boolean = true; private toConquer: PriorityQueue = new PriorityQueue((a: TileContainer, b: TileContainer) => { - if (a.priority == b.priority) { - if (a.tick == b.tick) { - return 0; - // return this.random.nextInt(-1, 1) - } - return a.tick - b.tick; - } return a.priority - b.priority; }); private random = new PseudoRandom(123); @@ -227,8 +220,6 @@ export class AttackExecution implements Execution { this.target, this.border.size + this.random.nextInt(0, 5), ); - // consolex.log(`num tiles per tick: ${numTilesPerTick}`) - // consolex.log(`num execs: ${this.mg.executions().length}`) while (numTilesPerTick > 0) { if (this.attack.troops() < 1) { @@ -279,13 +270,9 @@ export class AttackExecution implements Execution { continue; } this.border.add(neighbor); - let numOwnedByMe = this.mg + const numOwnedByMe = this.mg .neighbors(neighbor) .filter((t) => this.mg.owner(t) == this._owner).length; - const dist = 0; - if (numOwnedByMe > 2) { - numOwnedByMe = 10; - } let mag = 0; switch (this.mg.terrainType(tile)) { case TerrainType.Plains: @@ -301,8 +288,9 @@ export class AttackExecution implements Execution { this.toConquer.enqueue( new TileContainer( neighbor, - dist / 100 + this.random.nextInt(0, 2) - numOwnedByMe + mag, - this.mg.ticks(), + (this.random.nextInt(0, 7) + 10) * + (1 - numOwnedByMe * 0.5 + mag / 2) + + this.mg.ticks(), ), ); } @@ -355,6 +343,5 @@ class TileContainer { constructor( public readonly tile: TileRef, public readonly priority: number, - public readonly tick: number, ) {} }