feat: 여러 액션의 로그 메시지 개선 및 템플릿 카운트 비교 기능 추가

This commit is contained in:
2026-02-07 07:52:00 +00:00
parent 15989e0436
commit 14da014a6f
11 changed files with 166 additions and 52 deletions
@@ -15,6 +15,7 @@ import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition
import type { GeneralActionOutcome, GeneralActionResolveContext } from '@sammo-ts/logic/actions/engine.js';
import { createDiplomacyPatchEffect, 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';
export interface NonAggressionAcceptArgs {
destNationId: number;
@@ -175,6 +176,8 @@ export class ActionDefinition<
const currentMonth = resolveMonthIndex(context.currentYear, context.currentMonth);
const targetMonth = args.year * 12 + args.month;
const term = Math.max(0, targetMonth - currentMonth);
const destNationName = String(args.destNationId);
const josaWa = JosaUtil.pick(destNationName, '와');
return {
effects: [
@@ -186,11 +189,14 @@ export class ActionDefinition<
state: DIPLOMACY_NON_AGGRESSION,
term,
}),
createLogEffect(`${ACTION_NAME}을 실행했습니다. (국가 ${args.destNationId})`, {
createLogEffect(
`<D><b>${destNationName}</b></>${josaWa} <C>${args.year}</>년 <C>${args.month}</>월까지 불가침에 성공했습니다.`,
{
scope: LogScope.GENERAL,
category: LogCategory.ACTION,
format: LogFormat.MONTH,
}),
}
),
],
};
}
@@ -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 { createDiplomacyPatchEffect, 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';
export interface NonAggressionCancelAcceptArgs {
destNationId: number;
@@ -81,6 +82,9 @@ export class ActionDefinition<
};
}
const destNationName = String(args.destNationId);
const josaWa = JosaUtil.pick(destNationName, '와');
return {
effects: [
createDiplomacyPatchEffect(nationId, args.destNationId, {
@@ -91,7 +95,7 @@ export class ActionDefinition<
state: DIPLOMACY_NEUTRAL,
term: 0,
}),
createLogEffect(`${ACTION_NAME}을 실행했습니다. (국가 ${args.destNationId})`, {
createLogEffect(`<D><b>${destNationName}</b></>${josaWa}의 불가침을 파기했습니다.`, {
scope: LogScope.GENERAL,
category: LogCategory.ACTION,
format: LogFormat.MONTH,