make shells free

This commit is contained in:
Evan
2024-11-27 14:05:47 -08:00
parent 982caa3b23
commit 61515172c7
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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
}
+3
View File
@@ -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
}