First commit, done on M6 from the PLAN.MD
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Shared constants and tiny helpers. No game logic here.
|
||||
|
||||
export const STATE_VERSION = 1;
|
||||
|
||||
export const IND_IDS = [
|
||||
"order", "stability", "civilRights", "opinion", "economy",
|
||||
"hardPower", "softPower", "unrest", "armyLoyalty",
|
||||
];
|
||||
export const VAR_IDS = ["growth", "unemployment", "inflation"];
|
||||
export const TAX_IDS = ["income", "corporate", "vat"];
|
||||
|
||||
export const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
|
||||
|
||||
// Saturating curve: overspending has diminishing returns, ratio 0 gives 0.
|
||||
export function qualityFromRatio(ratio, bal) {
|
||||
return 100 * (1 - Math.exp(-bal.sector.qualityCurve * Math.max(0, ratio)));
|
||||
}
|
||||
Reference in New Issue
Block a user