diff --git a/TODO.txt b/TODO.txt index 083216d5d..c291f578a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -191,6 +191,7 @@ * NPC builds ports DONE 11/20/2024 * BUG: fix matchmaking DONE 11/22/2024 * destroyer can capture trade ships DONE 11/22/2024 +* have bots recapture after nuclear blast * NPC has relations * make NPC difficult scale better (not just start troops) * add battleship diff --git a/src/core/execution/NukeExecution.ts b/src/core/execution/NukeExecution.ts index f65374e90..5e5845352 100644 --- a/src/core/execution/NukeExecution.ts +++ b/src/core/execution/NukeExecution.ts @@ -61,21 +61,20 @@ export class NukeExecution implements Execution { } private detonate() { - const magnitude = this.type == UnitType.AtomBomb ? 15 : 115 + const magnitude = this.type == UnitType.AtomBomb ? { inner: 20, outer: 40 } : { inner: 160, outer: 180 } const rand = new PseudoRandom(this.mg.ticks()) const tile = this.mg.tile(this.cell) const toDestroy = bfs(tile, (n: Tile) => { const d = euclideanDist(tile.cell(), n.cell()) - return (d <= magnitude || rand.chance(2)) && d <= magnitude * 2 + return (d <= magnitude.inner || rand.chance(2)) && d <= magnitude.outer }) const ratio = Object.fromEntries( this.mg.players().map(p => [p.id(), p.troops() / p.numTilesOwned()]) ) - for (const tile of toDestroy) { const owner = tile.owner() if (owner.isPlayer()) { @@ -85,7 +84,7 @@ export class NukeExecution implements Execution { } } for (const unit of this.mg.units()) { - if (euclideanDist(this.cell, unit.tile().cell()) < magnitude * 2) { + if (euclideanDist(this.cell, unit.tile().cell()) < magnitude.outer) { unit.delete() } }