fix: match scenario 2601 monthly seed progression

This commit is contained in:
2026-08-03 18:56:23 +00:00
parent 2f17584075
commit 58b9a230a7
92 changed files with 3696 additions and 587 deletions
@@ -10,6 +10,7 @@ import { createGeneralTriggerContext } from '../src/triggers/general.js';
import {
createTraitCatalog,
createTraitModules,
loadEventDomesticTraitModules,
loadDomesticTraitModules,
loadWarTraitModules,
} from '../src/actionModules/traits/index.js';
@@ -251,6 +252,40 @@ describe('trait modules', () => {
expect(general.triggerState.flags['pre.치료']).toBe(true);
});
it('assigns event-의술 healing draws in legacy general-id order', async () => {
const eventDomestic = await loadEventDomesticTraitModules(['che_event_의술']);
const registry = createTraitCatalog({ domestic: eventDomestic });
const traitModules = createTraitModules(registry);
const pipeline = new GeneralActionPipeline(traitModules.general);
const healer = buildGeneral({
id: 818,
role: {
personality: null,
specialDomestic: 'che_event_의술',
specialWar: null,
items: { horse: null, weapon: null, book: null, item: null },
},
});
const lowerIdPatient = buildGeneral({ id: 444, name: 'Lower', injury: 12 });
const higherIdPatient = buildGeneral({ id: 775, name: 'Higher', injury: 30 });
const worldView = {
listGeneralsByCity: (_cityId: number) => [healer, higherIdPatient, lowerIdPatient],
listGenerals: () => [healer, higherIdPatient, lowerIdPatient],
};
let draw = 0;
const rng: RandomGenerator = {
nextFloat1: () => 0,
nextBool: () => draw++ === 0,
nextInt: (minInclusive: number, _maxExclusive: number) => minInclusive,
};
const triggerContext = createGeneralTriggerContext({ general: healer, rng, worldView });
pipeline.getPreTurnExecuteTriggerList({ general: healer, worldView }).fire(triggerContext, {});
expect(lowerIdPatient.injury).toBe(0);
expect(higherIdPatient.injury).toBe(30);
});
it('activates 의술 battle trigger and reduces damage', async () => {
const domestic = await loadDomesticTraitModules(['che_인덕', 'che_발명']);
const war = await loadWarTraitModules(['che_의술', 'che_징병']);