fix staged nation tax rate consumption

This commit is contained in:
2026-07-27 10:07:59 +00:00
parent de510da48e
commit 26e033665a
7 changed files with 118 additions and 49 deletions
+2 -3
View File
@@ -18,6 +18,7 @@ import {
import type { ScenarioConfig } from '@sammo-ts/logic';
import type { InMemoryTurnWorld, TurnCalendarHandler, TurnCalendarContext } from './inMemoryWorld.js';
import { resolveAppliedNationRate } from './nationTaxRate.js';
import type { TurnGeneral } from './types.js';
const resolveNumber = (source: Record<string, unknown>, keys: string[], fallback: number): number => {
@@ -30,8 +31,6 @@ const resolveNumber = (source: Record<string, unknown>, keys: string[], fallback
return fallback;
};
const resolveNationRate = (nation: Nation): number => asNumber(nation.meta.rate, 20);
const resolveNationBill = (nation: Nation): number => asNumber(nation.meta.bill, 100);
const resolveOfficerCity = (meta: Record<string, unknown>): number => {
@@ -72,7 +71,7 @@ const buildNationIncomeContext = (nation: Nation, trait: NationTraitModule | nul
? (type: TriggerNationalIncomeType, amount: number) => trait.onCalcNationalIncome!(actionContext, type, amount)
: undefined;
return {
rate: resolveNationRate(nation),
rate: resolveAppliedNationRate(nation.meta),
modifyIncome,
};
};