feat: Cards writings and balancing (M8)

This commit is contained in:
gauvainboiche
2026-10-25 18:30:43 +01:00
parent 04193e2013
commit c2103c32e7
43 changed files with 25930 additions and 397 deletions
+2
View File
@@ -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);