fix(game): 국가 수 판정에서 합성 재야를 제외한다
Ref nation table에 없는 id=0 행이 정찰 차단과 월간 경매 난수 소비에 관여하지 않도록 모집단을 맞춘다. Ref의 maxnation 건국 표시 제한도 실행 제약을 늘리지 않고 명령표에 이관한다.
This commit is contained in:
@@ -213,9 +213,10 @@ describe('buildTurnCommandTable', () => {
|
||||
for (const field of command.inputFields) {
|
||||
expect(supportedKinds.has(field.kind), `${scope}:${command.key}:${field.key}`).toBe(true);
|
||||
if (field.kind === 'select') {
|
||||
expect(Boolean(field.options?.length || field.optionSource), `${scope}:${command.key}:${field.key}`).toBe(
|
||||
true
|
||||
);
|
||||
expect(
|
||||
Boolean(field.options?.length || field.optionSource),
|
||||
`${scope}:${command.key}:${field.key}`
|
||||
).toBe(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,6 +341,34 @@ describe('buildTurnCommandTable', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('hides founding at the Ref maxnation boundary without counting Core id=0', async () => {
|
||||
const worldState = buildWorldState();
|
||||
worldState.meta = {
|
||||
...((worldState.meta ?? {}) as Record<string, unknown>),
|
||||
refGameEnv: { maxnation: '2' },
|
||||
};
|
||||
const buildAtCount = (realNationCount: number) =>
|
||||
buildTurnCommandTable({
|
||||
worldState,
|
||||
general: buildGeneral(),
|
||||
city: buildCity(),
|
||||
nation: buildNation(),
|
||||
nationGenerals: null,
|
||||
realNationCount,
|
||||
});
|
||||
const findFounding = (table: Awaited<ReturnType<typeof buildAtCount>>) =>
|
||||
table.general.flatMap((group) => group.values).find((command) => command.key === 'che_건국');
|
||||
|
||||
expect(findFounding(await buildAtCount(1))).not.toMatchObject({
|
||||
reason: '더 이상 건국은 불가능합니다.',
|
||||
});
|
||||
expect(findFounding(await buildAtCount(2))).toMatchObject({
|
||||
possible: false,
|
||||
status: 'blocked',
|
||||
reason: '더 이상 건국은 불가능합니다.',
|
||||
});
|
||||
});
|
||||
|
||||
it('projects Ref recruitment availability, combat values, descriptions, and adjusted costs', () => {
|
||||
const general = buildGeneral();
|
||||
general.injury = 3;
|
||||
|
||||
Reference in New Issue
Block a user