feat: Cards writings and balancing (M8)
This commit is contained in:
@@ -7,6 +7,8 @@ import { biasFor } from "./modifiers.js";
|
||||
export function stepSectors(state, bal, fiscal) {
|
||||
const s = bal.sector;
|
||||
for (const [id, sec] of Object.entries(state.sectors)) {
|
||||
// Needs grow with population, ageing and prices: standing still buys less each year.
|
||||
sec.need *= Math.pow(1 + (bal.needGrowth?.[id] ?? 0), 1 / 365);
|
||||
let target = qualityFromRatio(sec.alloc / sec.need, bal) + biasFor(state, "sector", id);
|
||||
if (id === "industry" && fiscal.debtRatio > s.industryDebtPenaltyFrom) {
|
||||
target -= s.industryDebtPenaltyPerPoint * (fiscal.debtRatio - s.industryDebtPenaltyFrom);
|
||||
|
||||
Reference in New Issue
Block a user