mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:00:43 +00:00
rebalance nuclear blast
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user