feat(items): add new item modules and enhance item functionality

- Introduced various item modules including '흑색마', '사륜거', '단궁', '동호비궁', '도기', '변도론', '전론', and '환약'.
- Implemented stat item modules to enhance general and war action contexts.
- Added triggers for item healing and sniping actions during battles.
- Enhanced item management with new utility functions for inventory handling.
- Updated the item registry and loader to support new items and their functionalities.
- Improved the overall structure of item-related code for better maintainability and scalability.
This commit is contained in:
2026-01-03 09:28:46 +00:00
parent e10bcba49b
commit d1522ff450
21 changed files with 1248 additions and 1 deletions
+11
View File
@@ -8,11 +8,16 @@ import {
LogScope,
resolveDefenderOrder,
resolveWarBattle,
createItemActionModules,
createItemModuleRegistry,
ITEM_KEYS,
loadItemModules,
type City,
type General,
type Nation,
type UnitSetDefinition,
type WarBattleOutcome,
type WarActionModule,
} from '@sammo-ts/logic';
import {
@@ -24,6 +29,10 @@ import { convertLog } from './logFormatter.js';
const DEFAULT_GENERAL_AGE = 20;
const itemWarModules: WarActionModule[] = createItemActionModules(
createItemModuleRegistry(await loadItemModules([...ITEM_KEYS]))
).war;
const normalizeItemCode = (value: string | null): string | null =>
value === 'None' ? null : value;
@@ -324,11 +333,13 @@ export const processBattleSimJob = (payload: BattleSimJobPayload): BattleSimResu
general: attackerGeneral,
city: attackerCity,
nation: attackerNation,
modules: itemWarModules,
},
defenders: defenderGenerals.map((general) => ({
general,
city: defenderCity,
nation: defenderNation,
modules: itemWarModules,
})),
defenderCity,
defenderNation,