feat(bunsik): MVP 전체 구현 — 맵, 요리·서빙, 손님 NPC, 업그레이드 20개, 세이브, 결제, 한/영 UI

- Shop.luau: 손님·주문·조리·서빙·구매 순수 로직(lune 단위 테스트, 시뮬레이터 공용)
- 서버: World(부지 6칸), PlotBuilder(파트 모형), PlotController, Npc(트윈 이동), Data(ProfileStore), Receipts(결제 1회 = 지급 1회), Game
- 클라이언트: Hud(돈·다음 업그레이드·목록·결제·언어·튜토리얼), 내 조리대 전용 버튼, 튜토리얼 화살표, 주인 전용 테스트 버튼
- 2단계 업그레이드 10개 추가, 파이썬 시뮬레이터를 실제 로직 기반 tools/sim.luau로 교체
- tools/cloud.py: 업로드, 원격 Luau 실행, 게임패스·개발자 상품 생성, 서버 인원 설정
- tests/cloud/integration.luau: 로블록스 서버 통합 테스트 514개 통과
- check.sh에 luau-lsp 타입 검사 추가, ProfileStore 고정 버전 포함

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-12 01:34:06 +09:00
parent 060974e277
commit 802ba10e1a
45 changed files with 6997 additions and 202 deletions

View File

@@ -1,5 +1,6 @@
--!strict
-- 분식집 첫 10분 경제 수치. ECONOMY.md 표, tools/economy_sim.py 와 같은 숫자여야 합니다.
-- 분식집 경제 수치. ECONOMY.md 표와 같은 숫자여야 합니다.
-- 숫자를 바꾸면 `lune run tools/sim.luau` 로 구매 시점을 다시 확인합니다.
export type Effect = {
seats: number?, -- 테이블 수
@@ -8,19 +9,44 @@ export type Effect = {
price: number?, -- 가격 배율
helper: boolean?, -- 알바생(조리 자동)
menu: string?, -- 해금할 메뉴
carry: number?, -- 한 번에 드는 접시 수
stage: number?, -- 가게 단계(2 = 실내 분식집)
}
export type Purchase = {
id: string,
name: string,
nameEn: string,
cost: number,
effect: Effect,
}
export type Menu = {
name: string,
nameEn: string,
price: number,
icon: string,
}
export type Stats = {
seats: number,
spawn: number,
cook: number,
price: number,
helper: boolean,
menus: { string },
carry: number,
stage: number,
}
local Economy = {}
Economy.WALK = 5 -- 조리대 -> 테이블 -> 조리대 왕복(초)
Economy.WALK = 5 -- 조리대 -> 테이블 -> 조리대 왕복(초, 시뮬레이터 가정)
Economy.EAT = 6 -- 식사 시간(초)
Economy.WALK_IN = 2.5 -- 손님이 입구에서 자리까지 걷는 시간(초)
Economy.COUNTER_MAX = 3 -- 알바생이 미리 만들어 두는 접시 최대 수
Economy.BOOST_MINUTES = 10 -- 돈 부스트 팩: 현재 1분 매출 x 10분
Economy.BOOST_MIN = 100 -- 돈 부스트 팩 최소 지급액
Economy.START = {
money = 0,
@@ -30,25 +56,123 @@ Economy.START = {
price = 1,
helper = false,
menus = { "Tteokbokki" },
carry = 1,
stage = 1,
}
Economy.MENUS = {
Tteokbokki = { name = "떡볶이", price = 10 },
Gimbap = { name = "김밥", price = 20 },
Sundae = { name = "순대", price = 35 },
}
Tteokbokki = { name = "떡볶이", nameEn = "Tteokbokki", price = 10, icon = "🌶️" },
Gimbap = { name = "김밥", nameEn = "Gimbap", price = 20, icon = "🍙" },
Sundae = { name = "순대", nameEn = "Sundae", price = 35, icon = "🌭" },
Eomuk = { name = "어묵", nameEn = "Fish Cake", price = 50, icon = "🍢" },
Twigim = { name = "튀김", nameEn = "Twigim", price = 70, icon = "🍤" },
} :: { [string]: Menu }
-- 메뉴 표시 순서
Economy.MENU_ORDER = { "Tteokbokki", "Gimbap", "Sundae", "Eomuk", "Twigim" }
-- 1~10: 첫 10분(1단계 포장마차). 11~20: 2단계 실내 분식집.
Economy.PURCHASES = {
{ id = "Table2", name = "테이블 2", cost = 10, effect = { seats = 2 } },
{ id = "UnlockGimbap", name = "김밥 해금", cost = 40, effect = { menu = "Gimbap" } },
{ id = "Sign1", name = "간판 Lv1", cost = 70, effect = { spawn = 5 } },
{ id = "Stove1", name = "화구 Lv1", cost = 90, effect = { cook = 1.5 } },
{ id = "Table3", name = "테이블 3", cost = 120, effect = { seats = 3 } },
{ id = "UnlockSundae", name = "순대 해금", cost = 160, effect = { menu = "Sundae" } },
{ id = "Sauce1", name = "양념 비법 Lv1", cost = 240, effect = { price = 1.5 } },
{ id = "Helper", name = "알바생 고용", cost = 360, effect = { helper = true } },
{ id = "Table4", name = "테이블 4", cost = 480, effect = { seats = 4, spawn = 4 } },
{ id = "Expand", name = "실내 분식집 확장", cost = 600, effect = {} },
{ id = "Table2", name = "테이블 2", nameEn = "Table 2", cost = 10, effect = { seats = 2 } },
{ id = "UnlockGimbap", name = "김밥 해금", nameEn = "Unlock Gimbap", cost = 40, effect = { menu = "Gimbap" } },
{ id = "Sign1", name = "간판 Lv1", nameEn = "Sign Lv1", cost = 70, effect = { spawn = 5 } },
{ id = "Stove1", name = "화구 Lv1", nameEn = "Stove Lv1", cost = 90, effect = { cook = 1.5 } },
{ id = "Table3", name = "테이블 3", nameEn = "Table 3", cost = 120, effect = { seats = 3 } },
{ id = "UnlockSundae", name = "순대 해금", nameEn = "Unlock Sundae", cost = 160, effect = { menu = "Sundae" } },
{ id = "Sauce1", name = "양념 비법 Lv1", nameEn = "Secret Sauce Lv1", cost = 240, effect = { price = 1.5 } },
{ id = "Helper", name = "알바생 고용", nameEn = "Hire Helper", cost = 360, effect = { helper = true } },
{ id = "Table4", name = "테이블 4", nameEn = "Table 4", cost = 480, effect = { seats = 4, spawn = 4 } },
{ id = "Expand", name = "실내 분식집 확장", nameEn = "Indoor Shop", cost = 600, effect = { stage = 2 } },
{ id = "Tray1", name = "쟁반", nameEn = "Tray", cost = 700, effect = { carry = 2 } },
{ id = "Table5", name = "테이블 5", nameEn = "Table 5", cost = 800, effect = { seats = 5 } },
{
id = "UnlockEomuk",
name = "어묵 해금",
nameEn = "Unlock Fish Cake",
cost = 950,
effect = { menu = "Eomuk" },
},
{ id = "Sign2", name = "간판 Lv2", nameEn = "Sign Lv2", cost = 1150, effect = { spawn = 3 } },
{ id = "Table6", name = "테이블 6", nameEn = "Table 6", cost = 1400, effect = { seats = 6 } },
{ id = "Stove2", name = "화구 Lv2", nameEn = "Stove Lv2", cost = 1700, effect = { cook = 1 } },
{
id = "UnlockTwigim",
name = "튀김 해금",
nameEn = "Unlock Twigim",
cost = 2000,
effect = { menu = "Twigim" },
},
{ id = "Sauce2", name = "양념 비법 Lv2", nameEn = "Secret Sauce Lv2", cost = 2500, effect = { price = 2 } },
{ id = "Tray2", name = "큰 쟁반", nameEn = "Big Tray", cost = 3000, effect = { carry = 3 } },
{ id = "Table8", name = "테이블 7·8", nameEn = "Tables 7-8", cost = 3600, effect = { seats = 8, spawn = 2.5 } },
} :: { Purchase }
Economy.MAX_SEATS = 8
-- 앞에서부터 `bought`개를 산 상태의 능력치
function Economy.statsAt(bought: number): Stats
local s = Economy.START
local stats: Stats = {
seats = s.seats,
spawn = s.spawn,
cook = s.cook,
price = s.price,
helper = s.helper,
menus = table.clone(s.menus),
carry = s.carry,
stage = s.stage,
}
for i = 1, math.min(bought, #Economy.PURCHASES) do
local e = Economy.PURCHASES[i].effect
if e.seats then
stats.seats = e.seats
end
if e.spawn then
stats.spawn = e.spawn
end
if e.cook then
stats.cook = e.cook
end
if e.price then
stats.price = e.price
end
if e.helper then
stats.helper = true
end
if e.menu then
table.insert(stats.menus, e.menu)
end
if e.carry then
stats.carry = e.carry
end
if e.stage then
stats.stage = e.stage
end
end
return stats
end
-- 한 접시 값(정수). moneyMult는 2배 수익 게임패스(1 또는 2)
function Economy.dishPrice(menu: string, stats: Stats, moneyMult: number): number
return math.floor(Economy.MENUS[menu].price * stats.price) * moneyMult
end
-- 현재 능력치로 1분에 버는 돈(대략). 돈 부스트 팩 지급액 계산용
function Economy.incomePerMinute(stats: Stats): number
local total = 0
for _, m in stats.menus do
total += Economy.dishPrice(m, stats, 1)
end
local avg = total / #stats.menus
-- 손님 수는 간격과 자리 회전(식사+이동+조리) 중 느린 쪽으로 제한
local perSeat = 60 / (Economy.EAT + Economy.WALK_IN + Economy.WALK + stats.cook)
local customers = math.min(60 / stats.spawn, perSeat * stats.seats)
return math.floor(customers * avg)
end
function Economy.boostAmount(stats: Stats): number
return math.max(Economy.BOOST_MIN, Economy.incomePerMinute(stats) * Economy.BOOST_MINUTES)
end
return Economy