feat: add unification handler and inheritance system

- Implemented `unificationHandler.ts` to manage nation unification logic, including inheritance point calculations and logging.
- Created `InheritView.vue` for frontend management of inheritance points, buffs, and logs.
- Added database migration for new inheritance tables: `inheritance_point`, `inheritance_log`, `inheritance_result`, and `inheritance_user_state`.
- Developed inheritance buff logic in `inheritBuff.ts` to apply buffs during domestic and war actions.
This commit is contained in:
2026-01-18 10:59:04 +00:00
parent cbe960364d
commit 3ce1f441d0
19 changed files with 2947 additions and 60 deletions
@@ -14,6 +14,7 @@ import {
createItemModuleRegistry,
ITEM_KEYS,
loadItemModules,
createInheritBuffModules,
} from '@sammo-ts/logic';
import { asRecord } from '@sammo-ts/common';
@@ -107,8 +108,11 @@ export const buildReservedTurnDefinitions = async (options: {
const itemModules = await loadItemModules([...ITEM_KEYS]);
const itemRegistry = createItemModuleRegistry(itemModules);
const itemActionModules = createItemActionModules(itemRegistry);
const inheritBuffModules = createInheritBuffModules();
options.env.generalActionModules = [...(options.env.generalActionModules ?? []), ...itemActionModules.general];
options.env.warActionModules = [...(options.env.warActionModules ?? []), ...itemActionModules.war];
options.env.generalActionModules.push(inheritBuffModules.general);
options.env.warActionModules.push(inheritBuffModules.war);
const generalSpecs = await loadGeneralTurnCommandSpecs(options.commandProfile.general);
const nationSpecs = await loadNationTurnCommandSpecs(options.commandProfile.nation);