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-09-04 23:16:32 -05:00
|
|
|
/// <reference path="./Research.ts" />
|
|
|
|
|
|
|
|
class BuildingPermit extends Research {
|
2021-09-12 13:58:57 -05:00
|
|
|
public readonly resourceKey = ResourceKey.buildingPermit;
|
|
|
|
|
2021-09-06 12:02:38 -05:00
|
|
|
constructor(config: GameConfig) {
|
2021-09-06 00:12:05 -05:00
|
|
|
super(
|
2021-09-06 08:51:41 -05:00
|
|
|
'Building Permit',
|
2021-09-06 00:12:05 -05:00
|
|
|
'building permit',
|
|
|
|
'building permits',
|
2021-09-06 12:02:38 -05:00
|
|
|
'Unlocks several new buildings you can build outside of your compounds.'
|
|
|
|
);
|
|
|
|
this.cost.money = config.cfgInitialCost.buildingPermit;
|
2021-09-04 23:16:32 -05:00
|
|
|
}
|
|
|
|
|
2021-09-12 13:58:57 -05:00
|
|
|
public isUnlocked = (state: GameState): boolean => {
|
2021-09-04 23:16:32 -05:00
|
|
|
if (this._isUnlocked) return true;
|
2021-09-05 18:39:08 -05:00
|
|
|
const compounds = state.resource.compounds;
|
|
|
|
if (compounds !== undefined && compounds.value > 0) {
|
2021-09-04 23:16:32 -05:00
|
|
|
this._isUnlocked = true;
|
|
|
|
}
|
|
|
|
return this._isUnlocked;
|
2021-09-12 13:58:57 -05:00
|
|
|
};
|
2021-09-04 23:16:32 -05:00
|
|
|
}
|