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 Compound extends Infrastructure {
|
2021-09-05 17:33:28 -05:00
|
|
|
constructor (config: GameConfig) {
|
2021-09-06 00:12:05 -05:00
|
|
|
super(
|
2021-09-06 08:51:41 -05:00
|
|
|
'Compounds',
|
2021-09-06 00:12:05 -05:00
|
|
|
'compound',
|
|
|
|
'compounds',
|
2021-08-22 13:48:48 -05:00
|
|
|
'Provides space for tents, houses, and churches and a place to hide more money.');
|
2021-09-05 20:43:11 -05:00
|
|
|
this.cost.money = config.cfgInitialCost.compounds;
|
|
|
|
this._costMultiplier.money = config.cfgCostMultiplier.compounds;
|
2021-08-21 19:53:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public isUnlocked (state: GameState): boolean {
|
|
|
|
if (this._isUnlocked) return true;
|
2021-09-05 18:39:08 -05:00
|
|
|
const tents = state.resource.tents;
|
2021-09-05 20:43:11 -05:00
|
|
|
if (tents !== undefined
|
|
|
|
&& tents.value >= (state.config.cfgInitialMax.tents ?? 0)) {
|
2021-08-21 19:53:43 -05:00
|
|
|
this._isUnlocked = true;
|
|
|
|
}
|
|
|
|
return this._isUnlocked;
|
|
|
|
}
|
|
|
|
}
|