This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
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 17:33:28 -05:00
|
|
|
`Provides room to house ${config.formatNumber(config.cfgTentFollowerCapacity)} followers.`);
|
|
|
|
this.cost.money = config.cfgTentStartingCost;
|
|
|
|
this._costMultiplier.money = config.cfgTentCostMultiplier;
|
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 17:33:28 -05:00
|
|
|
let max = state.config.cfgTentStartingMax;
|
|
|
|
max += (state.getResource(ResourceKey.compounds)?.value ?? 0)
|
|
|
|
* state.config.cfgCompoundTentCapacity;
|
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
|
|
|
}
|