2021-08-21 19:53:43 -05:00
|
|
|
/// <reference path="./Infrastructure.ts" />
|
|
|
|
|
|
|
|
class Tent extends Infrastructure {
|
2021-09-05 17:33:28 -05:00
|
|
|
constructor (config: GameConfig) {
|
2021-08-21 19:53:43 -05:00
|
|
|
super('Tents',
|
2021-09-05 20:43:11 -05:00
|
|
|
`Provides room to house ${config.formatNumber(config.cfgCapacity.tents?.playerOrg ?? 0)} followers.`);
|
|
|
|
this.cost.money = config.cfgInitialCost.tents;
|
|
|
|
this._costMultiplier.money = config.cfgCostMultiplier.tents;
|
2021-08-21 19:53:43 -05:00
|
|
|
}
|
|
|
|
|
2021-09-05 14:45:37 -05:00
|
|
|
public max: (state: GameState) => number = (state) => {
|
2021-08-22 13:48:48 -05:00
|
|
|
// ten extra tents per compound
|
2021-09-05 20:43:11 -05:00
|
|
|
let max = state.config.cfgInitialMax.tents ?? 0;
|
2021-09-05 18:39:08 -05:00
|
|
|
max += (state.resource.compounds?.value ?? 0)
|
2021-09-05 20:43:11 -05:00
|
|
|
* (state.config.cfgCapacity.compounds?.tents ?? 0);
|
2021-08-21 19:53:43 -05:00
|
|
|
return max;
|
2021-09-05 14:45:37 -05:00
|
|
|
};
|
2021-08-21 19:53:43 -05:00
|
|
|
}
|