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-08-21 19:53:43 -05:00
|
|
|
super('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 17:33:28 -05:00
|
|
|
this.cost.money = config.cfgCompoundStartingCost;
|
|
|
|
this._costMultiplier.money = config.cfgCompoundCostMultiplier;
|
2021-08-21 19:53:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public isUnlocked (state: GameState): boolean {
|
|
|
|
if (this._isUnlocked) return true;
|
2021-09-05 17:33:28 -05:00
|
|
|
const tents = state.getResource(ResourceKey.tents);
|
|
|
|
if (tents !== null && tents.value >= state.config.cfgTentStartingMax) {
|
2021-08-21 19:53:43 -05:00
|
|
|
this._isUnlocked = true;
|
|
|
|
}
|
|
|
|
return this._isUnlocked;
|
|
|
|
}
|
|
|
|
}
|