From d10cd6319d18a7c13033594877f69f84f23f5779 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 27 Jun 2026 02:49:39 +0900 Subject: [PATCH] Normalize late campaign supply rewards --- scripts/verify-flow.mjs | 25 +++++++++++++++++++++++++ src/game/scenes/CampScene.ts | 14 +++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/scripts/verify-flow.mjs b/scripts/verify-flow.mjs index c9eb547..20fcecb 100644 --- a/scripts/verify-flow.mjs +++ b/scripts/verify-flow.mjs @@ -1,7 +1,30 @@ import { spawn } from 'node:child_process'; +import { readFileSync } from 'node:fs'; import { chromium } from 'playwright'; const targetUrl = process.env.VERIFY_URL ?? 'http://localhost:5173/'; +const rewardDataFiles = ['src/game/data/battles.ts', 'src/game/scenes/CampScene.ts']; + +function assertNoLegacyNumericRewardLabels() { + const legacyNumericRewardPattern = /itemRewards:\s*\[[^\]\r\n]*(["'])(쌀|금|군주)\s+\d+\1/u; + const failures = []; + + for (const file of rewardDataFiles) { + const source = readFileSync(file, 'utf8'); + const lines = source.split(/\r?\n/); + + lines.forEach((line, index) => { + const match = legacyNumericRewardPattern.exec(line); + if (match) { + failures.push(`${file}:${index + 1} ${match[2]}`); + } + }); + } + + if (failures.length > 0) { + throw new Error(`Legacy numeric reward labels should use inventory names 콩/상처약/탁주: ${failures.join(', ')}`); + } +} function unitUsesTexture(state, unitId, textureBase) { return state?.units?.some((unit) => unit.id === unitId && unit.textureBase === textureBase && unit.actionTexture === `${textureBase}-actions`); @@ -11,6 +34,8 @@ let serverProcess; let browser; try { + assertNoLegacyNumericRewardLabels(); + serverProcess = await ensureLocalServer(targetUrl); browser = await chromium.launch({ headless: true }); diff --git a/src/game/scenes/CampScene.ts b/src/game/scenes/CampScene.ts index e4cda5c..7f94291 100644 --- a/src/game/scenes/CampScene.ts +++ b/src/game/scenes/CampScene.ts @@ -9837,7 +9837,7 @@ const campVisits: CampVisitDefinition[] = [ response: '이엄은 무도와 음평에 예비 수레를 나누었고, 황권은 그 수레가 늦어질 때 대체할 고개 이름을 장부 옆에 적었습니다.', bondExp: 72, gold: 2760, - itemRewards: ['쌀 34', '상처약 24'] + itemRewards: ['콩 34', '상처약 24'] } ] }, @@ -9867,7 +9867,7 @@ const campVisits: CampVisitDefinition[] = [ response: '마량은 마을 이름을 하나씩 불렀고, 황권은 그 이름 옆에 실제로 남길 군량 숫자를 적었습니다.', bondExp: 76, gold: 2860, - itemRewards: ['쌀 36', '상처약 26'] + itemRewards: ['콩 36', '상처약 26'] } ] }, @@ -9897,7 +9897,7 @@ const campVisits: CampVisitDefinition[] = [ response: '이엄은 회수 표식마다 예비 군량을 남겼고, 황권은 그 군량이 마을 몫을 줄이지 않도록 다시 계산했습니다.', bondExp: 80, gold: 2940, - itemRewards: ['쌀 38', '상처약 28'] + itemRewards: ['콩 38', '상처약 28'] } ] }, @@ -9924,10 +9924,10 @@ const campVisits: CampVisitDefinition[] = [ { id: 'store-riverbank-supplies', label: '강안 예비 군량을 남긴다', - response: '위수 남안의 예비 창고에 쌀과 상처약이 남았고, 병사들은 강가 안개 속에서도 돌아올 표식을 확인했습니다.', + response: '위수 남안의 예비 창고에 콩과 상처약이 남았고, 병사들은 강가 안개 속에서도 돌아올 표식을 확인했습니다.', bondExp: 84, gold: 3020, - itemRewards: ['쌀 40', '상처약 30'] + itemRewards: ['콩 40', '상처약 30'] } ] }, @@ -9954,10 +9954,10 @@ const campVisits: CampVisitDefinition[] = [ { id: 'store-northbank-village-supplies', label: '강북 마을 예비 군량을 남긴다', - response: '강북 마을마다 쌀과 상처약이 남았고, 병사들은 돌아올 길이 지도뿐 아니라 실제 마을에도 남았다는 것을 확인했습니다.', + response: '강북 마을마다 콩과 상처약이 남았고, 병사들은 돌아올 길이 지도뿐 아니라 실제 마을에도 남았다는 것을 확인했습니다.', bondExp: 88, gold: 3100, - itemRewards: ['쌀 42', '상처약 32'] + itemRewards: ['콩 42', '상처약 32'] } ] },