diff --git a/TODO.txt b/TODO.txt index 5d9c318da..f3f3bd358 100644 --- a/TODO.txt +++ b/TODO.txt @@ -193,12 +193,10 @@ * destroyer can capture trade ships DONE 11/22/2024 * have bots recapture after nuclear blast DONE 11/24/2022 * BUG: destroys destroy trade ships instead of capturing them DONE 11/25/2024 -* nukes break alliance +* nukes break alliance DONE 11/25/2024 * don't capture trade ships if allied with either port * make ports cost more for more ports -* BUG: Destroyers destroy instead of capture trade ships * NPC has relations -* make NPC difficult scale better (not just start troops) * add battleship * add defense post * add radiation from nuke diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index fc68b8816..1e3690837 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -12,7 +12,7 @@ export class DefaultConfig implements Config { } tradeShipGold(src: Unit, dst: Unit): Gold { const dist = manhattanDist(src.tile().cell(), dst.tile().cell()) - return 10000 + 50 * dist + return 10000 + 50 * Math.pow(dist, 1.1) } unitInfo(type: UnitType): UnitInfo { switch (type) { @@ -23,7 +23,7 @@ export class DefaultConfig implements Config { } case UnitType.Destroyer: return { - cost: () => 250_000, + cost: (p: Player) => (p.units(UnitType.Destroyer).length + 1) * 250_000, territoryBound: false } case UnitType.Port: @@ -48,7 +48,7 @@ export class DefaultConfig implements Config { } case UnitType.MissileSilo: return { - cost: () => 2_500_000, + cost: () => 1_000_000, territoryBound: true } default: @@ -207,7 +207,7 @@ export class DefaultConfig implements Config { } goldAdditionRate(player: Player): number { - return Math.sqrt(player.workers() * player.numTilesOwned()) / 250 + return Math.sqrt(player.workers() * player.numTilesOwned()) / 200 } troopAdjustmentRate(player: Player): number { diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index fddd18524..18067a883 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -5,7 +5,7 @@ export const devConfig = new class extends DefaultConfig { unitInfo(type: UnitType): UnitInfo { const info = super.unitInfo(type) const oldCost = info.cost - info.cost = (p: Player) => oldCost(p) / 100 + // info.cost = (p: Player) => oldCost(p) / 100 return info } diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index d69498502..f453d922e 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -332,9 +332,10 @@ export class PlayerImpl implements MutablePlayer { } buildUnit(type: UnitType, troops: number, spawnTile: Tile): UnitImpl { + const cost = this.gs.unitInfo(type).cost(this) const b = new UnitImpl(type, this.gs, spawnTile, troops, this); this._units.push(b); - this.removeGold(this.gs.unitInfo(type).cost(this)) + this.removeGold(cost) this.removeTroops(troops) this.gs.fireUnitUpdateEvent(b, b.tile()); return b;