feat: 사용자 군주 자동 선전포고를 분리한다
This commit is contained in:
@@ -61,10 +61,11 @@ export const AVAILABLE_INSTANT_TURN: Record<string, boolean> = {
|
||||
NPC전방발령: true,
|
||||
};
|
||||
|
||||
export type UserRulerAutomationFeature = 'diplomacy' | 'promotion' | 'finance' | 'capital';
|
||||
export type UserRulerAutomationFeature = 'diplomacy' | 'war' | 'promotion' | 'finance' | 'capital';
|
||||
|
||||
const USER_RULER_AUTOMATION_META_KEY = {
|
||||
diplomacy: 'use_auto_nation_diplomacy',
|
||||
war: 'use_auto_nation_war',
|
||||
promotion: 'use_auto_nation_promotion',
|
||||
finance: 'use_auto_nation_finance',
|
||||
capital: 'use_auto_nation_capital',
|
||||
@@ -72,7 +73,7 @@ const USER_RULER_AUTOMATION_META_KEY = {
|
||||
|
||||
const USER_RULER_ACTION_FEATURE: Readonly<Record<string, UserRulerAutomationFeature>> = {
|
||||
불가침제의: 'diplomacy',
|
||||
선전포고: 'diplomacy',
|
||||
선전포고: 'war',
|
||||
천도: 'capital',
|
||||
};
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ const zSetMySetting = z.object({
|
||||
use_treatment: z.number().int().optional(),
|
||||
use_auto_nation_turn: z.number().int().optional(),
|
||||
use_auto_nation_diplomacy: z.number().int().optional(),
|
||||
use_auto_nation_war: z.number().int().optional(),
|
||||
use_auto_nation_promotion: z.number().int().optional(),
|
||||
use_auto_nation_finance: z.number().int().optional(),
|
||||
use_auto_nation_capital: z.number().int().optional(),
|
||||
|
||||
@@ -1779,6 +1779,7 @@ async function handleSetMySetting(
|
||||
}
|
||||
for (const key of [
|
||||
'use_auto_nation_diplomacy',
|
||||
'use_auto_nation_war',
|
||||
'use_auto_nation_promotion',
|
||||
'use_auto_nation_finance',
|
||||
'use_auto_nation_capital',
|
||||
|
||||
@@ -718,6 +718,7 @@ describe('legacy NPC user-chief promotion parity', () => {
|
||||
it('keeps user-ruler duties individually disabled until each setting is enabled', () => {
|
||||
const ruler = makePromotionGeneral({ id: 1, officerLevel: 12, npcState: 0, meta: { killturn: 0 } });
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '천도')).toBe(false);
|
||||
expect(canUseRulerAutomation(ruler, 'finance')).toBe(false);
|
||||
|
||||
@@ -728,9 +729,17 @@ describe('legacy NPC user-chief promotion parity', () => {
|
||||
use_auto_nation_finance: 1,
|
||||
};
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(true);
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(true);
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '천도')).toBe(true);
|
||||
expect(canUseRulerAutomation(ruler, 'finance')).toBe(true);
|
||||
|
||||
ruler.meta = {
|
||||
...ruler.meta,
|
||||
use_auto_nation_diplomacy: 0,
|
||||
use_auto_nation_war: 1,
|
||||
};
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(true);
|
||||
});
|
||||
|
||||
it('honors the existing automatic nation-turn master switch for user chiefs only', () => {
|
||||
|
||||
@@ -223,6 +223,7 @@ describe('my information world commands', () => {
|
||||
use_treatment: 200,
|
||||
use_auto_nation_turn: 0,
|
||||
use_auto_nation_diplomacy: 1,
|
||||
use_auto_nation_war: 1,
|
||||
use_auto_nation_promotion: 1,
|
||||
use_auto_nation_finance: 1,
|
||||
use_auto_nation_capital: 1,
|
||||
@@ -239,6 +240,7 @@ describe('my information world commands', () => {
|
||||
use_treatment: 100,
|
||||
use_auto_nation_turn: 0,
|
||||
use_auto_nation_diplomacy: 1,
|
||||
use_auto_nation_war: 1,
|
||||
use_auto_nation_promotion: 1,
|
||||
use_auto_nation_finance: 1,
|
||||
use_auto_nation_capital: 1,
|
||||
|
||||
Reference in New Issue
Block a user