make unit cost scale up w/ # units

This commit is contained in:
Evan
2024-11-25 11:42:40 -08:00
parent 5997262416
commit 6fd35b00cd
4 changed files with 8 additions and 9 deletions
+2 -1
View File
@@ -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;