feat(bunsik): 가게 꾸미기 3D 투명 미리보기·회전, 테이블·의자 따로 배치, 아래 [사기] 막대 → 튜토리얼, 손님 느리게, 2배 돈 "이미 보유" 수정
- 아래 추천 [사기] 막대를 없애고 튜토리얼 말풍선을 아래 가운데로. 튜토리얼 3단계는 [가게 꾸미기]에서 의자 놓기
- 상점에서 꾸미기 탭을 빼고 따로 [가게 꾸미기] 버튼·창. 카드를 고르면 캐릭터 앞에 투명 미리보기가 붙어 다니고
[돌리기](R)·[놓기](F)로 그 자리에 놓음(놓을 때 돈). [옮기기]로 놓은 물건·조리대를 들어서 옮김
- 의자를 테이블에서 떼어 {x,z,f,r}로 저장(등받이로 방향 보임). 의자는 보는 쪽 앞에 테이블이 있어야 하고,
테이블을 옮기거나 돌리면 그 테이블을 보는 의자도 같이. 예전 {t,s} 저장은 자동 변환. 새 요청 buyAt
- 테이블은 의자 없이 따로 판매(20 + 15×테이블 수²)
- 손님 간격 10초 → 20초(손님 속도 갈래도 2배), 대신 음식값 2배로 1분 매출 유지. 실내 11분·2층 50분(봇)
- 2배 돈: 게임 주인은 게임패스를 자동 보유하는데 [처음부터]·2배 끄기 뒤 버튼이 결제 창을 띄워 "이미 보유"가 나옴.
누르면 먼저 보유를 확인해 바로 켜고, [처음부터]도 2배를 유지
- 검사 위치 0.5칸 자리 길 검사 오류 수정(touches가 막힌 칸 안쪽을 보던 문제)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -176,12 +176,9 @@ local SHOTS = {
|
||||
),
|
||||
shot("phone_tut", PHONE, shopState("", 1, 1, { Money = 15, Tut = 3 })),
|
||||
shot("phone_shop", PHONE, shopState(EARLY, 2, 1, { Money = 150 }), { open = "shop" }),
|
||||
shot(
|
||||
"phone_shop_decor",
|
||||
PHONE,
|
||||
shopState(MID, 3, 2, { Money = 400, Layout = LAYOUT }),
|
||||
{ open = "shop", tab = "decor" }
|
||||
),
|
||||
shot("phone_decor", PHONE, shopState(MID, 3, 2, { Money = 400, Layout = LAYOUT }), { open = "decor" }),
|
||||
shot("pc_decor", PC, shopState(MID, 3, 2, { Money = 60, Layout = LAYOUT }), { open = "decor" }),
|
||||
shot("pc_tut", PC, shopState("", 1, 1, { Money = 15, Tut = 3 })),
|
||||
shot(
|
||||
"phone_shop_staff",
|
||||
PHONE,
|
||||
|
||||
@@ -105,23 +105,23 @@ local function label(o: Instance?): string?
|
||||
end
|
||||
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text", true) :: TextLabel
|
||||
eq(moneyText.Text, "5", "돈 표시")
|
||||
local nextCard = root:FindFirstChild("Next") :: Frame
|
||||
local nextTitle = nextCard:FindFirstChild("Title", true) :: TextLabel
|
||||
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), "사기", "사기 버튼 글자")
|
||||
eq(
|
||||
(buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3,
|
||||
Theme.darken(Theme.GRAY, 0.3),
|
||||
"돈이 모자라면 회색"
|
||||
check(root:FindFirstChild("Next") == nil, "아래 [사기] 막대 없음")
|
||||
local hintFrame = root:FindFirstChild("Hint") :: Frame
|
||||
check(hintFrame.Visible, "튜토리얼 말풍선 보임")
|
||||
local hintText = hintFrame:FindFirstChild("Text", true) :: TextLabel
|
||||
check(
|
||||
string.find(hintText.Text, "가게 꾸미기") ~= nil,
|
||||
`튜토리얼 3은 가게 꾸미기 안내 ({hintText.Text})`
|
||||
)
|
||||
check((root:FindFirstChild("Pointer") :: ImageLabel).Visible, "튜토리얼 3: [가게 꾸미기] 가리키는 손")
|
||||
local lay0 = hud.layout()
|
||||
check(hintFrame.Position.Y.Offset > lay0.height / 2, "튜토리얼 말풍선은 화면 아래쪽")
|
||||
local listButton = root:FindFirstChild("ListButton") :: TextButton
|
||||
eq(label(listButton), "상점", "상점 버튼 글자")
|
||||
local decoButton = root:FindFirstChild("Decorate") :: TextButton
|
||||
eq(label(decoButton), "가게 꾸미기", "가게 꾸미기 버튼 글자")
|
||||
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "살 것이 없으면 배지 없음")
|
||||
state:SetAttribute("Money", 15)
|
||||
eq((buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3, Theme.darken(Theme.MINT, 0.3), "살 수 있으면 초록")
|
||||
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 상점 버튼에 ! 배지")
|
||||
eq(
|
||||
(root:FindFirstChild("Gain") :: TextLabel?) and (root:FindFirstChild("Gain") :: TextLabel).Text,
|
||||
@@ -132,20 +132,26 @@ for _, name in { "Promote", "Rush", "Double", "Boost", "Settings" } do
|
||||
check(root:FindFirstChild(name) ~= nil, `버튼 {name}`)
|
||||
end
|
||||
state:SetAttribute("Lang", "en")
|
||||
check(nextTitle.Text ~= "" and not string.find(nextTitle.Text, "의자"), `영어 추천 구매 ({nextTitle.Text})`)
|
||||
eq(label(decoButton), "Decorate", "영어 가게 꾸미기 버튼")
|
||||
state:SetAttribute("Lang", "ko")
|
||||
state:SetAttribute("Tut", 0)
|
||||
check(
|
||||
not hintFrame.Visible and not (root:FindFirstChild("Pointer") :: ImageLabel).Visible,
|
||||
"튜토리얼 끝나면 아래 말풍선 없음"
|
||||
)
|
||||
|
||||
section("상점 창(탭 4개)")
|
||||
section("상점 창(탭 3개)")
|
||||
hud.open("shop")
|
||||
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
|
||||
for _, id in { "upgrade", "staff", "mine" } do
|
||||
check(page(id) ~= nil, `탭 {id}`)
|
||||
check(panel:FindFirstChild("Tab_" .. id, true) ~= nil, `탭 버튼 {id}`)
|
||||
end
|
||||
check(panel:FindFirstChild("Tab_decor", true) == nil, "상점에는 꾸미기 탭 없음")
|
||||
check(page("upgrade").Visible, "처음엔 업그레이드 탭")
|
||||
for _, id in Economy.TRACK_ORDER do
|
||||
local card = page("upgrade"):FindFirstChild("Track_" .. id, true)
|
||||
@@ -155,13 +161,22 @@ for _, id in Economy.TRACK_ORDER do
|
||||
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}`)
|
||||
hud.open("decor")
|
||||
local decorPanel = root:FindFirstChild("DecorPanel") :: Frame
|
||||
check(decorPanel.Visible and not panel.Visible and hud.menuOpen(), "가게 꾸미기 창(상점과 따로)")
|
||||
local decorPage = decorPanel:FindFirstChild("Page_decor", true) :: Frame
|
||||
check(decorPage ~= nil, "가게 꾸미기 카드 자리")
|
||||
eq(label(decorPage:FindFirstChild("Place", true)), "옮기기", "옮기기 버튼")
|
||||
for _, id in { "Table", "Seat" } do
|
||||
check(decorPage:FindFirstChild("Decor_" .. id, true) ~= nil, `{id} 카드`)
|
||||
end
|
||||
for _, d in Economy.DECOR do
|
||||
check(decorPage:FindFirstChild("Decor_" .. d.id, true) ~= nil, `소품 카드 {d.id}`)
|
||||
end
|
||||
local tableCost = (decorPage:FindFirstChild("Decor_Table", true) :: Frame):FindFirstChild("Buy", true)
|
||||
eq(label(tableCost), Locale.number(Economy.tableCost(1)), "테이블 값(의자 없이)")
|
||||
hud.open("shop", "upgrade")
|
||||
check(not decorPanel.Visible and panel.Visible, "창은 하나만 열림(꾸미기 → 상점)")
|
||||
hud.open("shop", "staff")
|
||||
check((page("staff"):FindFirstChild("Locked", true) :: Frame).Visible, "알바생 기능 전에는 잠김")
|
||||
state:SetAttribute("Levels", "Staff=1")
|
||||
@@ -219,6 +234,7 @@ local SAMPLES = {
|
||||
kickOwn = {},
|
||||
rushOn = { min = 10 },
|
||||
notEnough = { need = "100" },
|
||||
doubleOwned = {},
|
||||
}
|
||||
for _, lang in { "ko", "en", "ja", "zh" } do
|
||||
for key, args in SAMPLES do
|
||||
@@ -260,6 +276,23 @@ hud.destroy()
|
||||
section("꾸미기 화면(클라이언트 모듈)")
|
||||
local Decorate = require(StarterPlayer.StarterPlayerScripts.Client.Decorate)
|
||||
check(typeof(Decorate.build) == "function", "꾸미기 모듈")
|
||||
local dstate = Instance.new("Folder")
|
||||
dstate:SetAttribute("Lang", "ko")
|
||||
dstate:SetAttribute("Stage", 1)
|
||||
dstate:SetAttribute("Money", 100)
|
||||
local dplot = Instance.new("Model")
|
||||
dplot:SetAttribute("Origin", CFrame.new())
|
||||
local dholder = Instance.new("Folder")
|
||||
local deco = Decorate.build(dholder, dstate, dplot, function() end)
|
||||
local Layout = require(StarterPlayer.StarterPlayerScripts.Client.Layout)
|
||||
deco.setLayout(Layout.compute(750, 332, true, false))
|
||||
local droot = deco.gui:FindFirstChild("Root") :: Frame
|
||||
for _, name in { "Exit", "Info", "Rotate", "Cancel", "Place" } do
|
||||
check(droot:FindFirstChild(name) ~= nil, `꾸미기 {name}`)
|
||||
end
|
||||
check(droot:FindFirstChild("Floor") == nil and droot:FindFirstChild("Side1") == nil, "예전 층·쪽 버튼 없음")
|
||||
check(not deco.isOpen() and not deco.holding(), "처음엔 닫힘")
|
||||
deco.destroy()
|
||||
|
||||
section("요리 창(메뉴 고르기 → 조리 과정 → 완성)")
|
||||
local kstate = Instance.new("Folder")
|
||||
|
||||
@@ -175,7 +175,7 @@ eq(owner:GetAttribute("Tut"), 2, "튜토리얼 2단계")
|
||||
-- 접시가 똑바로 놓이는지(예전에 세로로 서던 문제)
|
||||
local held = dyn:FindFirstChild("Dish_Tteokbokki") :: Model
|
||||
check(held ~= nil, "접시 모형")
|
||||
eq(c:serve(1), 15, "서빙 15원")
|
||||
eq(c:serve(1), 30, "서빙 30원")
|
||||
local onTable = dyn:FindFirstChild("Dish_Tteokbokki") :: Model
|
||||
local up = onTable and onTable:GetPivot().UpVector
|
||||
check(up and up.Y > 0.99, `테이블 위 접시가 똑바로 놓임 (UpVector.Y {up and up.Y})`)
|
||||
@@ -218,11 +218,60 @@ for _ = 1, 4 do
|
||||
check(c:buyTable(), "테이블 구매")
|
||||
end
|
||||
eq(#c.layout.tables, 5, "테이블 5")
|
||||
for _ = 1, 5 do
|
||||
eq(owner:GetAttribute("Seats"), 2, "테이블만 사면 의자는 그대로")
|
||||
for _ = 1, 9 do
|
||||
check(c:buySeat(nil), "의자 구매")
|
||||
end
|
||||
eq(owner:GetAttribute("Seats"), 11, "의자 11")
|
||||
eq(Floor.validate(c.layout, 2), nil, "배치 검사 통과")
|
||||
-- 꾸미기 화면처럼 정한 자리에 새 물건 놓기(투명 미리보기 → 놓기)
|
||||
local tableAt = nil
|
||||
for _, spotXZ in { { 22, -20 }, { -22, -20 }, { 22, 0 }, { -22, 0 } } do
|
||||
if not tableAt and c:buyItem("table", nil, { kind = "table", x = spotXZ[1], z = spotXZ[2], f = 1 }) then
|
||||
tableAt = spotXZ
|
||||
end
|
||||
end
|
||||
check(tableAt ~= nil, "정한 자리에 테이블 놓기")
|
||||
if tableAt then
|
||||
local tn = #c.layout.tables
|
||||
eq(c.layout.tables[tn].x, tableAt[1], "테이블 x 그대로")
|
||||
check(
|
||||
c:buyItem("chair", nil, { kind = "chair", x = tableAt[1], z = tableAt[2] - 3.5, f = 1, r = 0 }),
|
||||
"테이블 뒤에 의자 놓기"
|
||||
)
|
||||
local cn = #c.layout.chairs
|
||||
eq(c.layout.chairs[cn].r, 0, "의자 방향 저장")
|
||||
eq(Floor.chairTable(c.layout, cn), tn, "새 의자는 새 테이블을 봄")
|
||||
check(furniture:FindFirstChild("Chair" .. cn) ~= nil, "새 의자 모형")
|
||||
local seatCf = PlotBuilder.seatCFrame(slots[1].cf, c.layout, cn)
|
||||
local tablePos = PlotBuilder.floorCFrame(slots[1].cf, tableAt[1], tableAt[2], 1).Position
|
||||
local toTable = (Vector3.new(tablePos.X, seatCf.Position.Y, tablePos.Z) - seatCf.Position).Unit
|
||||
check(seatCf.LookVector:Dot(toTable) > 0.9, "앉은 손님은 테이블을 봄")
|
||||
local dish = PlotBuilder.dishCFrame(slots[1].cf, c.layout, cn)
|
||||
local local_ = slots[1].cf:PointToObjectSpace(dish.Position)
|
||||
check(math.abs(local_.X - tableAt[1]) <= 2.5 and math.abs(local_.Z - tableAt[2]) <= 2.5, "접시는 테이블 위")
|
||||
end
|
||||
local seatsBefore = #c.layout.chairs
|
||||
local moneyBefore = c.shop.money
|
||||
check(
|
||||
not c:buyItem("chair", nil, { kind = "chair", x = 0, z = 5, f = 1, r = 0 }),
|
||||
"테이블 없는 곳에 의자 못 놓음"
|
||||
)
|
||||
eq(#c.layout.chairs, seatsBefore, "실패하면 의자 그대로")
|
||||
eq(c.shop.money, moneyBefore, "실패하면 돈 안 나감")
|
||||
check(noted("placeFail"), "못 놓는 이유 알림")
|
||||
local teddy = false
|
||||
for _, spotXZ in { { 0, 8 }, { 16, 12 }, { -16, 12 }, { 30, -20 }, { -30, -20 } } do
|
||||
teddy = teddy
|
||||
or c:buyItem("decor", "Teddy", { kind = "decor", k = "Teddy", x = spotXZ[1], z = spotXZ[2], f = 1, r = 2 })
|
||||
end
|
||||
check(teddy, "정한 자리에 곰인형")
|
||||
eq(c.layout.decor[#c.layout.decor].r, 2, "소품 방향 저장")
|
||||
local templates = PlotBuilder.buildTemplates()
|
||||
for _, name in { "Table", "Chair", "Decor_Plant", "Decor_Fridge" } do
|
||||
local tm = templates:FindFirstChild(name) :: Model?
|
||||
check(tm ~= nil and tm:GetPivot().Position.Magnitude < 1e-3, `미리보기 모형 {name}(기준점 원점)`)
|
||||
end
|
||||
check(c:buyDecor("Plant"), "화분 구매")
|
||||
check(c:buyDecor("Balloons"), "풍선 구매")
|
||||
check(furniture:FindFirstChild("Decor1") ~= nil, "소품 모형")
|
||||
@@ -239,18 +288,33 @@ local stallBefore = slots[1].refs.stall:GetPivot().Position
|
||||
check(c:move({ kind = "stove", i = 1, x = 4, z = -28, r = 0 }), "조리대 옮기기")
|
||||
check((slots[1].refs.stall:GetPivot().Position - stallBefore).Magnitude > 3, "수레 모형이 옮겨짐")
|
||||
check(slots[1].refs.stove:IsDescendantOf(slots[1].refs.stall), "조리대 인스턴스는 그대로(버튼 유지)")
|
||||
-- 의자 1을 빈 쪽이 있는 다른 테이블로 옮기기(테이블 1은 네 쪽이 다 찼을 수 있음)
|
||||
-- 의자 1을 다른 테이블의 빈 쪽으로 옮기기
|
||||
local sideMoved = false
|
||||
for ti in c.layout.tables do
|
||||
local from = Floor.chairTable(c.layout, 1)
|
||||
for ti, tb in c.layout.tables do
|
||||
for side = 1, 4 do
|
||||
if not sideMoved and ti ~= c.layout.chairs[1].t then
|
||||
sideMoved = c:move({ kind = "chair", i = 1, x = side, z = ti })
|
||||
if not sideMoved and ti ~= from then
|
||||
local at = Floor.chairAt(tb, side)
|
||||
sideMoved = c:move({ kind = "chair", i = 1, x = at.x, z = at.z, f = at.f, r = at.r })
|
||||
end
|
||||
end
|
||||
end
|
||||
check(sideMoved, "의자를 다른 테이블·다른 쪽으로 옮기기")
|
||||
-- 테이블을 옮기면 그 테이블을 보는 의자도 같이
|
||||
local tIndex = Floor.chairTable(c.layout, 1) :: number
|
||||
local tb0 = c.layout.tables[tIndex]
|
||||
local ch0 = c.layout.chairs[1]
|
||||
local movedWith = false
|
||||
for _, d in { { 0, -4 }, { 0, 4 }, { 4, 0 }, { -4, 0 }, { 6, 6 }, { -6, -6 } } do
|
||||
if not movedWith and c:move({ kind = "table", i = tIndex, x = tb0.x + d[1], z = tb0.z + d[2], f = tb0.f }) then
|
||||
movedWith = true
|
||||
eq(c.layout.chairs[1].x, ch0.x + d[1], "의자도 같이 옮겨짐")
|
||||
end
|
||||
end
|
||||
check(movedWith, "의자 붙은 테이블 옮기기")
|
||||
c.shop.money = 0
|
||||
check(not c:buyTable(), "돈 모자라면 테이블 못 삼")
|
||||
check(not c:buyItem("chair", nil, { kind = "chair", x = 0, z = 0, f = 1, r = 0 }), "돈 모자라면 의자 못 놓음")
|
||||
check(noted("notEnough"), "모자란 돈 알림")
|
||||
c:addMoney(1_000_000)
|
||||
|
||||
@@ -301,9 +365,10 @@ end
|
||||
check(#c.layout.tables > before2, "테이블 늘어남")
|
||||
check(on2 ~= nil, "2층에 테이블")
|
||||
if on2 then
|
||||
check(c:buySeat(on2), "2층 테이블에 의자")
|
||||
local chair2 = nil
|
||||
for ci, ch in c.layout.chairs do
|
||||
if ch.t == on2 then
|
||||
for ci in c.layout.chairs do
|
||||
if Floor.chairTable(c.layout, ci) == on2 then
|
||||
chair2 = ci
|
||||
end
|
||||
end
|
||||
@@ -349,7 +414,7 @@ end
|
||||
local served = c.shop.served - served0
|
||||
print(`5분 영업(알바만): 서빙 {served}회, 돈 {c.shop.money - money0}`)
|
||||
check(delivered, "서빙 알바가 접시를 들고 감")
|
||||
check(served > 20, "알바만으로 5분 동안 20회 넘게 서빙")
|
||||
check(served > 12, "알바만으로 5분 동안 12회 넘게 서빙(손님 간격 20초 기준)")
|
||||
check(c.shop.money > money0, "시급을 내고도 돈이 늘어남")
|
||||
task.wait(Economy.WALK_IN + 2)
|
||||
check(count_(dyn, "Customer") <= Economy.seatCap(3) + 6, "손님 NPC가 쌓이지 않음")
|
||||
|
||||
Reference in New Issue
Block a user