diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 44875c2c8..5fd401740 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -36,7 +36,7 @@ export class DefaultConfig implements Config { } case UnitType.Shell: return { - cost: (p: Player) => (p.units(UnitType.Destroyer).length + 1) * 500_000, + cost: (p: Player) => 0, territoryBound: false } case UnitType.Port: diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index dca20c927..ce09d8320 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) => 0 * oldCost(p) / 10000 + info.cost = (p: Player) => oldCost(p) / 10 return info } diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 05c98b08c..dc3e82874 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -278,6 +278,9 @@ export class PlayerImpl implements MutablePlayer { } removeGold(toRemove: Gold): void { + if (toRemove > this._gold) { + throw Error(`Player ${this} does not enough gold (${toRemove} vs ${this._gold}))`) + } this._gold -= toRemove }