fix: 단일 잔존 국가 임관 금지를 연결한다

마지막 도시 점령으로 국가가 삭제되면 destroy_nation 시나리오 이벤트를 같은 턴 경계에서 실행한다. Ref와 같이 잔존국 scout를 금지로 바꾸고 일회성 이벤트를 삭제하되 정책 변경 잠금은 설정하지 않는다.
This commit is contained in:
2026-08-23 11:08:30 +00:00
parent 51ca5e9d70
commit 4d424d16c6
11 changed files with 209 additions and 6 deletions
+3
View File
@@ -101,6 +101,7 @@ export interface GeneralActionOutcome<TriggerState extends GeneralTriggerState =
effects: GeneralActionEffect<TriggerState>[];
completed?: boolean;
deletedTroopIds?: number[];
destroyedNationIds?: NationId[];
reservedGeneralTurnPlans?: Array<{
generalId: number;
joinTurn: number;
@@ -125,6 +126,7 @@ export interface GeneralActionResolution {
nextTurnAt: Date;
logs: LogEntryDraft[];
effects: GeneralActionEffect[];
destroyedNationIds?: NationId[];
created?: {
generals: General[];
nations?: Nation[];
@@ -406,6 +408,7 @@ export const resolveGeneralAction = <TriggerState extends GeneralTriggerState =
effects: accumulator.pendingEffects,
...(outcome?.alternative ? { alternative: outcome.alternative } : {}),
...(outcome?.deletedTroopIds?.length ? { deletedTroopIds: outcome.deletedTroopIds } : {}),
...(outcome?.destroyedNationIds?.length ? { destroyedNationIds: outcome.destroyedNationIds } : {}),
...(outcome?.reservedGeneralTurnPlans?.length
? { reservedGeneralTurnPlans: outcome.reservedGeneralTurnPlans }
: {}),
@@ -749,6 +749,9 @@ export class ActionDefinition<
return {
effects,
...(aftermath.conquest?.nationCollapsed && defenderNation
? { destroyedNationIds: [defenderNation.id] }
: {}),
...(aftermath.conquest?.ruinedNpcJoinPlans.length
? { reservedGeneralTurnPlans: aftermath.conquest.ruinedNpcJoinPlans }
: {}),
@@ -263,6 +263,7 @@ describe('che_출병', () => {
);
expect(resolution.logs.length).toBeGreaterThan(0);
expect(resolution.destroyedNationIds).toEqual([defenderNation.id]);
expect(resolution.general.recentWarTime?.toISOString()).toBe(attacker.turnTime.toISOString());
expect(resolution.patches?.generals.some((patch) => patch.id === defender.id)).toBe(true);
expect(resolution.patches?.cities.some((patch) => patch.id === defenderCity.id)).toBe(true);