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

20 lines
643 B
TypeScript

/// <reference path="./Infrastructure.ts" />
class Compound extends Infrastructure {
constructor (config: GameConfig) {
super('Compounds',
'Provides space for tents, houses, and churches and a place to hide more money.');
this.cost.money = config.cfgCompoundStartingCost;
this._costMultiplier.money = config.cfgCompoundCostMultiplier;
}
public isUnlocked (state: GameState): boolean {
if (this._isUnlocked) return true;
const tents = state.resource.tents;
if (tents !== undefined && tents.value >= state.config.cfgTentStartingMax) {
this._isUnlocked = true;
}
return this._isUnlocked;
}
}