Files
roblox-project/bunsik-tycoon/tests/Sim.spec.luau
EJClaw 52668f219a wip(bunsik): 경제 개편 공용 로직 — 업그레이드 갈래, 의자·테이블 배치와 길 찾기(Floor), 알바생 역할·시급, 손님 러시·홍보·쫓아내기 로직, 서버↔클라이언트 약속(NETWORK.md)
서버·클라이언트는 다음 커밋에서 새 구조로 옮깁니다(이 커밋만으로는 빌드 검사가 통과하지 않음).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 01:19:40 +09:00

34 lines
1.1 KiB
Lua

-- 봇 플레이로 구매 시점 목표를 검사: lune run tests/Sim.spec.luau
local Sim = require("../tools/simlib")
local T = require("./check")
local function at(log, id)
for _, e in log do
if e.id == id then
return e.t
end
end
return math.huge
end
local base = Sim.run(1, 7200)
T.check(#base >= 30, "봇이 2시간 안에 30번 넘게 삼(업그레이드가 잘게 나뉨)")
T.check(base[1].t <= 10, "첫 구매 10초 안")
T.check(at(base, "Stage1") >= 8 * 60 and at(base, "Stage1") <= 16 * 60, "실내 확장 8~16분")
T.check(at(base, "Stage2") >= 40 * 60 and at(base, "Stage2") <= 70 * 60, "2층 40~70분")
T.check(at(base, "Staff1") < at(base, "Stage1"), "알바생 기능은 확장 전에 열림")
local prev = 0
for i, e in base do
if i > 1 and e.t < at(base, "Stage1") then
T.check(e.t - prev <= 100, `1단계 #{i} {e.id} 구매 간격 100초 이하`)
elseif i > 1 then
T.check(e.t - prev <= 240, `#{i} {e.id} 구매 간격 4분 이하`)
end
prev = e.t
end
local x2 = Sim.run(2, 7200)
T.check(at(x2, "Stage1") < at(base, "Stage1") * 0.65, "2배 수익이면 확장이 훨씬 빠름")
T.done("Sim.spec")