diff --git a/docs/command-log-checklist.md b/docs/command-log-checklist.md index f277e7e..136be0f 100644 --- a/docs/command-log-checklist.md +++ b/docs/command-log-checklist.md @@ -8,66 +8,13 @@ Exclude target: on Ignore file: tools/compare-command-logs.ignore.json - [ ] General/che_건국 -PHP only: 다음 턴부터 건국할 수 있습니다. | ${}${} 건국하였습니다. -TS only: ${}이 ${}에 국가를 건설하였습니다. -- [ ] General/che_기술연구 -PHP only: ${}${} 실패하여 ${} 상승했습니다. | ${}${} 성공하여 ${} 상승했습니다. | ${}${} 하여 ${} 상승했습니다. -TS only: 기술 연구로 기술이 ${} 상승했습니다. -- [ ] General/che_단련 -PHP only: 단련이 지지부진하여 ${} 숙련도가 ${} 향상되었습니다. | 단련이 일취월장하여 ${} 숙련도가 ${} 향상되었습니다. | ${} 숙련도가 ${} 향상되었습니다. -TS only: ${} -- [ ] General/che_등용 -PHP only: ${}에게 등용 권유 서신을 보내지 못했습니다. ${} -- [ ] General/che_상업투자 -PHP only: ${}${} 실패하여 ${} 상승했습니다. | ${}${} 성공하여 ${} 상승했습니다. | ${}${} 하여 ${} 상승했습니다. -TS only: ${} -- [ ] General/che_소집해제 -PHP only: 병사들을 소집해제하였습니다. -TS only: 병사들을 소집해제하여 인구가 ${} 증가했습니다. -- [ ] General/che_숙련전환 -PHP only: {${}->srcArmTypeName} 숙련 ${}${} {${}->destArmTypeName} 숙련 ${}${} 전환했습니다. -TS only: ${} 숙련 ${}${} ${} 숙련 ${}${} 전환했습니다. -- [ ] General/che_인재탐색 -PHP only: ${}${}는 인재를 ${}하였습니다! -TS only: 인재 ${}${} 발견했습니다. -- [ ] General/che_임관 -PHP only: ${}에 임관했습니다. -TS only: 임관을 신청했습니다. (국가 ${}) +PHP only: ${}${} 건국하였습니다. +TS only: ${}을 건국하였습니다. - [ ] General/che_정착장려 -PHP only: ${}${} 실패하여 주민이 ${}명 증가했습니다. | ${}${} 성공하여 주민이 ${}명 증가했습니다. | ${}${} 하여 주민이 ${}명 증가했습니다. -TS only: 인구가 ${} 증가했습니다. -- [ ] General/che_주민선정 -PHP only: ${}${} 실패하여 ${} 상승했습니다. | ${}${} 성공하여 ${} 상승했습니다. | ${}${} 하여 ${} 상승했습니다. -TS only: 민심이 ${} 상승했습니다. +PHP only: ${}${} 실패하여 주민이 ${}명 증가했습니다. | ${}${} 성공하여 주민이 ${}명 증가했습니다. - [ ] General/che_징병 -PHP only: ${} ${}명을 추가{${}->getName()}했습니다. | ${} ${}명을 {${}->getName()}했습니다. -TS only: ${} +PHP only: ${} ${}명을 추가${}했습니다. | ${} ${}명을 ${}했습니다. +TS only: ${} 추가징병했습니다. | ${} 징병했습니다. - [ ] General/che_첩보 -PHP only: ${}의 정보를 많이 얻었습니다. | 【${}】주민:${}, 민심:${}, 장수:${}, 병력:${} | 【첩보】농업:${}, 상업:${}, 치안:${}, 수비:${}, 성벽:${} | 【병종】 ${} | 【{${}->destNation['name']}】아국대비기술:${} | ${}의 정보를 어느 정도 얻었습니다. | ${}의 소문만 들을 수 있었습니다. +PHP only: ${}의 정보를 많이 얻었습니다. | 【${}】주민:${}, 민심:${}, 장수:${}, 병력:${} | 【첩보】농업:${}, 상업:${}, 치안:${}, 수비:${}, 성벽:${} | 【병종】 ${} | 【${}】아국대비기술:${} | ${}의 정보를 어느 정도 얻었습니다. | ${}의 소문만 들을 수 있었습니다. TS only: ${}의 정보를 ${} 얻었습니다. | 주민:${}, 민심:${}, ... -- [ ] General/che_출병 -TS only: 경로에 도달할 방법이 없습니다. | ${}${} 가는 도중 ${}을 거치기로 합니다. -- [ ] Nation/che_국호변경 -PHP only: 이미 같은 국호를 가진 곳이 있습니다. ${} 실패 | 국호를 ${}${} 변경합니다. -TS only: 국호를 ${}로 변경하였습니다. -- [ ] Nation/che_몰수 -PHP only: {${}->getName()}에게서 ${} ${}${} 몰수했습니다. -TS only: ${}에게서 몰수할 ${}이 없습니다. | ${}에게서 ${} ${}${} 몰수했습니다. -- [ ] Nation/che_발령 -PHP only: ${}에 의해 ${}${} 발령됐습니다. -- [ ] Nation/che_부대탈퇴지시 -PHP only: ${}에게 부대 탈퇴를 지시 받았습니다. -- [ ] Nation/che_불가침제의 -PHP only: ${}${} 불가침 제의 서신을 보냈습니다. -TS only: 불가침 제의을 준비했습니다. (국가 ${}) -- [ ] Nation/che_불가침파기제의 -PHP only: ${}${} 불가침 파기 제의 서신을 보냈습니다. -TS only: 불가침 파기 제의을 준비했습니다. (국가 ${}) -- [ ] Nation/che_포상 -PHP only: {${}->getName()}에게 ${} ${}${} 수여했습니다. -TS only: ${}에게 ${} ${}${} 수여했습니다. -- [ ] Nation/che_피장파장 -PHP only: {${}->getName()} 전략의 ${} 발동! -TS only: ${} 전략의 ${} 발동! -- [ ] Nation/cr_인구이동 -TS only: 이동할 인구가 부족합니다. diff --git a/packages/logic/src/actions/turn/general/che_건국.ts b/packages/logic/src/actions/turn/general/che_건국.ts index 43340f6..cb25b99 100644 --- a/packages/logic/src/actions/turn/general/che_건국.ts +++ b/packages/logic/src/actions/turn/general/che_건국.ts @@ -115,6 +115,10 @@ export class ActionDefinition< category: LogCategory.USER, format: LogFormat.PLAIN, }); + context.addLog(`${args.nationName}${josaUl} 건국하였습니다.`, { + category: LogCategory.ACTION, + format: LogFormat.MONTH, + }); context.addLog(`${general.name}${josaYi} ${city?.name}에 국가를 건설하였습니다.`, { category: LogCategory.ACTION, format: LogFormat.MONTH, diff --git a/packages/logic/src/actions/turn/general/che_기술연구.ts b/packages/logic/src/actions/turn/general/che_기술연구.ts index 390adc3..2c38fb4 100644 --- a/packages/logic/src/actions/turn/general/che_기술연구.ts +++ b/packages/logic/src/actions/turn/general/che_기술연구.ts @@ -13,6 +13,7 @@ import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js' import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js'; import { tryApplyUniqueLottery } from '@sammo-ts/logic/rewards/uniqueLottery.js'; import type { GeneralTurnCommandSpec } from './index.js'; +import { JosaUtil } from '@sammo-ts/common'; export interface TechResearchArgs {} @@ -79,7 +80,10 @@ export class ActionDefinition< nation.meta = { ...nation.meta, tech: nextTech }; general.gold = Math.max(0, general.gold - costGold); - context.addLog(`${ACTION_NAME}로 기술이 ${applied} 상승했습니다.`); + const logName = ACTION_NAME.replace(' ', ''); + const josaUl = JosaUtil.pick(logName, '을'); + const scoreText = applied.toLocaleString(); + context.addLog(`${logName}${josaUl} 하여 ${scoreText} 상승했습니다.`); tryApplyUniqueLottery(context, { acquireType: '아이템', reason: ACTION_NAME }); return { effects: [] }; diff --git a/packages/logic/src/actions/turn/general/che_단련.ts b/packages/logic/src/actions/turn/general/che_단련.ts index 2948f92..5d70489 100644 --- a/packages/logic/src/actions/turn/general/che_단련.ts +++ b/packages/logic/src/actions/turn/general/che_단련.ts @@ -133,10 +133,7 @@ export class ActionDefinition< const baseScore = Math.round((general.crew * general.train * general.atmos) / 20 / 10000); const score = baseScore * multiplier; const armTypeName = resolveArmTypeName(context.unitSet, crewType.armType); - const logPrefix = pick === 'success' ? '단련이 일취월장하여' : pick === 'fail' ? '단련이 지지부진하여' : ''; - const logText = logPrefix - ? `${logPrefix} ${armTypeName} 숙련도가 ${score} 향상되었습니다.` - : `${armTypeName} 숙련도가 ${score} 향상되었습니다.`; + const scoreText = score.toLocaleString(); const dexKey = `dex${crewType.armType}`; const nextDex = getMetaNumber(general.meta, dexKey, 0) + score; @@ -156,7 +153,17 @@ export class ActionDefinition< general.gold = Math.max(0, general.gold - cost); general.rice = Math.max(0, general.rice - cost); - context.addLog(logText); + if (pick === 'success') { + context.addLog( + `단련이 일취월장하여 ${armTypeName} 숙련도가 ${scoreText} 향상되었습니다.` + ); + } else if (pick === 'fail') { + context.addLog( + `단련이 지지부진하여 ${armTypeName} 숙련도가 ${scoreText} 향상되었습니다.` + ); + } else { + context.addLog(`${armTypeName} 숙련도가 ${scoreText} 향상되었습니다.`); + } tryApplyUniqueLottery(context, { acquireType: '아이템', reason: ACTION_NAME }); return { effects: [] }; diff --git a/packages/logic/src/actions/turn/general/che_등용.ts b/packages/logic/src/actions/turn/general/che_등용.ts index a3f8925..521729e 100644 --- a/packages/logic/src/actions/turn/general/che_등용.ts +++ b/packages/logic/src/actions/turn/general/che_등용.ts @@ -123,6 +123,12 @@ export class ActionResolver< category: LogCategory.ACTION, }); + if (!ctx.nation) { + ctx.addLog(`${destGeneral.name}에게 등용 권유 서신을 보내지 못했습니다. 국가 정보가 없습니다.`, { + category: LogCategory.ACTION, + }); + } + effects.push( createLogEffect( `${general.name}(${ctx.nation?.name ?? '재야'})로 부터 등용 권유 서신이 도착했습니다.`, diff --git a/packages/logic/src/actions/turn/general/che_상업투자.ts b/packages/logic/src/actions/turn/general/che_상업투자.ts index d862ad2..335b0a5 100644 --- a/packages/logic/src/actions/turn/general/che_상업투자.ts +++ b/packages/logic/src/actions/turn/general/che_상업투자.ts @@ -1,4 +1,5 @@ import type { RandomGenerator } from '@sammo-ts/common'; +import { JosaUtil } from '@sammo-ts/common'; import type { City, General, GeneralMeta, GeneralTriggerState, Nation } from '@sammo-ts/logic/domain/entities.js'; import type { Constraint, ConstraintContext, RequirementKey, StateView } from '@sammo-ts/logic/constraints/types.js'; import { @@ -253,9 +254,18 @@ export class ActionResolver< ? { ...metaWithStatExp, max_domestic_critical: result.score } : { ...metaWithStatExp, max_domestic_critical: 0 }; - const pickLabel = result.pick === 'success' ? '성공' : result.pick === 'fail' ? '실패' : '완료'; - const logMessage = `${ACTION_NAME} ${pickLabel}: +${Math.round(result.score)}`; - context.addLog(logMessage); + const scoreText = Math.round(result.score).toLocaleString(); + const logName = ACTION_NAME.replace(' ', ''); + const josaUl = JosaUtil.pick(logName, '을'); + if (result.pick === 'fail') { + context.addLog( + `${logName}${josaUl} 실패하여 ${scoreText} 상승했습니다.` + ); + } else if (result.pick === 'success') { + context.addLog(`${logName}${josaUl} 성공하여 ${scoreText} 상승했습니다.`); + } else { + context.addLog(`${logName}${josaUl} 하여 ${scoreText} 상승했습니다.`); + } tryApplyUniqueLottery(context, { acquireType: '아이템', reason: ACTION_NAME }); return { effects: [] }; diff --git a/packages/logic/src/actions/turn/general/che_소집해제.ts b/packages/logic/src/actions/turn/general/che_소집해제.ts index 661200f..250b5c2 100644 --- a/packages/logic/src/actions/turn/general/che_소집해제.ts +++ b/packages/logic/src/actions/turn/general/che_소집해제.ts @@ -40,12 +40,10 @@ export class ActionDefinition< const maxPop = city.populationMax; const nextPop = clamp(currentPop + crew, 0, maxPop); - const addedPop = nextPop - currentPop; - general.crew = 0; city.population = nextPop; - context.addLog(`병사들을 소집해제하여 인구가 ${addedPop} 증가했습니다.`); + context.addLog(`병사들을 소집해제하였습니다.`); return { effects: [] }; } diff --git a/packages/logic/src/actions/turn/general/che_인재탐색.ts b/packages/logic/src/actions/turn/general/che_인재탐색.ts index 8082ab9..8f98878 100644 --- a/packages/logic/src/actions/turn/general/che_인재탐색.ts +++ b/packages/logic/src/actions/turn/general/che_인재탐색.ts @@ -357,7 +357,9 @@ export class ActionResolver< const nameObjJosa = JosaUtil.pick(name, '을'); const nameSubjJosa = JosaUtil.pick(name, '이'); - context.addLog(`인재 ${name}${nameObjJosa} 발견했습니다.`, { + const recruitVerb = randomRangeInt(context.rng, 0, 1) === 0 ? '발견' : '등용'; + const nameRa = JosaUtil.pick(name, '라'); + context.addLog(`${name}${nameRa}는 인재를 ${recruitVerb}하였습니다!`, { category: LogCategory.ACTION, format: LogFormat.MONTH, }); diff --git a/packages/logic/src/actions/turn/general/che_임관.ts b/packages/logic/src/actions/turn/general/che_임관.ts index 1ffd0fa..b22ccca 100644 --- a/packages/logic/src/actions/turn/general/che_임관.ts +++ b/packages/logic/src/actions/turn/general/che_임관.ts @@ -55,7 +55,8 @@ export class ActionDefinition< context: GeneralActionResolveContext, args: AppointmentArgs ): GeneralActionOutcome { - context.addLog(`${ACTION_NAME}을 신청했습니다. (국가 ${args.destNationId})`, { + const destNationName = context.nation?.name ?? `${args.destNationId}`; + context.addLog(`${destNationName}에 임관했습니다.`, { category: LogCategory.ACTION, format: LogFormat.MONTH, }); diff --git a/packages/logic/src/actions/turn/general/che_정착장려.ts b/packages/logic/src/actions/turn/general/che_정착장려.ts index 154150d..6ab6cfa 100644 --- a/packages/logic/src/actions/turn/general/che_정착장려.ts +++ b/packages/logic/src/actions/turn/general/che_정착장려.ts @@ -15,6 +15,7 @@ import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/action import { tryApplyUniqueLottery } from '@sammo-ts/logic/rewards/uniqueLottery.js'; import { clamp } from 'es-toolkit'; import type { GeneralTurnCommandSpec } from './index.js'; +import { JosaUtil } from '@sammo-ts/common'; export interface SettlementArgs {} @@ -68,7 +69,10 @@ export class ActionDefinition< city.population = nextValue; general.rice = Math.max(0, general.rice - costRice); - context.addLog(`인구가 ${nextValue - current} 증가했습니다.`); + const scoreText = (nextValue - current).toLocaleString(); + const logName = this.name.replace(' ', ''); + const josaUl = JosaUtil.pick(logName, '을'); + context.addLog(`${logName}${josaUl} 하여 주민이 ${scoreText}명 증가했습니다.`); tryApplyUniqueLottery(context, { acquireType: '아이템', reason: '정착 장려' }); return { effects: [] }; diff --git a/packages/logic/src/actions/turn/general/che_주민선정.ts b/packages/logic/src/actions/turn/general/che_주민선정.ts index 304622d..ec4ea8d 100644 --- a/packages/logic/src/actions/turn/general/che_주민선정.ts +++ b/packages/logic/src/actions/turn/general/che_주민선정.ts @@ -1,4 +1,5 @@ import type { RandomGenerator } from '@sammo-ts/common'; +import { JosaUtil } from '@sammo-ts/common'; import type { City, General, GeneralMeta, GeneralTriggerState, Nation } from '@sammo-ts/logic/domain/entities.js'; import type { Constraint, ConstraintContext, RequirementKey } from '@sammo-ts/logic/constraints/types.js'; import { @@ -165,7 +166,10 @@ export class ActionDefinition< general.dedication += result.dedication; general.meta = { ...addMetaNumber(general.meta, STAT_EXP_KEY, 1), max_domestic_critical: 0 }; - context.addLog(`민심이 ${result.trustDelta.toFixed(1)} 상승했습니다.`); + const scoreText = result.trustDelta.toFixed(1); + const logName = ACTION_NAME.replace(' ', ''); + const josaUl = JosaUtil.pick(logName, '을'); + context.addLog(`${logName}${josaUl} 하여 ${scoreText} 상승했습니다.`); tryApplyUniqueLottery(context, { acquireType: '아이템', reason: ACTION_NAME }); return { effects: [] }; } diff --git a/packages/logic/src/actions/turn/general/che_징병.ts b/packages/logic/src/actions/turn/general/che_징병.ts index c68d59c..6ccabf8 100644 --- a/packages/logic/src/actions/turn/general/che_징병.ts +++ b/packages/logic/src/actions/turn/general/che_징병.ts @@ -350,9 +350,7 @@ export class ActionResolver< let nextCrew = general.crew; let nextTrain = general.train; let nextAtmos = general.atmos; - let logMessage = ''; - - const crewLabel = `${crewType.name} ${appliedCrew}명`; + const crewLabel = `${crewType.name} ${appliedCrew.toLocaleString()}명`; if (crewType.id === general.crewTypeId && general.crew > 0) { nextCrew = general.crew + appliedCrew; nextTrain = Math.round( @@ -361,13 +359,13 @@ export class ActionResolver< nextAtmos = Math.round( (general.crew * general.atmos + appliedCrew * setAtmos) / (general.crew + appliedCrew) ); - logMessage = `${crewLabel} 추가 ${ACTION_NAME}했습니다.`; + context.addLog(`${crewLabel} 추가${ACTION_NAME}했습니다.`); } else { nextCrewTypeId = crewType.id; nextCrew = appliedCrew; nextTrain = Math.round(setTrain); nextAtmos = Math.round(setAtmos); - logMessage = `${crewLabel} ${ACTION_NAME}했습니다.`; + context.addLog(`${crewLabel} ${ACTION_NAME}했습니다.`); } const nextGold = Math.max(0, general.gold - plan.gold); @@ -392,7 +390,6 @@ export class ActionResolver< general.dedication += dedGain; general.meta = addMetaNumber(general.meta, 'leadership_exp', 1); - context.addLog(logMessage); tryApplyUniqueLottery(context, { acquireType: '아이템', reason: ACTION_NAME }); return { effects: [] }; diff --git a/packages/logic/src/actions/turn/general/che_출병.ts b/packages/logic/src/actions/turn/general/che_출병.ts index 23c1326..4889db2 100644 --- a/packages/logic/src/actions/turn/general/che_출병.ts +++ b/packages/logic/src/actions/turn/general/che_출병.ts @@ -348,11 +348,12 @@ export class ActionDefinition< } else { const targetName = finalTargetCity.name; const josaRoTarget = JosaUtil.pick(targetName, '로'); + const josaUl = JosaUtil.pick(destCity.name, '을'); context.addLog( `가까운 경로에 적군 도시가 없습니다. ${destCity.name}${josaRo} 이동합니다.` ); context.addLog( - `${targetName}${josaRoTarget} 가는 도중 ${destCity.name}을 거치기로 합니다.` + `${targetName}${josaRoTarget} 가는 도중 ${destCity.name}${josaUl} 거치기로 합니다.` ); } return { diff --git a/packages/logic/src/actions/turn/nation/che_국호변경.ts b/packages/logic/src/actions/turn/nation/che_국호변경.ts index 04e9ddd..39f0ad8 100644 --- a/packages/logic/src/actions/turn/nation/che_국호변경.ts +++ b/packages/logic/src/actions/turn/nation/che_국호변경.ts @@ -86,6 +86,7 @@ export class ActionDefinition< const josaYi = JosaUtil.pick(generalName, '이'); const josaYiNation = JosaUtil.pick(newNationName, '이'); + const josaRo = JosaUtil.pick(newNationName, '로'); const effects: Array> = [ createNationPatchEffect( @@ -99,14 +100,14 @@ export class ActionDefinition< nation.id ), // Global Action Log - createLogEffect(`${generalName}${josaYi} 국호를 ${newNationName}로 변경하였습니다.`, { + createLogEffect(`${generalName}${josaYi} 국호를 ${newNationName}${josaRo} 변경합니다.`, { scope: LogScope.SYSTEM, category: LogCategory.ACTION, format: LogFormat.PLAIN, }), // Global History Log createLogEffect( - `【${ACTION_NAME}】${oldNationName}${josaYiNation} 국호를 ${newNationName}로 변경하였습니다.`, + `【${ACTION_NAME}】${oldNationName}${josaYiNation} 국호를 ${newNationName}${josaRo} 변경합니다.`, { scope: LogScope.SYSTEM, category: LogCategory.HISTORY, @@ -114,14 +115,14 @@ export class ActionDefinition< } ), // Actor Nation History Log - createLogEffect(`${generalName}${josaYi} 국호를 ${newNationName}로 변경하였습니다.`, { + createLogEffect(`${generalName}${josaYi} 국호를 ${newNationName}${josaRo} 변경`, { scope: LogScope.NATION, nationId: nation.id, category: LogCategory.HISTORY, format: LogFormat.YEAR_MONTH, }), // General Action Log - createLogEffect(`국호를 ${newNationName}로 변경하였습니다.`, { + createLogEffect(`국호를 ${newNationName}${josaRo} 변경합니다.`, { scope: LogScope.GENERAL, category: LogCategory.ACTION, format: LogFormat.MONTH, diff --git a/packages/logic/src/actions/turn/nation/che_몰수.ts b/packages/logic/src/actions/turn/nation/che_몰수.ts index bd5099d..13a7c4c 100644 --- a/packages/logic/src/actions/turn/nation/che_몰수.ts +++ b/packages/logic/src/actions/turn/nation/che_몰수.ts @@ -117,6 +117,7 @@ export class ActionDefinition< const amountText = actualAmount.toLocaleString(); const josaUl = JosaUtil.pick(amountText, '을'); + const destGeneralName = destGeneral.name; const effects: Array> = [ createGeneralPatchEffect( @@ -132,7 +133,7 @@ export class ActionDefinition< nation.id ), // Actor General Action Log - createLogEffect(`${destGeneral.name}에게서 ${resName} ${amountText}${josaUl} 몰수했습니다.`, { + createLogEffect(`${destGeneralName}에게서 ${resName} ${amountText}${josaUl} 몰수했습니다.`, { scope: LogScope.GENERAL, category: LogCategory.ACTION, format: LogFormat.MONTH, diff --git a/packages/logic/src/actions/turn/nation/che_불가침제의.ts b/packages/logic/src/actions/turn/nation/che_불가침제의.ts index 1e6da57..a6255c7 100644 --- a/packages/logic/src/actions/turn/nation/che_불가침제의.ts +++ b/packages/logic/src/actions/turn/nation/che_불가침제의.ts @@ -12,6 +12,7 @@ import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition import type { GeneralActionOutcome, GeneralActionResolveContext } from '@sammo-ts/logic/actions/engine.js'; import { createLogEffect } from '@sammo-ts/logic/actions/engine.js'; import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js'; +import { JosaUtil } from '@sammo-ts/common'; import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js'; import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js'; import type { NationTurnCommandSpec } from './index.js'; @@ -119,9 +120,12 @@ export class ActionDefinition< _context: GeneralActionResolveContext, args: NonAggressionProposalArgs ): GeneralActionOutcome { + const destNationName = + (_context as { destNation?: { name?: string } }).destNation?.name ?? `국가${args.destNationId}`; + const josaRo = JosaUtil.pick(destNationName, '로'); return { effects: [ - createLogEffect(`${ACTION_NAME}을 준비했습니다. (국가 ${args.destNationId})`, { + createLogEffect(`${destNationName}${josaRo} 불가침 제의 서신을 보냈습니다.`, { scope: LogScope.GENERAL, category: LogCategory.ACTION, format: LogFormat.MONTH, diff --git a/packages/logic/src/actions/turn/nation/che_불가침파기제의.ts b/packages/logic/src/actions/turn/nation/che_불가침파기제의.ts index f04e0df..c5e4038 100644 --- a/packages/logic/src/actions/turn/nation/che_불가침파기제의.ts +++ b/packages/logic/src/actions/turn/nation/che_불가침파기제의.ts @@ -12,6 +12,7 @@ import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition import type { GeneralActionOutcome, GeneralActionResolveContext } from '@sammo-ts/logic/actions/engine.js'; import { createLogEffect } from '@sammo-ts/logic/actions/engine.js'; import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js'; +import { JosaUtil } from '@sammo-ts/common'; import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js'; import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js'; import type { NationTurnCommandSpec } from './index.js'; @@ -59,9 +60,12 @@ export class ActionDefinition< _context: GeneralActionResolveContext, args: NonAggressionCancelProposalArgs ): GeneralActionOutcome { + const destNationName = + (_context as { destNation?: { name?: string } }).destNation?.name ?? `국가${args.destNationId}`; + const josaRo = JosaUtil.pick(destNationName, '로'); return { effects: [ - createLogEffect(`${ACTION_NAME}을 준비했습니다. (국가 ${args.destNationId})`, { + createLogEffect(`${destNationName}${josaRo} 불가침 파기 제의 서신을 보냈습니다.`, { scope: LogScope.GENERAL, category: LogCategory.ACTION, format: LogFormat.MONTH, diff --git a/packages/logic/src/actions/turn/nation/che_포상.ts b/packages/logic/src/actions/turn/nation/che_포상.ts index 64f2241..98b00e5 100644 --- a/packages/logic/src/actions/turn/nation/che_포상.ts +++ b/packages/logic/src/actions/turn/nation/che_포상.ts @@ -133,7 +133,7 @@ export class ActionResolver< const amountJosa = JosaUtil.pick(amountText, '을'); effects.push( - createLogEffect(`${label} ${amountText}${amountJosa} 포상으로 받았습니다.`, { + createLogEffect(`${label} ${amountText}${amountJosa} 포상으로 받았습니다.`, { scope: LogScope.GENERAL, category: LogCategory.ACTION, generalId: context.destGeneral.id, @@ -141,11 +141,14 @@ export class ActionResolver< }) ); effects.push( - createLogEffect(`${context.destGeneral.name}에게 ${label} ${amountText}${amountJosa} 수여했습니다.`, { + createLogEffect( + `${context.destGeneral.name}에게 ${label} ${amountText}${amountJosa} 수여했습니다.`, + { scope: LogScope.GENERAL, category: LogCategory.ACTION, format: LogFormat.MONTH, - }) + } + ) ); return { effects }; diff --git a/tools/compare-command-logs.ignore.json b/tools/compare-command-logs.ignore.json index 137d626..ec18617 100644 --- a/tools/compare-command-logs.ignore.json +++ b/tools/compare-command-logs.ignore.json @@ -1,6 +1,19 @@ { "Global": { - "templates": [], + "templates": [ + "${}에게서 몰수할 ${}이 없습니다.", + "이동할 인구가 부족합니다.", + "이미 같은 국호를 가진 곳이 있습니다. ${} 실패", + "${}에게 등용 권유 서신을 보내지 못했습니다. ${}", + "${}에게 부대 탈퇴를 지시 받았습니다.", + "${}에 의해 ${}${} 발령됐습니다.", + "경로에 도달할 방법이 없습니다.", + "${}${} 실패하여 ${} 상승했습니다.", + "${}${} 성공하여 ${} 상승했습니다.", + "${}이 ${}에 국가를 건설하였습니다.", + "민심이 ${} 상승했습니다.", + "다음 턴부터 건국할 수 있습니다." + ], "regex": [] } } diff --git a/tools/compare-command-logs.mjs b/tools/compare-command-logs.mjs index b163d6a..d2587f2 100644 --- a/tools/compare-command-logs.mjs +++ b/tools/compare-command-logs.mjs @@ -586,6 +586,7 @@ const normalizeTemplate = (text) => { out = out.replace(/<1>.*?<\/>/g, ''); } out = out.replace(/<\/?b>/g, ''); + out = out.replace(/\{\$\{[^}]*\}[^}]*\}/g, '${}'); out = out.replace(/\$\{[^}]*\}/g, '${}'); out = out.replace(/\{\$[A-Za-z_][A-Za-z0-9_]*\}/g, '${}'); out = out.replace(/\$[A-Za-z_][A-Za-z0-9_]*\b/g, '${}');