fix(bunsik): 요리 창 서버 검증 — 메뉴 고름(cookStart)부터 조리 과정 최소 시간이 지나야 완성 인정
- PlotController.startCook/finishCook: 고른 메뉴 일치, 주문·손 자리, 조리대 거리, Recipes.minTime 확인 - 원격 이벤트만 보내 조리 과정을 건너뛰면 거절(통합 테스트 추가), 쓰지 않게 된 lastCook 제거 - 통합 테스트 822/822, Recipes.spec 101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,27 @@ function Recipes.expectedTime(menu: string, cook: number): number
|
||||
return t
|
||||
end
|
||||
|
||||
-- 서버 검사용: 아주 빠른 사람이 쉬지 않고 했을 때의 최소 시간(초). 꾹 누르기는 정해진 시간을 다 채워야 하고,
|
||||
-- 톡톡·문지르기는 한 번에 MIN_TAP·MIN_RUB초로 봅니다. 메뉴 고르기·완성 연출은 빼서 정상 플레이는 늘 이보다 깁니다.
|
||||
Recipes.MIN_TAP = 0.08
|
||||
Recipes.MIN_RUB = 0.08
|
||||
|
||||
function Recipes.minTime(menu: string, cook: number): number
|
||||
local r = Recipes.LIST[menu]
|
||||
local t = 0
|
||||
for _, s in r.steps do
|
||||
local n = Recipes.need(s, cook)
|
||||
if s.kind == "tap" then
|
||||
t += n * Recipes.MIN_TAP
|
||||
elseif s.kind == "rub" then
|
||||
t += n * Recipes.MIN_RUB
|
||||
else
|
||||
t += n
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
-- 요리 화면 한 번의 진행 상태
|
||||
export type Phase = "menu" | "cook" | "done"
|
||||
export type Flow = {
|
||||
|
||||
Reference in New Issue
Block a user