인게임 예약 명령과 장수 상태 표시를 바로잡음
This commit is contained in:
@@ -49,6 +49,7 @@ const redactDiplomacyMessages = (messages: MessageView[], permission: number): M
|
||||
return {
|
||||
...message,
|
||||
text: '조회 권한이 없는 외교 메시지입니다.',
|
||||
option: { ...(message.option ?? {}), permissionRedacted: true },
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -89,6 +89,11 @@ export const getSecretGeneralList = accessAuthedProcedure.query(async ({ ctx })
|
||||
name: general.name,
|
||||
npcState: general.npcState,
|
||||
injury: general.injury,
|
||||
baseStats: {
|
||||
leadership: general.leadership,
|
||||
strength: general.strength,
|
||||
intelligence: general.intel,
|
||||
},
|
||||
stats: {
|
||||
leadership: woundedStat(general.leadership, general.injury),
|
||||
strength: woundedStat(general.strength, general.injury),
|
||||
|
||||
@@ -109,11 +109,17 @@ const resolveScenarioStat = (config: Record<string, unknown>): { max: number; np
|
||||
};
|
||||
|
||||
const resolveCommandEnv = (
|
||||
config: Record<string, unknown>
|
||||
config: Record<string, unknown>,
|
||||
worldMeta: Record<string, unknown>
|
||||
): { develCost: number; defaultCrewTypeId: number; maxTechLevel: number } => {
|
||||
const constValues = asRecord(config.const ?? config.consts);
|
||||
const configuredDevelCost = resolveNumberFromKeys(constValues, ['develCost', 'develcost', 'develrate'], 0);
|
||||
return {
|
||||
develCost: resolveNumberFromKeys(constValues, ['develCost', 'develcost', 'develrate'], 0),
|
||||
develCost: resolveNumberFromKeys(
|
||||
worldMeta,
|
||||
['develcost', 'develCost', 'develrate'],
|
||||
configuredDevelCost
|
||||
),
|
||||
defaultCrewTypeId: resolveNumberFromKeys(constValues, ['defaultCrewTypeId'], 0),
|
||||
maxTechLevel: resolveNumberFromKeys(constValues, ['maxTechLevel'], 12),
|
||||
};
|
||||
@@ -409,7 +415,7 @@ export const npcRouter = router({
|
||||
|
||||
const config = asRecord(worldState.config);
|
||||
const stat = resolveScenarioStat(config);
|
||||
const env = resolveCommandEnv(config);
|
||||
const env = resolveCommandEnv(config, worldMeta);
|
||||
const unitSetName = resolveUnitSetName(config, 'che');
|
||||
const nationTech = readNumber(nation.tech, 0);
|
||||
|
||||
|
||||
@@ -224,7 +224,10 @@ export const troopRouter = router({
|
||||
name: troop.name,
|
||||
nationId: troop.nationId,
|
||||
turnTime: leader?.turnTime.toISOString() ?? null,
|
||||
reservedCommands: reservedByLeader.get(troop.troopLeaderId) ?? [],
|
||||
reservedCommands:
|
||||
leader?.npcState === 5
|
||||
? ['집합', '집합', '집합', '집합', '집합']
|
||||
: (reservedByLeader.get(troop.troopLeaderId) ?? []),
|
||||
leader: leader
|
||||
? {
|
||||
id: leader.id,
|
||||
|
||||
@@ -79,6 +79,7 @@ export interface TurnCommandInputField {
|
||||
required: boolean;
|
||||
min?: number;
|
||||
max?: number;
|
||||
legacyWidthMax?: number;
|
||||
step?: number;
|
||||
defaultValue?: TurnCommandOptionValue | boolean;
|
||||
constValue?: TurnCommandOptionValue;
|
||||
@@ -328,6 +329,7 @@ const buildField = (key: string, rawSchema: unknown, required: boolean): TurnCom
|
||||
required,
|
||||
min: typeof schema.minLength === 'number' ? schema.minLength : undefined,
|
||||
max: typeof schema.maxLength === 'number' ? schema.maxLength : undefined,
|
||||
legacyWidthMax: key === 'nationName' ? 18 : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -565,7 +567,7 @@ export const assertReservedTurnArgsPassLegacyBasicValidation = (rawArgs: unknown
|
||||
getLegacyStringWidth(nationName) < 1 ||
|
||||
getLegacyStringWidth(nationName) > 18)
|
||||
) {
|
||||
throwLegacyBasicTurnArgError();
|
||||
throw new Error('국가명은 전각 9자 또는 반각 18자 이하여야 합니다.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ export const buildRefGeneralTargetOptions = (options: {
|
||||
const isTroopExit = action === 'che_부대탈퇴지시';
|
||||
const availableNow = isTroopExit ? isTroopMember && entry.id !== options.actorId : undefined;
|
||||
const label = (() => {
|
||||
if (action === 'che_발령') return `${entry.name} (${troopLabel} · ${cityName})`;
|
||||
if (action === 'che_발령') return `${entry.name} (${cityName})`;
|
||||
if (action === 'che_포상' || action === 'che_몰수') return `${entry.name} (${cityName})`;
|
||||
return `${entry.name} (${options.nationNames.get(entry.nationId) ?? '무소속'} · ${cityName})`;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user