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:
EJClaw
2026-10-14 05:22:17 +09:00
parent e57e908b85
commit fdc5c05c2c
22 changed files with 1527 additions and 1107 deletions

View File

@@ -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가 쌓이지 않음")