2021-09-04 23:16:32 -05:00
|
|
|
/// <reference path="./Infrastructure.ts" />
|
|
|
|
|
2021-09-06 00:12:05 -05:00
|
|
|
class Megachurch extends Infrastructure {
|
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
|
|
|
'Megachurches',
|
2021-09-06 00:12:05 -05:00
|
|
|
'megachurch',
|
|
|
|
'megachurches',
|
2021-09-06 12:02:38 -05:00
|
|
|
`Room for ${formatNumber(
|
|
|
|
config.cfgCapacity.megaChurches?.pastors ?? 0
|
|
|
|
)} pastors`
|
|
|
|
);
|
2021-09-05 20:43:11 -05:00
|
|
|
this.cost.money = config.cfgInitialCost.megaChurches;
|
|
|
|
this._costMultiplier.money = config.cfgCostMultiplier.megaChurches;
|
2021-09-04 23:16:32 -05:00
|
|
|
}
|
|
|
|
|
2021-09-05 14:45:37 -05:00
|
|
|
public max: (state: GameState) => number = (state) =>
|
2021-09-05 20:43:11 -05:00
|
|
|
state.config.cfgInitialMax.megaChurches ?? 0;
|
2021-09-05 14:45:37 -05:00
|
|
|
|
2021-09-06 12:02:38 -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 permit = state.resource.buildingPermit;
|
|
|
|
if (permit !== undefined && permit.value > 0) {
|
2021-09-04 23:16:32 -05:00
|
|
|
this._isUnlocked = true;
|
|
|
|
}
|
|
|
|
return this._isUnlocked;
|
|
|
|
}
|
|
|
|
}
|