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-11 20:37:33 -05:00
|
|
|
/// <reference path="./Job.ts" />
|
|
|
|
|
|
|
|
class CompoundManager extends Job {
|
2021-09-12 13:58:57 -05:00
|
|
|
public readonly resourceKey = ResourceKey.compoundManagers;
|
|
|
|
|
2021-09-11 20:37:33 -05:00
|
|
|
constructor() {
|
|
|
|
super(
|
|
|
|
'Compound Managers',
|
|
|
|
'compound manager',
|
|
|
|
'compound managers',
|
|
|
|
'Automatically purchase tents, houses, and churches when money and compound space permits.'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-09-12 13:58:57 -05:00
|
|
|
public max = (state: GameState): number => {
|
2021-09-11 22:45:52 -05:00
|
|
|
return (
|
2021-09-12 13:58:57 -05:00
|
|
|
(state.resource.compounds?.value ?? 0) *
|
2021-09-11 22:45:52 -05:00
|
|
|
(state.config.cfgCapacity.compounds?.compoundManagers ?? 0)
|
2021-09-11 20:37:33 -05:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-09-12 13:58:57 -05:00
|
|
|
public isUnlocked = (state: GameState): boolean => {
|
2021-09-11 20:37:33 -05:00
|
|
|
if (this._isUnlocked) return true;
|
|
|
|
this._isUnlocked = state.resource.compounds?.isUnlocked(state) === true;
|
|
|
|
return this._isUnlocked;
|
2021-09-12 13:58:57 -05:00
|
|
|
};
|
2021-09-11 20:37:33 -05:00
|
|
|
}
|