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

24 lines
623 B
TypeScript
Raw Normal View History

2021-08-21 19:53:43 -05:00
/// <reference path="./Infrastructure.ts" />
class House extends Infrastructure {
constructor () {
super('Houses',
'Provides room to house 10 followers.');
2021-08-22 13:48:48 -05:00
this.cost.money = 75000;
this._costMultiplier.money = 1.01;
2021-08-21 19:53:43 -05:00
}
2021-09-05 14:45:37 -05:00
// two houses per compound
public max: (state: GameState) => number = (state) =>
state.getResource('cmpnd').value * 2;
2021-08-21 19:53:43 -05:00
public isUnlocked (state: GameState): boolean {
if (this._isUnlocked) return true;
2021-08-22 11:07:49 -05:00
const compounds: IResource = state.getResource('cmpnd');
if (compounds.value > 0) {
2021-08-21 19:53:43 -05:00
this._isUnlocked = true;
}
return this._isUnlocked;
}
}