Merge branch 'main' into feature/frontend-public-gaps
This commit is contained in:
@@ -1229,6 +1229,13 @@ export const createReservedTurnHandler = async (options: {
|
||||
const hasNationChange = (resolution.patches?.cities ?? []).some((patch) =>
|
||||
Object.prototype.hasOwnProperty.call(patch.patch ?? {}, 'nationId')
|
||||
);
|
||||
const refreshesFrontForDiplomacyState =
|
||||
actionKey === 'che_이호경식' &&
|
||||
resolution.effects.some(
|
||||
(effect) =>
|
||||
effect.type === 'diplomacy:patch' &&
|
||||
Object.prototype.hasOwnProperty.call(effect.patch, 'state')
|
||||
);
|
||||
// 레거시 건국 계열과 무작위 수도 이전은 명령이 직접 지정한
|
||||
// front 값만 바꾸고 전체 전선을 즉시 재계산하지 않는다.
|
||||
const preservesImmediateFrontState = [
|
||||
@@ -1237,7 +1244,7 @@ export const createReservedTurnHandler = async (options: {
|
||||
'che_무작위건국',
|
||||
'che_무작위수도이전',
|
||||
].includes(actionKey);
|
||||
if (hasNationChange && !preservesImmediateFrontState) {
|
||||
if ((hasNationChange || refreshesFrontForDiplomacyState) && !preservesImmediateFrontState) {
|
||||
const worldView = worldOverlay?.view ?? worldRef;
|
||||
if (worldView && options.map) {
|
||||
const frontPatches = buildFrontStatePatches({
|
||||
|
||||
@@ -189,6 +189,7 @@ export const projectCoreDatabaseSnapshot = (rows: {
|
||||
war: readNumber(meta, 'war'),
|
||||
diplomacyLimit: readNumber(meta, 'surlimit'),
|
||||
capitalRevision: readNumber(meta, 'capset'),
|
||||
strategicCommandLimit: readNumber(meta, 'strategic_cmd_limit'),
|
||||
meta,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -270,6 +270,7 @@ const buildNation = (row: Record<string, unknown>, generals: TurnGeneral[]): Nat
|
||||
war: readNumber(row, 'war', readNumber(meta, 'war')),
|
||||
surlimit: readNumber(row, 'diplomacyLimit', readNumber(meta, 'surlimit')),
|
||||
capset: readNumber(row, 'capitalRevision', readNumber(meta, 'capset')),
|
||||
strategic_cmd_limit: readNumber(row, 'strategicCommandLimit', readNumber(meta, 'strategic_cmd_limit')),
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -529,6 +530,7 @@ const projectWorld = (
|
||||
war: readNumber(nation.meta, 'war'),
|
||||
diplomacyLimit: readNumber(nation.meta, 'surlimit'),
|
||||
capitalRevision: readNumber(nation.meta, 'capset'),
|
||||
strategicCommandLimit: readNumber(nation.meta, 'strategic_cmd_limit'),
|
||||
meta: nation.meta,
|
||||
})),
|
||||
diplomacy: world
|
||||
|
||||
@@ -19,7 +19,7 @@ const ignoredLifecyclePaths = [
|
||||
/^world\.turnTime$/,
|
||||
/^generals\[[^\]]+\]\.(?:turnTime|recentWarTime|lastTurn|killTurn|mySet)(?:\.|$)/,
|
||||
/^generals\[[^\]]+\]\.meta(?:\.|$)/,
|
||||
/^nations\[[^\]]+\]\.meta(?:\.|$)/,
|
||||
/^nations\[[^\]]+\]\.meta\.(?:turn_last_\d+|next_execute_.+|capset|tech|gennum|war|surlimit|strategic_cmd_limit)(?:\.|$)/,
|
||||
];
|
||||
|
||||
const general = (id: number, nationId: number, cityId: number, officerLevel: number): Record<string, unknown> => ({
|
||||
@@ -115,6 +115,7 @@ const buildRequest = (
|
||||
typeCode: 'che_명가',
|
||||
war: 0,
|
||||
diplomacyLimit: 0,
|
||||
strategicCommandLimit: 0,
|
||||
generalCount: 2,
|
||||
meta: { can_국호변경: 1, can_국기변경: 1, surlimit: 0 },
|
||||
...fixturePatches.nations?.[1],
|
||||
@@ -130,6 +131,7 @@ const buildRequest = (
|
||||
typeCode: 'che_명가',
|
||||
war: 0,
|
||||
diplomacyLimit: 0,
|
||||
strategicCommandLimit: 0,
|
||||
generalCount: 1,
|
||||
meta: { surlimit: 0 },
|
||||
...fixturePatches.nations?.[2],
|
||||
@@ -307,6 +309,13 @@ const cases: NationMatrixCase[] = [
|
||||
researchCase('event_극병연구', '극병 연구', 23),
|
||||
researchCase('event_상병연구', '상병 연구', 23),
|
||||
researchCase('event_무희연구', '무희 연구', 23),
|
||||
['che_백성동원', { destCityID: 70 }, { cities: { 70: { nationId: 1 } } }],
|
||||
[
|
||||
'che_이호경식',
|
||||
{ destNationID: 2 },
|
||||
{ diplomacy: { '1:2': { state: 1, term: 12 }, '2:1': { state: 1, term: 12 } } },
|
||||
],
|
||||
['che_급습', { destNationID: 2 }, { diplomacy: { '1:2': { state: 1, term: 12 }, '2:1': { state: 1, term: 12 } } }],
|
||||
];
|
||||
|
||||
integration('nation command success matrix', () => {
|
||||
|
||||
Reference in New Issue
Block a user