mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 11:28:06 +00:00
make shells free
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user