feat(bunsik): 손님 외형 다양화 — 로블록스 공식 머리·모자·옷·얼굴 조합(사람 75%), 공식 동물 번들 11종(펭귄·곰·북극곰·고양이·강아지·판다·여우·쥐 등, 25%)

- NpcLooks: 확인된 아이템 표(assets/npc_assets.md), 서버 시작 때 외형 템플릿을 만들어 두고 복제
- 화면 UI 통합 테스트를 새 화면에 맞게 다시 씀(서버 로직은 tests/cloud/server.luau)
- GUI 미리보기를 장면 6개씩 나눠 뽑기(5분 제한·4MB 출력 제한)
- 서버 통합 테스트 1416개, 화면 통합 테스트 379개 통과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 02:06:09 +09:00
parent d8eaa01495
commit d0ae06e198
13 changed files with 1647 additions and 503 deletions

View File

@@ -274,7 +274,12 @@ local SHOTS = {
}
local shots = {}
-- 한 번에 다 그리면 5분 제한을 넘을 수 있어서, ONLY에 이름을 넣으면 그 장면만 그립니다(tools/preview.sh가 나눠서 부름).
local ONLY: { string }? = nil
for _, s in SHOTS do
if ONLY and not table.find(ONLY, s.name) then
continue
end
local state = Instance.new("Folder")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Ready", true)
@@ -329,4 +334,6 @@ end
local images = {}
images[Icons.ASSET:match("%d+")] = "art/ui_icons.png"
images[Icons.KITCHEN_ASSET:match("%d+")] = "art/kitchen.png"
return HttpService:JSONEncode({ shots = shots, images = images })
-- 결과가 커서(4MB 넘음) 바이너리 출력으로 돌려줍니다(tools/preview.sh가 --out 파일로 받음).
local json = HttpService:JSONEncode({ shots = shots, images = images })
return { BinaryOutput = buffer.fromstring(json), ReturnValues = { #shots } }

View File

@@ -1,4 +1,4 @@
-- 로블록스 서버(Open Cloud Luau Execution)에서 돌리는 통합 테스트.
-- 로블록스 서버(Open Cloud Luau Execution)에서 돌리는 화면 UI·클라이언트 모듈 통합 테스트(서버 로직은 server.luau).
-- python3 tools/cloud.py run tests/cloud/integration.luau --version <저장 버전>
-- 이 환경에서는 플레이어가 없고 물리가 돌지 않으며 Script가 자동 실행되지 않으므로,
-- 모듈을 직접 불러 가짜 플레이어(Folder)와 가상 시계로 가게를 돌립니다.
@@ -30,344 +30,46 @@ local Icons = require(ReplicatedStorage.Shared.Icons)
local Locale = require(ReplicatedStorage.Shared.Locale)
local Recipes = require(ReplicatedStorage.Shared.Recipes)
section("맵")
section("맵·부지 글자·손님 버튼(클라이언트 모듈)")
local World = require(Server.World)
local slots = World.build()
eq(#slots, 6, "부지 6칸")
for i, s in slots do
check(s.refs.stove and s.refs.stove:IsDescendantOf(workspace), `부지 {i} 조리대`)
for j, o in slots do
if i < j then
local d = (s.cf.Position - o.cf.Position).Magnitude
check(d >= 76, `부지 {i},{j} 겹치지 않음 (거리 {d})`)
end
end
-- 입구(+Z)가 길(z=0) 쪽을 봐야 함
local front = s.cf:PointToWorldSpace(Vector3.new(0, 0, 40))
check(math.abs(front.Z) < math.abs(s.cf.Position.Z), `부지 {i} 입구가 길 쪽`)
end
check(workspace.BunsikWorld:FindFirstChild("Spawn") ~= nil, "스폰 지점")
local partCount = 0
for _, d in workspace.BunsikWorld:GetDescendants() do
if d:IsA("BasePart") then
partCount += 1
check(not d:IsA("PartOperation"), "Union 없음(업로드 제한)")
end
end
print("맵 파트 수", partCount)
check(partCount < 6000, "맵 파트 6000개 미만")
section("NPC")
local Npc = require(Server.Npc)
Npc.preload()
local npc = Npc.spawn(workspace, CFrame.new(0, 5, 0), Random.new(1))
check(npc.model:FindFirstChild("HumanoidRootPart") ~= nil, "NPC 몸")
check(npc.tracks.walk ~= nil and npc.tracks.sit ~= nil and npc.tracks.idle ~= nil, "NPC 애니메이션 3종 로드")
npc.model:Destroy()
section("가게 1: 튜토리얼 흐름")
local PlotController = require(Server.PlotController)
local Data = require(Server.Data)
local function newData()
local d = table.clone(Data.TEMPLATE)
d.PurchaseIdCache = {}
return d
end
local owner = Instance.new("Folder")
owner.Name = "FakePlayer"
owner.Parent = ServerScriptService
local notes = {}
local data = newData()
local c = PlotController.new(slots[1], owner, {
userId = 111,
displayName = "Tester",
data = data,
now = 0,
notify = function(k)
table.insert(notes, k)
end,
})
local Plots = require(StarterPlayer.StarterPlayerScripts.Client.Plots)
eq(owner:GetAttribute("Tut"), 1, "튜토리얼 1단계")
eq(owner:GetAttribute("Money"), 0, "돈 0")
eq(slots[1].model:GetAttribute("OwnerId"), 111, "부지 주인 속성")
eq(Plots.nameText(slots[1].model, "ko"), "Tester의 분식집", "이름판(한국어)")
eq(Plots.nameText(slots[1].model, "ja"), "Testerのブンシク店", "이름판(일본어)")
eq(Plots.nameText(slots[4].model, "en"), "Empty lot", "빈 자리 이름판")
c:update(0)
local dyn = slots[1].refs.dynamic
local customers = 0
for _, ch in dyn:GetChildren() do
if ch.Name == "Customer" then
customers += 1
local bubble = ch:FindFirstChild("Order", true)
check(bubble ~= nil, "손님 주문 말풍선")
local icon = bubble and bubble:FindFirstChild("Icon", true) :: ImageLabel?
eq(icon and icon.ImageRectOffset, Icons.OFFSET.Tteokbokki, "말풍선에 떡볶이 그림")
end
end
eq(customers, 1, "첫 손님 NPC 1명")
eq(slots[1].refs.stove:GetAttribute("CookMenu"), "Tteokbokki", "조리대에 떡볶이 주문 표시")
eq(slots[1].refs.stove:GetAttribute("OwnerId"), 111, "조리대 주인")
check((owner:FindFirstChild("Guide") :: ObjectValue).Value ~= nil, "튜토리얼 화살표 목표(조리대)")
c:update(3)
eq(c.shop.customers[1].state, "waiting", "손님이 앉음")
eq(owner:GetAttribute("Orders"), "Tteokbokki=1", "요리 창에 보여 줄 주문 수")
eq(c:cook("Gimbap"), nil, "주문 없는 메뉴(김밥)는 못 만듦")
-- 요리 창 세션: 원격 이벤트만 보내 조리 과정을 건너뛰지 못함
eq(c:finishCook("Tteokbokki", 10), nil, "메뉴를 고르지 않고 완성만 보내면 거절")
eq(c:startCook("Gimbap", 10), false, "주문 없는 메뉴로는 시작 못 함")
check(c:startCook("Tteokbokki", 10), "주문 있는 메뉴로 시작")
eq(c:finishCook("Gimbap", 20), nil, "고른 메뉴와 다른 메뉴로 완성하면 거절")
check(c:startCook("Tteokbokki", 10), "다시 시작")
local minT = Recipes.minTime("Tteokbokki", c.shop.stats.cook)
eq(c:finishCook("Tteokbokki", 10 + minT * 0.5), nil, `조리 과정 최소 시간({minT}초)보다 빠르면 거절`)
eq(c:finishCook("Tteokbokki", 10 + minT), nil, "거절된 세션은 다시 못 씀")
eq(owner:GetAttribute("Carry"), 0, "거절되면 접시 없음")
-- (가상 시계를 3초에 맞춰 끝냅니다. 뒤의 식사 시간 검사가 3초 기준)
check(c:startCook("Tteokbokki", 3 - Recipes.expectedTime("Tteokbokki", c.shop.stats.cook)), "다시 시작")
eq(c:finishCook("Tteokbokki", 3), "Tteokbokki", "정상 시간이면 조리")
eq(owner:GetAttribute("Hand"), "Tteokbokki", "손에 든 접시 종류")
eq(owner:GetAttribute("Orders"), "", "주문이 다 채워짐")
eq(owner:GetAttribute("Tut"), 2, "튜토리얼 2단계")
eq(owner:GetAttribute("Carry"), 1, "접시 1개 듦")
eq(slots[1].refs.stove:GetAttribute("CookMenu"), "", "더 만들 것 없음")
eq(c:serve(1), 15, "서빙 15원")
eq(owner:GetAttribute("Money"), 15, "돈 15")
eq(data.Money, 15, "세이브 데이터 돈 15")
local served1 = dyn:FindFirstChild("Customer"):FindFirstChild("Order", true)
eq(
served1 and (served1:FindFirstChild("Icon", true) :: ImageLabel).ImageRectOffset,
Icons.OFFSET.heart,
"받은 손님 말풍선은 하트"
)
eq(owner:GetAttribute("Tut"), 3, "튜토리얼 3단계")
check(dyn:FindFirstChild("Dish_Tteokbokki") ~= nil, "테이블에 접시")
local ok = c:buy()
check(ok, "테이블 2 구매")
check(slots[1].refs.upgrades:FindFirstChild("Table2") ~= nil, "테이블 2 모형")
eq(owner:GetAttribute("Tut"), 0, "튜토리얼 끝")
eq(data.TutorialDone, true, "튜토리얼 저장")
eq(data.Bought, 1, "세이브 데이터 구매 1")
check(table.find(notes, "tutDone") and table.find(notes, "purchased"), "알림")
section("가게 1: 김밥 해금이 바로 보임")
c:addMoney(40)
check(c:buy(), "김밥 해금 구매")
check(slots[1].refs.upgrades:FindFirstChild("UnlockGimbap") ~= nil, "김밥 진열대 모형")
check(
slots[1].refs.upgrades:FindFirstChild("UnlockGimbap"):FindFirstChild("Display") ~= nil,
"진열대에 김밥 접시"
)
check(table.find(notes, "newMenu") ~= nil, "새 메뉴 알림")
check(string.find(Plots.menuText(slots[1].model, "ko"), "김밥") ~= nil, "메뉴판에 김밥")
local gimbapOrder = false
for k = 1, 30 do
c:update(3 + Economy.EAT + 0.5 + k * 0.1)
for _, cust in c.shop.customers do
if cust.menu == "Gimbap" then
gimbapOrder = true
end
end
if gimbapOrder then
break
end
end
check(gimbapOrder, "산 직후 3초 안에 김밥 주문 손님")
c:update(3 + Economy.EAT + 0.5)
eq(dyn:FindFirstChild("Dish_Tteokbokki"), nil, "다 먹은 접시 치움")
section("가게 1: 전부 구매")
c:addMoney(10_000_000)
for i = 3, #Economy.PURCHASES do
local okBuy, err = c:buy()
check(okBuy, `#{i} 구매 ({err})`)
end
eq(owner:GetAttribute("Bought"), #Economy.PURCHASES, "20개 구매")
eq(owner:GetAttribute("Stage"), 2, "2단계")
for _, id in { "Expand", "Sign1", "Sign2", "Stove1", "Stove2", "Sauce1", "Sauce2", "Tray1", "Tray2", "Table8" } do
check(slots[1].refs.upgrades:FindFirstChild(id) ~= nil, `업그레이드 모형 {id}`)
end
check(dyn:FindFirstChild("Helper") ~= nil, "알바생 NPC")
check(table.find(notes, "expanded") ~= nil, "확장 알림")
local okMax, errMax = c:buy()
check(not okMax and errMax == "max", "더 살 것 없음")
check(string.find(Plots.menuText(slots[1].model, "ko"), "튀김") ~= nil, "메뉴판에 튀김")
check(string.find(Plots.menuText(slots[1].model, "zh"), "炸物") ~= nil, "중국어 메뉴판")
check(slots[1].refs.upgrades:FindFirstChild("UnlockTwigim") ~= nil, "튀김 진열대 모형")
section("가게 1: 가상 5분 영업(봇)")
local t = 20
local servedBefore = c.shop.served
local t0 = os.clock()
while t < 320 do
t += 0.1
c:update(t)
c:pickup()
if not c.shop.stats.helper then
c:cook()
end
for id, cust in c.shop.customers do
if cust.state == "waiting" then
c:serve(id)
end
end
end
local elapsed = os.clock() - t0
local served = c.shop.served - servedBefore
print(`5분 영업: 서빙 {served}회, 계산 시간 {math.floor(elapsed * 1000)}ms`)
check(served > 60, "5분 동안 60회 넘게 서빙")
-- 나가는 손님은 실제 시간으로 몇 초 뒤 지워지므로 잠깐 기다립니다.
task.wait(Economy.WALK_IN + 1.5)
local alive = 0
for _, ch in dyn:GetChildren() do
if ch.Name == "Customer" then
alive += 1
end
end
check(alive <= Economy.MAX_SEATS + 6, `손님 NPC가 쌓이지 않음 ({alive})`)
section("가게 2: 캐릭터 가까이 가면 자동 서빙·집기")
local charModel =
Players:CreateHumanoidModelFromDescription(Instance.new("HumanoidDescription"), Enum.HumanoidRigType.R15)
charModel.Name = "FakeCharacter"
charModel.Parent = workspace
local hrp = charModel:FindFirstChild("HumanoidRootPart") :: BasePart
hrp.Anchored = true
local owner2 = Instance.new("Folder")
owner2.Parent = ServerScriptService
local data2 = newData()
data2.Bought = 8 -- 알바생까지 산 상태
data2.Money = 5
local c2 = PlotController.new(slots[2], owner2, {
userId = 222,
displayName = "Tester2",
data = data2,
now = 0,
getCharacter = function()
return charModel
end,
})
eq(owner2:GetAttribute("Money"), 5, "저장된 돈 불러옴")
eq(owner2:GetAttribute("Tut"), 1, "튜토리얼 안 끝났으면 1")
c2:update(0)
eq(#c2.shop.counter, 1, "알바생이 카운터에 접시")
hrp.CFrame = slots[2].refs.counter.CFrame + Vector3.new(0, 3, 4)
c2:update(0.2)
eq(#c2.shop.hand, 1, "카운터 근처에서 자동으로 집음")
local held = 0
for _, ch in charModel:GetChildren() do
if string.sub(ch.Name, 1, 5) == "Dish_" then
held += 1
end
end
eq(held, 1, "손에 접시 모형")
c2:update(3)
local seat = c2.shop.customers[1].seat
local PlotBuilder = require(Server.PlotBuilder)
hrp.CFrame = PlotBuilder.seatCFrame(slots[2].cf, seat) + Vector3.new(0, 2, 2)
local before = c2.shop.money
c2:update(3.2)
check(c2.shop.money > before, "손님 근처에서 자동 서빙")
-- 리스폰: 손에 든 접시 모형 다시 만들기
c2:update(4)
c2:update(4.1)
c2:rebuildHand()
c2:destroy()
eq(#slots[2].refs.dynamic:GetChildren(), 0, "나가면 가게 비움")
eq(slots[2].refs.stove:GetAttribute("OwnerId"), nil, "조리대 주인 해제")
charModel:Destroy()
section("다른 플레이어가 손님으로 방문")
local guestChar =
Players:CreateHumanoidModelFromDescription(Instance.new("HumanoidDescription"), Enum.HumanoidRigType.R15)
guestChar.Name = "GuestCharacter"
guestChar.Parent = workspace
local hostOwner = Instance.new("Folder")
hostOwner.Parent = ServerScriptService
local hostData = newData()
hostData.Bought = 5 -- 자리 3개
hostData.TutorialDone = true
local guestEvents = {}
local host = PlotController.new(slots[2], hostOwner, {
userId = 333,
displayName = "Host",
data = hostData,
now = 0,
guestEvent = function(kind, userId, info)
table.insert(guestEvents, { kind, userId, info })
end,
})
local gc = host:addGuest(444, guestChar)
check(gc ~= nil, "빈자리에 손님으로 앉음")
eq(host:addGuest(444, guestChar), nil, "같은 손님은 한 번만")
local guestSeat = slots[2].refs.dynamic:FindFirstChild("GuestSeat") :: Seat?
check(guestSeat ~= nil, "손님 의자")
print("손님 의자 Occupant", guestSeat and guestSeat.Occupant)
eq(slots[2].refs.stove:GetAttribute("CookMenu"), gc and gc.menu, "손님 주문이 조리대에 뜸")
host.shop.now = 0.5
eq(host:cook(), gc and gc.menu, "손님 메뉴 조리")
local hostBefore = host.shop.money
local guestEarn = host:serve(gc.id)
eq(guestEarn, Economy.dishPrice(gc.menu, host.shop.stats, 1) * Economy.GUEST_MULT, "손님 접시는 2배 값")
eq(host.shop.money - hostBefore, guestEarn, "주인 돈 증가")
eq(guestEvents[1] and guestEvents[1][1], "served", "손님에게 서빙 소식")
eq(guestEvents[1] and guestEvents[1][3].price, Economy.dishPrice(gc.menu, host.shop.stats, 1), "시식 보너스 값")
host:update(0.6 + Economy.EAT + 0.5)
eq(guestEvents[2] and guestEvents[2][1], "left", "다 먹고 일어남")
eq(guestEvents[2] and guestEvents[2][3].reason, "ate", "일어난 이유: 다 먹음")
eq(slots[2].refs.dynamic:FindFirstChild("GuestSeat"), nil, "손님 의자 치움")
-- 오래 기다리면 일어남
local gc2 = host:addGuest(444, guestChar)
check(gc2 ~= nil, "다시 손님으로 앉음")
host:update(0.6 + Economy.EAT + 1 + Economy.GUEST_WAIT + 0.5)
eq(guestEvents[#guestEvents][3].reason, "hungry", "너무 기다리면 일어남")
-- 주인이 나가면 손님도 일어남
check(host:addGuest(444, guestChar) ~= nil, "세 번째 앉음")
host:destroy()
eq(guestEvents[#guestEvents][3].reason, "closed", "가게가 닫히면 일어남")
guestChar:Destroy()
section("이웃 가게(NPC 가게)")
local Neighbor = require(Server.Neighbor)
local nb = Neighbor.open(slots[5], 0)
eq(slots[5].model:GetAttribute("Npc"), 5, "이웃 가게 속성")
eq(slots[5].model:GetAttribute("OwnerId"), nil, "이웃 가게엔 주인 없음")
eq(slots[5].model:GetAttribute("Level"), Neighbor.LEVELS[5], "이웃 가게 크기")
eq(slots[5].refs.stove:GetAttribute("OwnerId"), nil, "이웃 가게 조리대엔 버튼 없음")
check(slots[5].refs.dynamic:FindFirstChild("Keeper") ~= nil, "사장님 NPC")
eq(
Plots.nameText(slots[5].model, "ko"),
Locale.t("ko", "npcShop5") .. ` ⭐Lv.{Neighbor.LEVELS[5]}`,
"이웃 가게 이름판"
)
local nt = 0
while nt < 90 do
nt += 0.1
Neighbor.update(nb, nt)
end
print(`이웃 가게 90초: 서빙 {nb.controller.shop.served}회`)
check(nb.controller.shop.served >= 5, "이웃 가게가 스스로 서빙")
Neighbor.close(nb)
eq(slots[5].model:GetAttribute("Npc"), nil, "닫으면 속성 해제")
eq(#slots[5].refs.dynamic:GetChildren(), 0, "닫으면 가게 비움")
section("부지 글자·손님 버튼(클라이언트 모듈)")
local Plots = require(StarterPlayer.StarterPlayerScripts.Client.Plots)
local viewer = Instance.new("Folder")
viewer:SetAttribute("Lang", "en")
viewer:SetAttribute("KickCredits", 0)
local nb2 = Neighbor.open(slots[6], 0)
eq(Plots.nameText(slots[4].model, "en"), "Empty lot", "빈 자리 이름판")
local detach = Plots.attach(slots[6].model, viewer, 999, function() end)
local visitPrompt = slots[6].model.Base.VisitPoint:FindFirstChild("VisitPrompt") :: ProximityPrompt
check(visitPrompt ~= nil and visitPrompt.Enabled, "이웃 가게 입구에 손님 버튼")
eq(visitPrompt.ActionText, "Eat here as a customer", "손님 버튼 글자(영어)")
local kickPrompt = slots[6].model.Base.VisitPoint:FindFirstChild("KickPrompt") :: ProximityPrompt
check(kickPrompt ~= nil and kickPrompt.Enabled, "이웃 가게 입구에 쫓아내기 버튼")
check(kickPrompt.KeyboardKeyCode ~= visitPrompt.KeyboardKeyCode, "두 버튼은 다른 키")
local boardLabel = slots[6].model.Base.NameBoard:FindFirstChildOfClass("SurfaceGui"):FindFirstChildOfClass("TextLabel")
check(string.find(boardLabel.Text, "Twigim King") ~= nil, `이름판 영어 ({boardLabel.Text})`)
viewer:SetAttribute("Lang", "ja")
check(string.find(boardLabel.Text, "天ぷら") ~= nil, `언어 바꾸면 이름판도 바뀜 ({boardLabel.Text})`)
check(string.find(Plots.menuText(slots[6].model, "ko"), "떡볶이") ~= nil, "메뉴판(부지 속성 Menus)")
-- 가게 이름·무지개: 이름판과 지붕·천막 간판(ShopNameLabel)에 보임
slots[6].model:SetAttribute("ShopName", "Yummy Land")
check(string.find(boardLabel.Text, "Yummy Land") ~= nil, `가게 이름이 이름판에 ({boardLabel.Text})`)
local valance = slots[6].model.Base.Stall.Valance:FindFirstChild("ShopNameLabel", true) :: TextLabel
eq(valance and valance.Text, "Yummy Land", "천막 간판에 가게 이름")
slots[6].model:SetAttribute("Rainbow", true)
task.wait(0.2)
check(boardLabel:FindFirstChild("RainbowGradient") ~= nil, "무지개 이름(그러데이션)")
slots[6].model:SetAttribute("Rainbow", false)
task.wait(0.2)
eq(boardLabel:FindFirstChild("RainbowGradient"), nil, "무지개 끄면 사라짐")
slots[6].model:SetAttribute("ShieldUntil", workspace:GetServerTimeNow() + 60)
task.wait(0.2)
check(not kickPrompt.Enabled, "보호 중인 가게엔 쫓아내기 버튼 꺼짐")
Neighbor.close(nb2)
check(not visitPrompt.Enabled, "닫힌 가게엔 손님 버튼 없음")
slots[6].model:SetAttribute("OwnerId", 999)
check(not visitPrompt.Enabled, "내 가게엔 손님 버튼 없음")
check(not visitPrompt.Enabled and not kickPrompt.Enabled, "내 가게엔 버튼 없음")
slots[6].model:SetAttribute("OwnerId", nil)
detach()
@@ -379,56 +81,17 @@ check(not MouseLook.shouldLock(true, false, false, false), "마우스 없으면(
check(not MouseLook.shouldLock(true, true, true, false), "Ctrl 누르면 커서 풀림")
check(not MouseLook.shouldLock(true, true, false, true), "창 열리면 커서 풀림")
section("결제(ProfileStore Mock + Receipts)")
local ProfileStore = require(ServerScriptService.Vendor.ProfileStore)
local Receipts = require(Server.Receipts)
local store = ProfileStore.New("CloudTest", Data.TEMPLATE)
local prof = store.Mock:StartSessionAsync("Player_1")
check(prof ~= nil, "Mock 세션")
local grants = 0
local decision = Receipts.process(prof, "purchase-1", function()
grants += 1
prof.Data.Money += 100
return true
end)
eq(decision, "Granted", "첫 결제 지급")
local decision2 = Receipts.process(prof, "purchase-1", function()
grants += 1
return true
end)
eq(decision2, "Granted", "재시도 완료 응답")
eq(grants, 1, "한 번만 지급")
eq(prof.Data.Money, 100, "Mock 돈")
prof:EndSession()
section("실제 DataStore 세션")
local live = ProfileStore.New("CloudTest_v1", Data.TEMPLATE)
local lp = live:StartSessionAsync("Player_test", {
Cancel = function()
return false
end,
})
check(lp ~= nil, "실제 저장소 세션 시작")
if lp then
lp.Data.Money += 1
lp:Save()
lp:EndSession()
end
section("Game.processReceipt(플레이어 없음)")
local Game = require(Server.Game)
eq(
Game.processReceipt({ PlayerId = 1, PurchaseId = "x", ProductId = 1 }),
Enum.ProductPurchaseDecision.NotProcessedYet,
"플레이어가 없으면 나중에"
)
section("화면 UI(서버에서 생성)")
local Hud = require(StarterPlayer.StarterPlayerScripts.Client.Hud)
local Theme = require(StarterPlayer.StarterPlayerScripts.Client.Theme)
local state = Instance.new("Folder")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Money", 25)
state:SetAttribute("Bought", 1)
state:SetAttribute("Money", 5)
state:SetAttribute("Levels", "")
state:SetAttribute("Stage", 1)
state:SetAttribute("Seats", 1)
state:SetAttribute("Tables", 1)
state:SetAttribute("Staff", "")
state:SetAttribute("Tut", 3)
local sent = {}
local holder = Instance.new("Folder")
@@ -441,113 +104,134 @@ local function label(o: Instance?): string?
return t and t.Text
end
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text", true) :: TextLabel
eq(moneyText.Text, "25", "돈 표시(숫자만, 동전 그림 옆)")
eq(moneyText.Text, "5", "돈 표시")
local nextCard = root:FindFirstChild("Next") :: Frame
local nextTitle = nextCard:FindFirstChild("Title", true) :: TextLabel
eq(nextTitle.Text, "김밥 해금", "다음 업그레이드")
local nextIcon = nextCard:FindFirstChild("IconBox", true):FindFirstChild("Icon") :: ImageLabel
eq(nextIcon.Image, Icons.ASSET, "다음 업그레이드 아이콘 그림")
eq(nextIcon.ImageRectOffset, Icons.OFFSET.Gimbap, "김밥 해금 아이콘")
eq((nextCard:FindFirstChild("Cost", true) :: TextLabel).Text, "25 / 40", "진행 막대 글자")
local hintFrame = root:FindFirstChild("Hint") :: Frame
check(hintFrame.Visible, "튜토리얼 말풍선 보임")
check(hintFrame:FindFirstChild("Mascot") ~= nil, "말풍선에 마스코트")
check(nextTitle.Text ~= "" and not string.find(nextTitle.Text, "_"), `추천 구매 이름 ({nextTitle.Text})`)
eq((nextCard:FindFirstChild("Cost", true) :: TextLabel).Text, "5 / 10", "추천 구매(의자 10원) 진행 막대")
check((root:FindFirstChild("Hint") :: Frame).Visible, "튜토리얼 말풍선 보임")
check((nextCard:FindFirstChild("Pointer") :: ImageLabel).Visible, "튜토리얼 3: [사기] 가리키는 손")
local buyBtn = nextCard:FindFirstChild("Buy") :: TextButton
eq(label(buyBtn), "사기", "사기 버튼 글자")
local Theme = require(StarterPlayer.StarterPlayerScripts.Client.Theme)
eq(
(buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3,
Theme.darken(Theme.GRAY, 0.3),
"돈이 모자라면 회색"
)
local listButton = root:FindFirstChild("ListButton") :: TextButton
eq(label(listButton), "상점", "상점 버튼 글자(짧게)")
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 상점 배지 없음")
state:SetAttribute("Money", 60)
eq(label(listButton), "상점", "상점 버튼 글자")
state:SetAttribute("Money", 15)
eq((buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3, Theme.darken(Theme.MINT, 0.3), "살 수 있으면 초록")
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 상점 버튼에 ! 배지")
check(root:FindFirstChild("Gain") ~= nil, "돈이 늘면 +돈 글자가 떠오름")
eq((root:FindFirstChild("Gain") :: TextLabel).Text, "+35", "늘어난 돈")
for _, d in Icons.OFFSET do
check(d.X % 128 == 0 and d.Y % 128 == 0 and d.X < 1024 and d.Y < 1024, "아이콘 칸 위치")
eq(
(root:FindFirstChild("Gain") :: TextLabel?) and (root:FindFirstChild("Gain") :: TextLabel).Text,
"+10",
"늘어난 돈"
)
for _, name in { "Promote", "Rush", "Double", "Boost", "Settings" } do
check(root:FindFirstChild(name) ~= nil, `버튼 {name}`)
end
for _, d in Icons.KITCHEN do
check(d.X % 256 == 0 and d.Y % 256 == 0 and d.X < 1024 and d.Y < 1024, "요리 그림 칸 위치")
end
-- 손에 든 접시
local carryFrame = root:FindFirstChild("Carry") :: Frame
check(not carryFrame.Visible, "빈손이면 접시 표시 숨김")
state:SetAttribute("Carry", 1)
state:SetAttribute("Hand", "Tteokbokki")
check(carryFrame.Visible, "접시를 들면 표시")
eq((carryFrame:FindFirstChild("Slot1") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Tteokbokki, "든 음식 그림")
state:SetAttribute("Carry", 0)
state:SetAttribute("Hand", "")
state:SetAttribute("Lang", "en")
eq(moneyText.Text, "60", "영어 돈 표시")
eq(nextTitle.Text, "Unlock Gimbap", "영어 다음 업그레이드")
state:SetAttribute("Lang", "zh")
eq(nextTitle.Text, "解锁紫菜包饭", "중국어 다음 업그레이드")
state:SetAttribute("Lang", "en")
local settingsBtn = root:FindFirstChild("Settings") :: TextButton
check(settingsBtn ~= nil, "오른쪽 위 설정 버튼")
local settingsPanel = root:FindFirstChild("SettingsPanel") :: Frame
check(settingsPanel ~= nil and not settingsPanel.Visible, "설정 창은 처음엔 닫힘")
for _, l in { "auto", "ko", "en", "ja", "zh" } do
check(settingsPanel:FindFirstChild("Lang_" .. l) ~= nil, `설정 창 언어 버튼 {l}`)
end
eq(label(settingsPanel:FindFirstChild("Lang_ja")), "日本語", "언어 이름은 그 나라 말")
eq(label(settingsPanel:FindFirstChild("MouseLook")), "On", "마우스 회전 기본 켜짐")
state:SetAttribute("Sfx", false)
eq(label(settingsPanel:FindFirstChild("Sfx")), "Off", "효과음 끔 표시")
check(not hud.menuOpen(), "창 닫힘")
check(nextTitle.Text ~= "" and not string.find(nextTitle.Text, "의자"), `영어 추천 구매 ({nextTitle.Text})`)
state:SetAttribute("Lang", "ko")
section("상점 창(탭 4개)")
hud.open("shop")
check(hud.menuOpen() and (root:FindFirstChild("Panel") :: Frame).Visible, "상점 창 열기")
check((root:FindFirstChild("Dim") :: TextButton).Visible, "창 뒤 어둡게")
local cardsFrame = root:FindFirstChild("Panel"):FindFirstChild("Cards", true) :: Frame
local n1 = 0
for _, ch in cardsFrame:GetChildren() do
if ch.Name:sub(1, 3) == "Row" then
n1 += 1
local panel = root:FindFirstChild("Panel") :: Frame
check(hud.menuOpen() and panel.Visible, "상점 창 열기")
local function page(id: string): Frame
return panel:FindFirstChild("Page_" .. id, true) :: Frame
end
for _, id in { "upgrade", "decor", "staff", "mine" } do
check(page(id) ~= nil, `탭 {id}`)
check(panel:FindFirstChild("Tab_" .. id, true) ~= nil, `탭 버튼 {id}`)
end
check(page("upgrade").Visible, "처음엔 업그레이드 탭")
for _, id in Economy.TRACK_ORDER do
local card = page("upgrade"):FindFirstChild("Track_" .. id, true)
check(card ~= nil, `갈래 카드 {id}`)
local nm = card and card:FindFirstChild("Name", true) :: TextLabel?
check(nm and nm.Text ~= "" and not string.find(nm.Text, "track_"), `갈래 이름 {id} ({nm and nm.Text})`)
end
local tray = page("upgrade"):FindFirstChild("Track_Tray", true) :: Frame
check((tray:FindFirstChild("Lock", true) :: ImageLabel).Visible, "쟁반은 포장마차에서 잠김")
hud.open("shop", "decor")
check(page("decor").Visible and not page("upgrade").Visible, "꾸미기 탭")
check(page("decor"):FindFirstChild("Place", true) ~= nil, "배치하기 버튼")
check(page("decor"):FindFirstChild("Decor_Table", true) ~= nil, "테이블 카드")
for _, d in Economy.DECOR do
check(page("decor"):FindFirstChild("Decor_" .. d.id, true) ~= nil, `소품 카드 {d.id}`)
end
hud.open("shop", "staff")
check((page("staff"):FindFirstChild("Locked", true) :: Frame).Visible, "알바생 기능 전에는 잠김")
state:SetAttribute("Levels", "Staff=1")
state:SetAttribute("Staff", "Cook=1,Server=0,Promoter=0")
state:SetAttribute("Strike", true)
check(not (page("staff"):FindFirstChild("Locked", true) :: Frame).Visible, "알바생 기능을 사면 열림")
for _, r in Economy.ROLES do
check(page("staff"):FindFirstChild("Role_" .. r.id, true) ~= nil, `알바 카드 {r.id}`)
end
hud.open("shop", "mine")
check(page("mine"):FindFirstChild("NameBox", true) ~= nil, "가게 이름 입력칸")
for _, d in Economy.DESIGNS do
check(page("mine"):FindFirstChild("Design_" .. d.id, true) ~= nil, `디자인 {d.id}`)
end
hud.open("settings")
local settingsPanel = root:FindFirstChild("SettingsPanel") :: Frame
check(settingsPanel.Visible and not panel.Visible, "창은 하나만 열림")
hud.open(nil)
check(not hud.menuOpen(), "창 닫기")
section("알림 글자(모든 알림 키, 4개 언어)")
local Info = require(StarterPlayer.StarterPlayerScripts.Client.Info)
local SAMPLES = {
upgraded = { track = "Speed", level = 2 },
newMenu = { menu = "Gimbap" },
expanded = {},
floor2 = {},
seatAdded = {},
tableAdded = {},
decorAdded = { kind = "Teddy" },
noSpace = {},
seatMax = {},
tableMax = {},
tableFull = {},
needStage = {},
placeFail = { why = "blocked" },
hired = { role = "Cook" },
fired = { role = "Server" },
staffLocked = {},
staffMax = {},
strike = {},
strikeOver = {},
renamed = {},
nameRejected = {},
designSet = { design = "Hanok" },
designLocked = {},
promoted = { n = 2 },
promoteNone = {},
promoteFull = {},
promoteWait = { sec = 30 },
adUnavailable = {},
kicked = { n = 3 },
kickedBy = { name = "Mina" },
shielded = {},
kickOwn = {},
rushOn = { min = 10 },
notEnough = { need = "100" },
}
for _, lang in { "ko", "en", "ja", "zh" } do
for key, args in SAMPLES do
local text = Info.toast(lang, key, args)
check(text ~= key and not string.find(text, "{") and text ~= "", `{lang} 알림 {key}: {text}`)
end
end
eq(n1, 10, "상점: 지금 단계 10개가 한 화면에(넘기지 않음)")
check(
cardsFrame:FindFirstChild("Row2"):FindFirstChild("BuyRow") ~= nil,
"상점의 다음 업그레이드에 사기 버튼"
)
check(cardsFrame:FindFirstChild("Row1"):FindFirstChild("Done", true) ~= nil, "산 업그레이드는 체크 표시")
check(cardsFrame:FindFirstChild("Row5"):FindFirstChild("Lock", true) ~= nil, "잠긴 업그레이드 자물쇠")
hud.open("settings")
check(settingsPanel.Visible and not (root:FindFirstChild("Panel") :: Frame).Visible, "창은 하나만 열림")
hud.open(nil)
check(not hud.menuOpen() and not (root:FindFirstChild("Dim") :: TextButton).Visible, "창 닫기")
state:SetAttribute("Bought", #Economy.PURCHASES)
check(not buyBtn.Visible, "다 사면 사기 버튼 숨김")
check(not (root:FindFirstChild("Boost") :: TextButton).Visible, "다 사면 돈 부스트 숨김")
local devMoneyBtn = settingsPanel:FindFirstChild("devMoney") :: TextButton
check(not devMoneyBtn.Visible, "개발자 버튼은 기본으로 숨김")
local setH = settingsPanel.Size.Y.Offset
state:SetAttribute("Dev", true)
check(devMoneyBtn.Visible, "게임 주인에게 개발자 버튼(설정 창)")
check(settingsPanel.Size.Y.Offset > setH, "개발자 줄만큼 설정 창이 길어짐")
local doubleBtn = root:FindFirstChild("Double") :: TextButton
check(doubleBtn.Visible, "2배 수익 버튼(상품 ID 설정됨)")
eq(label(doubleBtn), "2x Cash", "2배 수익 버튼 글자")
state:SetAttribute("Double", true)
eq(label(doubleBtn), "Active", "2배 수익 산 뒤")
check((doubleBtn:FindFirstChild("Owned") :: ImageLabel).Visible, "2배 수익 산 뒤 체크")
hud.notify("purchased", { item = "Table2" })
state:SetAttribute("Lang", "en")
hud.notify("upgraded", { track = "Speed", level = 2 })
local toastText = root.Toasts:FindFirstChild("Toast"):FindFirstChild("Text") :: TextLabel
eq(toastText.Text, "Table 2 bought!", "구매 알림에 업그레이드 이름(내 언어)")
eq(
(root.Toasts:FindFirstChild("Toast"):FindFirstChild("Icon") :: ImageLabel).ImageRectOffset,
Icons.OFFSET.check,
"구매 알림 아이콘"
)
check(string.find(toastText.Text, "Customer Speed") ~= nil, `알림에 갈래 이름(내 언어) ({toastText.Text})`)
for _ = 1, 5 do
hud.notify("purchased", { item = "Table2" })
hud.notify("seatAdded")
end
local toastCount = 0
for _, ch in root.Toasts:GetChildren() do
@@ -556,7 +240,9 @@ for _, ch in root.Toasts:GetChildren() do
end
end
check(toastCount <= 3, `알림은 3개까지만 쌓임 ({toastCount})`)
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 버튼 묶음은 왼쪽 위, 마우스 줄 숨김
section("휴대폰·PC 배치")
local doubleBtn = root:FindFirstChild("Double") :: TextButton
hud.setLayout(Vector2.new(750, 332), true)
local lay = hud.layout()
local scaleObj = root:FindFirstChildOfClass("UIScale") :: UIScale
@@ -564,29 +250,22 @@ check(
root.Size.X.Offset * scaleObj.Scale - 750 >= -1e-3 and root.Size.X.Offset * scaleObj.Scale - 750 < scaleObj.Scale,
"휴대폰: 루트 너비 = 화면"
)
check(
root.Size.Y.Offset * scaleObj.Scale - 332 >= -1e-3 and root.Size.Y.Offset * scaleObj.Scale - 332 < scaleObj.Scale,
"휴대폰: 루트 높이 = 화면"
)
eq(
doubleBtn.Position.Y.Offset,
lay.double.y + lay.double.h / 2,
"휴대폰: 2배 수익 버튼 위치(가운데 기준)"
)
eq(doubleBtn.Size.Y.Offset, lay.double.h, "휴대폰: 2배 수익 버튼 크기")
check(lay.double.y + lay.double.h < lay.height / 3, "휴대폰: 결제 버튼은 조이스틱 자리 위")
check(not (settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "휴대폰: 마우스 회전 줄 숨김")
check(scaleObj.Scale > 0.8, `휴대폰: 글자 배율 {scaleObj.Scale}`)
eq(doubleBtn.Size.Y.Offset, lay.double.h, "휴대폰: 2배 수익 버튼 크기")
hud.setLayout(Vector2.new(1366, 710), false)
check((settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "PC: 마우스 회전 줄 보임")
check(math.abs(scaleObj.Scale - math.min(1366 / 1100, 710 / 620)) < 1e-6, "PC: 배율(상단 바 뺀 높이 기준)")
hud.destroy()
section("꾸미기 화면(클라이언트 모듈)")
local Decorate = require(StarterPlayer.StarterPlayerScripts.Client.Decorate)
check(typeof(Decorate.build) == "function", "꾸미기 모듈")
section("요리 창(메뉴 고르기 → 조리 과정 → 완성)")
local kstate = Instance.new("Folder")
kstate:SetAttribute("Lang", "ko")
kstate:SetAttribute("Money", 0)
kstate:SetAttribute("Bought", 6) -- 떡볶이·김밥·순대 해금
kstate:SetAttribute("Levels", "Menu=2") -- 떡볶이·김밥·순대 해금
kstate:SetAttribute("Tut", 1)
kstate:SetAttribute("Orders", "Gimbap=2")
local ksent = {}
@@ -676,7 +355,7 @@ check(not kitchen.isOpen() and not kframe.Visible, "더 만들 것이 없으면
check(not (kroot:FindFirstChild("Dim") :: TextButton).Visible, "닫히면 어둡게도 꺼짐")
-- 메뉴마다 과정이 다르고 끝까지 갈 수 있음
for _, m in Economy.MENU_ORDER do
kstate:SetAttribute("Bought", 20)
kstate:SetAttribute("Levels", "Stage=1,Menu=4")
kstate:SetAttribute("Carry", 0)
kstate:SetAttribute("Orders", `{m}=1`)
khud.open("kitchen")
@@ -749,23 +428,27 @@ for _, asset in { Icons.ASSET, Icons.KITCHEN_ASSET } do
end
end
section("Products")
section("Products(게임패스·개발자 상품)")
local Products = require(ReplicatedStorage.Shared.Products)
local MarketplaceService = game:GetService("MarketplaceService")
if Products.DOUBLE_MONEY_PASS ~= 0 then
local info = MarketplaceService:GetProductInfoAsync(Products.DOUBLE_MONEY_PASS, Enum.InfoType.GamePass)
print("게임패스", info.Name, info.PriceInRobux, info.IsForSale)
check(info.IsForSale, "2배 수익 판매 중")
for key, id in Products do
check(id ~= 0, `{key} ID 있음`)
local isPass = string.find(key, "_PASS$") ~= nil
local okInfo, info = pcall(function()
return MarketplaceService:GetProductInfoAsync(
id,
if isPass then Enum.InfoType.GamePass else Enum.InfoType.Product
)
end)
check(okInfo, `{key} 정보 조회`)
if okInfo then
print(key, info.Name, info.PriceInRobux, info.IsForSale)
check(info.PriceInRobux ~= nil and info.PriceInRobux > 0, `{key} 가격`)
end
end
if Products.MONEY_BOOST_PRODUCT ~= 0 then
local info = MarketplaceService:GetProductInfoAsync(Products.MONEY_BOOST_PRODUCT, Enum.InfoType.Product)
print("개발자 상품", info.Name, info.PriceInRobux)
check(info.PriceInRobux ~= nil, "돈 부스트 가격")
end
c:destroy()
section("Game.start(실제 서버 시작 순서)")
local Game = require(Server.Game)
local okStart, errStart = pcall(Game.start)
check(okStart, `Game.start 오류 없음 ({errStart})`)
task.wait(1)

View File

@@ -54,6 +54,42 @@ local npc = Npc.spawnCustomer(workspace, CFrame.new(0, 5, 0), Random.new(1))
check(npc.model:FindFirstChild("HumanoidRootPart") ~= nil, "손님 NPC 몸")
check(npc.tracks.walk ~= nil and npc.tracks.sit ~= nil and npc.tracks.idle ~= nil, "NPC 애니메이션 3종 로드")
npc.model:Destroy()
local tLooks = os.clock()
Npc.preloadCustomers()
local nHuman, nAnimal = Npc.lookCount()
print(`손님 외형: 사람 {nHuman}벌, 동물 {nAnimal}종, {math.floor((os.clock() - tLooks) * 1000)}ms`)
check(nHuman >= 10, `사람 외형 10벌 이상 ({nHuman})`)
check(nAnimal >= 8, `동물 외형 8종 이상 ({nAnimal})`)
local rngLook = Random.new(5)
local animals, humans, accessories = 0, 0, 0
local shown = {}
for _ = 1, 200 do
local h = Npc.spawnCustomer(workspace, CFrame.new(0, 300, 0), rngLook)
local kind = h.model:GetAttribute("Animal")
if kind then
animals += 1
shown[kind] = true
else
humans += 1
end
for _, d in h.model:GetChildren() do
if d:IsA("Accessory") then
accessories += 1
end
end
check(h.tracks.walk ~= nil and h.tracks.sit ~= nil, "손님 애니메이션")
check(h.model:FindFirstChildWhichIsA("Script", true) == nil, "손님 모형에 스크립트 없음")
h.model:Destroy()
end
print(`손님 200명: 사람 {humans}, 동물 {animals}, 장신구 {accessories}`)
check(humans > animals * 2, "사람 손님이 가장 많음")
check(animals >= 25 and animals <= 75, `동물 손님은 가끔(약 25%) ({animals})`)
check(accessories > 200, "머리·모자 장신구가 붙음")
local kinds = 0
for _ in shown do
kinds += 1
end
check(kinds >= 6, `동물 종류 여러 가지 ({kinds})`)
local PlotController = require(Server.PlotController)
local PlotBuilder = require(Server.PlotBuilder)