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