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
+6 -3
View File
@@ -12,6 +12,7 @@ import {
createItemModuleRegistry,
ITEM_KEYS,
loadItemModules,
createInheritBuffModules,
type City,
type General,
type Nation,
@@ -27,9 +28,11 @@ import { convertLog } from './logFormatter.js';
const DEFAULT_GENERAL_AGE = 20;
const itemWarModules: WarActionModule[] = createItemActionModules(
createItemModuleRegistry(await loadItemModules([...ITEM_KEYS]))
).war;
const inheritBuffModules = createInheritBuffModules();
const itemWarModules: WarActionModule[] = [
...createItemActionModules(createItemModuleRegistry(await loadItemModules([...ITEM_KEYS]))).war,
inheritBuffModules.war,
];
const normalizeItemCode = (value: string | null): string | null => (value === 'None' ? null : value);