feat: 여러 커맨드 로그 메시지 개선 및 불필요한 항목 제거
This commit is contained in:
@@ -71,14 +71,15 @@ export class ActionResolver<
|
||||
const actualTrustDmg = currentTrust - newTrust;
|
||||
|
||||
// Log
|
||||
const commandName = ACTION_NAME;
|
||||
const destCityName = destCity.name;
|
||||
ctx.addLog(`<G>${destCityName}</>에 ${ACTION_NAME}${JosaUtil.pick(ACTION_NAME, '이')} 성공했습니다.`, {
|
||||
ctx.addLog(`<G><b>${destCityName}</b></>에 ${commandName}${JosaUtil.pick(commandName, '이')} 성공했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
ctx.addLog(`치안이 ${actualSecuDmg}, 민심이 ${actualTrustDmg.toFixed(1)} 만큼 감소했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
format: LogFormat.PLAIN,
|
||||
});
|
||||
|
||||
// City Update
|
||||
|
||||
@@ -152,14 +152,15 @@ export class ActionResolver<
|
||||
);
|
||||
}
|
||||
|
||||
const commandName = ACTION_NAME;
|
||||
const destCityName = destCity.name;
|
||||
ctx.addLog(`<G>${destCityName}</>에 ${ACTION_NAME}${JosaUtil.pick(ACTION_NAME, '이')} 성공했습니다.`, {
|
||||
ctx.addLog(`<G><b>${destCityName}</b></>에 ${commandName}${JosaUtil.pick(commandName, '이')} 성공했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
ctx.addLog(`금 ${stolenGold}, 쌀 ${stolenRice} 을 획득했습니다.`, {
|
||||
ctx.addLog(`금<C>${stolenGold}</> 쌀<C>${stolenRice}</>을 획득했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
format: LogFormat.PLAIN,
|
||||
});
|
||||
|
||||
effects.push(
|
||||
|
||||
@@ -71,14 +71,15 @@ export class ActionResolver<
|
||||
const actualWallDmg = destCity.wall - newWall;
|
||||
|
||||
// Log
|
||||
const commandName = ACTION_NAME;
|
||||
const destCityName = destCity.name;
|
||||
ctx.addLog(`<G>${destCityName}</>에 ${ACTION_NAME}${JosaUtil.pick(ACTION_NAME, '이')} 성공했습니다.`, {
|
||||
ctx.addLog(`<G><b>${destCityName}</b></>에 ${commandName}${JosaUtil.pick(commandName, '이')} 성공했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
ctx.addLog(`수비가 ${actualDefDmg}, 성벽이 ${actualWallDmg} 만큼 감소했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
format: LogFormat.PLAIN,
|
||||
});
|
||||
|
||||
// City Update
|
||||
|
||||
@@ -62,7 +62,7 @@ export class ActionResolver<
|
||||
const nextExp = Math.floor(general.experience * (1 - penaltyRatio));
|
||||
const nextDed = Math.floor(general.dedication * (1 - penaltyRatio));
|
||||
|
||||
context.addLog(`하야하여 재야로 돌아갑니다.`, {
|
||||
context.addLog(`<D><b>${nation.name}</b></>에서 하야했습니다.`, {
|
||||
category: LogCategory.ACTION,
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
} from '@sammo-ts/logic/actions/engine.js';
|
||||
import { createCityPatchEffect, createGeneralPatchEffect } 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 { z } from 'zod';
|
||||
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
|
||||
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
|
||||
@@ -296,10 +297,15 @@ export class ActionResolver<
|
||||
general.dedication = nextDedication;
|
||||
general.meta = metaUpdated;
|
||||
|
||||
const commandName = ACTION_NAME;
|
||||
|
||||
if (!result.success) {
|
||||
context.addLog(`<G><b>${context.destCity.name}</b></>에 ${ACTION_NAME} 실패했습니다.`, {
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
context.addLog(
|
||||
`<G><b>${context.destCity.name}</b></>에 ${commandName}${JosaUtil.pick(commandName, '이')} 실패했습니다.`,
|
||||
{
|
||||
format: LogFormat.MONTH,
|
||||
}
|
||||
);
|
||||
return { effects: [] };
|
||||
}
|
||||
|
||||
@@ -325,9 +331,12 @@ export class ActionResolver<
|
||||
category: LogCategory.SUMMARY,
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
context.addLog(`<G><b>${context.destCity.name}</b></>에 ${ACTION_NAME} 성공했습니다.`, {
|
||||
context.addLog(
|
||||
`<G><b>${context.destCity.name}</b></>에 ${commandName}${JosaUtil.pick(commandName, '이')} 성공했습니다.`,
|
||||
{
|
||||
format: LogFormat.MONTH,
|
||||
});
|
||||
}
|
||||
);
|
||||
context.addLog(
|
||||
`도시의 농업이 <C>${result.agriDamage}</>, 상업이 <C>${result.commDamage}</>만큼 감소하고, 장수 <C>${result.injuryCount}</>명이 부상 당했습니다.`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user