mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 01:56:11 +00:00
make unit cost scale up w/ # units
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user