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.
irreligious/src/model/resource/Tent.ts

26 lines
701 B
TypeScript
Raw Normal View History

2021-08-21 19:53:43 -05:00
/// <reference path="./Infrastructure.ts" />
class Tent extends Infrastructure {
constructor(config: GameConfig) {
super(
2021-09-06 08:51:41 -05:00
'Tents',
'tent',
'tents',
`Provides room to house ${formatNumber(
config.cfgCapacity.tents?.followers ?? 0
)} followers.`
);
2021-09-05 20:43:11 -05:00
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;
max +=
(state.resource.compounds?.value ?? 0) *
(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
}