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

25 lines
618 B
TypeScript
Raw Normal View History

2021-08-22 11:07:49 -05:00
/// <reference path="./Infrastructure.ts" />
class Church extends Infrastructure {
constructor () {
super('Churches',
'Preaching grounds for 2 pastors.');
2021-08-22 13:48:48 -05:00
this.cost.money = 150000;
2021-08-22 11:07:49 -05:00
this._costMultiplier.money = 1.01;
2021-08-22 13:48:48 -05:00
}
public max (state: GameState): number {
// one church per compound
return state.getResource('cmpnd').value;
}
public isUnlocked (state: GameState): boolean {
if (this._isUnlocked) return true;
const compounds: IResource = state.getResource('cmpnd');
if (compounds.value > 0) {
this._isUnlocked = true;
}
return this._isUnlocked;
2021-08-22 11:07:49 -05:00
}
}