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

32 lines
920 B
TypeScript

/// <reference path="./Infrastructure.ts" />
class Tent extends Infrastructure {
constructor(config: GameConfig) {
super(
'Tents',
'tent',
'tents',
`Provides room to house ${formatNumber(
config.cfgCapacity.tents?.followers ?? 0
)} followers.`,
true
);
this.cost.money = config.cfgInitialCost.tents;
this._costMultiplier.money = config.cfgCostMultiplier.tents;
}
public max: (state: GameState) => number = (state) => {
// ten extra tents per compound
let max = state.config.cfgInitialMax.tents ?? 0;
max +=
(state.resource.compounds?.value ?? 0) *
(state.config.cfgCapacity.compounds?.tents ?? 0);
return Math.floor(max);
};
public inc: (state: GameState) => number = (state) =>
// compound managers
(state.resource.compoundManagers?.value ?? 0) *
(state.config.cfgBuySpeed.compoundManagers?.tents ?? 0);
}