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/Pastor.ts

31 lines
811 B
TypeScript
Raw Normal View History

2021-08-22 11:07:49 -05:00
/// <reference path="./Job.ts" />
class Pastor extends Job {
public readonly resourceKey = ResourceKey.pastors;
constructor() {
super(
2021-09-06 08:51:41 -05:00
'Pastors',
'pastor',
'pastors',
'Collect tithings for you and recruit new members from other faiths automatically.'
);
2021-08-22 11:07:49 -05:00
}
public max = (state: GameState): number => {
let max =
(state.resource.churches?.value ?? 0) *
(state.config.cfgCapacity.churches?.pastors ?? 0);
max +=
(state.resource.megaChurches?.value ?? 0) *
(state.config.cfgCapacity.megaChurches?.pastors ?? 0);
return max;
2021-09-05 14:45:37 -05:00
};
2021-08-22 11:07:49 -05:00
public isUnlocked = (state: GameState): boolean => {
2021-08-22 11:07:49 -05:00
if (this._isUnlocked) return true;
this._isUnlocked = state.resource.churches?.isUnlocked(state) === true;
2021-09-04 23:11:13 -05:00
return this._isUnlocked;
};
2021-08-22 11:07:49 -05:00
}