feat(bunsik): 메뉴별 요리 창(메뉴 고르기→2~3단계 조리→완성) + 어린이용 화면 UI 새 디자인

- 요리: 조리대 버튼 → 요리 창. 주문 있는 메뉴만 고름(서버도 검사), 메뉴마다 다른 단계
  (톡톡/꾹/문지르기, 실패 없음), 화구 업그레이드로 누르는 양 감소. Recipes(순수 로직)+Kitchen(화면)
- 서버: cook에 메뉴 인자, 조리대 거리 검사, Orders/Hand 속성, 주문 말풍선을 그림으로(받으면 하트)
- 경제: 한 접시에 손이 더 가므로 떡볶이·김밥·순대 15·25·40원, 시뮬레이터가 요리 창 시간 반영(확장 9:47)
- UI: 사탕색 테마(흰 바탕·같은 계열 테두리·숫자는 Fredoka), 버튼 묶음 정리, 상점 5x2 카드,
  마스코트 떡이 튜토리얼 말풍선, 손에 든 음식 표시, 알림 3개 제한, 움직임은 살 수 있는 것에만
- 그림: 요리 재료·도구 33칸 추가(ui_icons v2), 조리 도구·마스코트 큰 그림(kitchen.png), 톡톡 효과음
- 검사: 단위 테스트(Recipes 71, Layout 1642 등) + 로블록스 서버 통합 테스트 801/801

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 16:14:23 +09:00
parent 05848d19d6
commit 02df9101bb
36 changed files with 3432 additions and 860 deletions

View File

@@ -1,7 +1,7 @@
# 분식집 타이쿤 — 경제 수치표
목표: 첫 구매는 10초 안에, 그 뒤로는 40~90초마다 하나씩 사고, 10분 무렵 "실내 분식집 확장"(2단계)에 닿게 합니다. 2단계는 구매 간격 1.5~2.5분입니다.
숫자의 원본은 `src/shared/Economy.luau`입니다. 표의 시각은 시뮬레이터 `tools/sim.luau`가 **실제 게임 로직(`src/shared/Shop.luau`)**을 봇으로 돌려서 낸 값입니다(2026-10-12, 예전 파이썬 시뮬레이터는 게임 코드와 따로 놀 수 있어서 지웠습니다).
숫자의 원본은 `src/shared/Economy.luau`입니다. 표의 시각은 시뮬레이터 `tools/sim.luau`가 **실제 게임 로직(`src/shared/Shop.luau`)**을 봇으로 돌려서 낸 값입니다(2026-10-13 요리 창 반영, 예전 파이썬 시뮬레이터는 게임 코드와 따로 놀 수 있어서 지웠습니다).
```
lune run tools/sim.luau # 기본
@@ -16,7 +16,7 @@ lune run tests/Sim.spec.luau # 목표 범위 자동 검사(check.sh에 포함)
| 처음 테이블 수 | 1 | 동시에 앉을 수 있는 손님 수 |
| 손님 간격 | 6초 | 빈자리가 없으면 그냥 지나감. 접속하자마자 첫 손님 |
| 손님 입장 | 2.5초 | 입구에서 자리까지 걷는 시간(NPC 이동 시간과 같음) |
| 조리 시간 | 2.5초 | 조리대에서 버튼을 누르고 있는 시간 |
| 조리(화구 수준) | 2.5 | 요리 창의 누르는 횟수·시간 기준. 화구 Lv1 1.5, Lv2 1이면 같은 비율로 줄어듦(`src/shared/Recipes.luau`). 시뮬레이터는 아이가 쉬지 않고 했을 때 한 접시 4.6~5.3초(메뉴 고르기·완성 연출 포함)로 봄 |
| 왕복 시간 | 약 5초 | 조리대 → 테이블 → 조리대(시뮬레이터 가정. 게임 속 걷기 속도는 20) |
| 식사 시간 | 6초 | 다 먹으면 자리가 빔. 돈은 접시를 놓는 순간 들어옴 |
| 한 번에 드는 접시 | 1 | 쟁반 2, 큰 쟁반 3 |
@@ -26,13 +26,14 @@ lune run tests/Sim.spec.luau # 목표 범위 자동 검사(check.sh에 포함)
| 메뉴 | 한 접시 | 해금 |
|---|---|---|
| 떡볶이 🌶️ | 10 | 처음부터 |
| 김밥 🍙 | 20 | 구매 2번 |
| 순대 🌭 | 35 | 구매 6번 |
| 떡볶이 🌶️ | 15 | 처음부터 |
| 김밥 🍙 | 25 | 구매 2번 |
| 순대 🌭 | 40 | 구매 6번 |
| 어묵 🍢 | 50 | 구매 13번(2단계) |
| 튀김 🍤 | 70 | 구매 17번(2단계) |
손님은 해금된 메뉴를 돌아가며 주문합니다. 양념 비법은 모든 메뉴 가격에 배율을 곱하고 소수점은 버립니다(순대 35 × 1.5 = 52).
손님은 해금된 메뉴를 돌아가며 주문합니다. 양념 비법은 모든 메뉴 가격에 배율을 곱하고 소수점은 버립니다(김밥 25 × 1.5 = 37).
2026-10-13: 버튼을 꾹 누르던 조리를 메뉴별 요리 창(2~3단계)으로 바꾸면서 한 접시에 손이 더 가므로 1단계 메뉴 값을 10·20·35 → 15·25·40으로 올렸습니다. 확장 시점이 예전(9:39)과 비슷하게 9:47입니다.
## 구매 순서와 시점
@@ -40,28 +41,28 @@ lune run tests/Sim.spec.luau # 목표 범위 자동 검사(check.sh에 포함)
| # | 구매 | 비용 | 효과 | 도달 시각 | 2배 게임패스 |
|---|---|---|---|---|---|
| 1 | 테이블 2 | 10 | 테이블 1 → 2 | 0:05 | 0:05 |
| 2 | 김밥 해금 | 40 | 메뉴 추가(20) | 0:37 | 0:21 |
| 3 | 간판 Lv1 | 70 | 손님 간격 6 → 5초 | 1:18 | 0:37 |
| 4 | 화구 Lv1 | 90 | 조리 2.5 → 1.5초 | 2:05 | 0:59 |
| 5 | 테이블 3 | 120 | 테이블 2 → 3 | 3:05 | 1:26 |
| 6 | 순대 해금 | 160 | 메뉴 추가(35) | 4:19 | 2:07 |
| 7 | 양념 비법 Lv1 | 240 | 모든 메뉴 가격 1.5배 | 5:37 | 2:48 |
| 8 | 알바생 고용 | 360 | 알바생이 카운터에 접시를 만들어 둠, 플레이어는 나르기만 | 6:49 | 3:29 |
| 9 | 테이블 4 | 480 | 테이블 3 → 4, 손님 간격 5 → 4초 | 8:04 | 4:05 |
| 10 | 실내 분식집 확장 | 600 | 2단계: 건물, 새 업그레이드 줄 | 9:39 | 4:55 |
| 11 | 쟁반 | 700 | 접시 2개 들기 | 11:29 | 5:46 |
| 12 | 테이블 5 | 800 | 테이블 5 | 13:06 | 6:31 |
| 13 | 어묵 해금 | 950 | 메뉴 추가(50) | 15:06 | 7:31 |
| 14 | 간판 Lv2 | 1,150 | 손님 간격 4 → 3초 | 16:51 | 8:26 |
| 15 | 테이블 6 | 1,400 | 테이블 6 | 18:34 | 9:21 |
| 16 | 화구 Lv2 | 1,700 | 조리 1.5 → 1초 | 20:34 | 10:16 |
| 17 | 튀김 해금 | 2,000 | 메뉴 추가(70) | 22:59 | 11:26 |
| 18 | 양념 비법 Lv2 | 2,500 | 가격 배율 2배 | 25:20 | 12:36 |
| 19 | 큰 쟁반 | 3,000 | 접시 3개 들기 | 27:30 | 13:36 |
| 20 | 테이블 7·8 | 3,600 | 테이블 8, 손님 간격 2.5초 | 30:00 | 14:51 |
| 1 | 테이블 2 | 10 | 테이블 1 → 2 | 0:09 | 0:09 |
| 2 | 김밥 해금 | 40 | 메뉴 추가(25) | 0:43 | 0:21 |
| 3 | 간판 Lv1 | 70 | 손님 간격 6 → 5초 | 1:28 | 0:43 |
| 4 | 화구 Lv1 | 90 | 요리 창 누르는 양 60%(2.5 → 1.5) | 2:14 | 1:06 |
| 5 | 테이블 3 | 120 | 테이블 2 → 3 | 3:13 | 1:35 |
| 6 | 순대 해금 | 160 | 메뉴 추가(40) | 4:32 | 2:15 |
| 7 | 양념 비법 Lv1 | 240 | 모든 메뉴 가격 1.5배 | 6:00 | 3:05 |
| 8 | 알바생 고용 | 360 | 알바생이 카운터에 접시를 만들어 둠, 플레이어는 나르기만 | 7:27 | 3:54 |
| 9 | 테이블 4 | 480 | 테이블 3 → 4, 손님 간격 5 → 4초 | 8:27 | 4:25 |
| 10 | 실내 분식집 확장 | 600 | 2단계: 건물, 새 업그레이드 줄 | 9:47 | 5:05 |
| 11 | 쟁반 | 700 | 접시 2개 들기 | 11:12 | 5:50 |
| 12 | 테이블 5 | 800 | 테이블 5 | 12:32 | 6:27 |
| 13 | 어묵 해금 | 950 | 메뉴 추가(50) | 14:07 | 7:12 |
| 14 | 간판 Lv2 | 1,150 | 손님 간격 4 → 3초 | 15:42 | 8:02 |
| 15 | 테이블 6 | 1,400 | 테이블 6 | 17:13 | 8:47 |
| 16 | 화구 Lv2 | 1,700 | 요리 창 누르는 양 40%(1.5 → 1) | 18:57 | 9:37 |
| 17 | 튀김 해금 | 2,000 | 메뉴 추가(70) | 21:07 | 10:42 |
| 18 | 양념 비법 Lv2 | 2,500 | 가격 배율 2배 | 23:17 | 11:47 |
| 19 | 큰 쟁반 | 3,000 | 접시 3개 들기 | 25:16 | 12:47 |
| 20 | 테이블 7·8 | 3,600 | 테이블 8, 손님 간격 2.5초 | 27:32 | 13:47 |
1단계 구매 간격은 5초 → 32초 → 41초 → … → 95초, 2단계는 97~150초입니다. 비용은 한 단계에 약 1.2~1.3배씩 오릅니다.
1단계 구매 간격은 9초 → 34초 → 45초 → … → 88초, 2단계는 80~136초입니다. 비용은 한 단계에 약 1.2~1.3배씩 오릅니다.
20개를 다 사면 "2호점은 다음 업데이트에서 열려요"가 나옵니다. 오프라인 수익과 체인점(리버스)은 2차 업데이트입니다.
## 게임패스·상품과의 관계

View File

@@ -8,35 +8,40 @@
## 해 볼 것 (15~20분)
1. 튜토리얼: 노란 줄과 ⬇️ 화살표를 따라 조리대로 가서 버튼을 꾹 누르고(PC는 E 키), 접시를 손님 자리로 가져갑니다. 손님 근처에 가면 접시가 자동으로 놓입니다.
2. 돈이 생기면 아래 가운데 "다음 업그레이드" 카드의 초록 [사기] 버튼으로 삽니다. 살 수 있을 때는 버튼이 반짝이고, 오른쪽 주황 [업그레이드] 버튼에 빨간 `!` 배지가 붙습니다. [업그레이드] 버튼을 누르면 전체 목록이 열리고, 다음에 살 줄로 자동으로 내려갑니다(그 줄에서도 바로 살 수 있음).
3. 8번째 구매(알바생)부터는 알바생이 카운터(조리대 오른쪽)에 접시를 만들어 둡니다. 카운터 근처에 가면 접시를 자동으로 집습니다.
4. 10번째 구매(실내 분식집 확장)를 하면 건물이 생기고 2단계 업그레이드 10개가 열립니다.
5. 오른쪽 위 파란 톱니바퀴 [설정] 버튼을 눌러 봅니다.
1. 튜토리얼: 노란 줄과 화살표를 따라 조리대로 가서 [요리하기] 버튼(PC는 E 키)을 누릅니다. 요리 창이 열립니다.
- 손님이 주문한 메뉴 카드(손님 얼굴과 x1 표시, 통통 튀는 카드)를 누릅니다.
- 위쪽 글과 손가락 그림대로 합니다: 톡톡 누르기, 꾹 누르고 있기, 좌우로 문지르기. 창 안 어디를 눌러도 됩니다. PC는 마우스를 움직이기만 해도 문질러지고, E·스페이스 키로 톡톡·꾹도 됩니다.
- "완성!"이 뜨면 접시를 손님 자리로 가져갑니다. 손님 근처에 가면 접시가 자동으로 놓이고, 손님 말풍선이 하트로 바뀝니다.
2. 돈이 생기면 아래 가운데 막대의 [사기] 버튼으로 삽니다. 살 수 있을 때는 버튼이 초록색으로 바뀌어 둥실거리고, 분홍 [상점] 버튼에 빨간 `!`가 붙습니다. [상점]을 누르면 지금 단계 업그레이드 10개가 카드로 한 화면에 다 보입니다(다음 것은 노란 테두리, 그 카드에서도 바로 살 수 있음).
3. 메뉴마다 조리 과정이 다릅니다. 김밥(구매 2번)·순대(6번)를 사면 각각 해 봅니다. 화구 Lv1(4번)을 사면 누르는 횟수가 줄어듭니다.
4. 8번째 구매(알바생)부터는 알바생이 카운터(조리대 오른쪽)에 접시를 만들어 둡니다. 카운터 근처에 가면 접시를 자동으로 집습니다. 직접 요리해도 됩니다.
5. 10번째 구매(실내 분식집 확장)를 하면 건물이 생기고 2단계 업그레이드 10개가 열립니다.
6. 오른쪽 위 파란 톱니바퀴 [설정] 버튼을 눌러 봅니다.
- 언어: 자동(계정 언어)·한국어·English·日本語·中文 중에서 고릅니다. 이름판·메뉴판·버튼 글자가 모두 바뀝니다.
- 마우스로 화면 돌리기(PC, 기본 켜짐): 우클릭 없이 마우스만 움직여도 화면이 돕니다. 버튼을 누를 땐 Ctrl을 누르고 있거나, 업그레이드·설정 창을 열면 커서가 나옵니다.
- 마우스로 화면 돌리기(PC, 기본 켜짐): 우클릭 없이 마우스만 움직여도 화면이 돕니다. 버튼을 누를 땐 Ctrl을 누르고 있거나, 상점·설정·요리 창을 열면 커서가 나옵니다.
- 효과음 켜기/끄기.
6. 김밥 해금을 사면: 포장마차 왼쪽에 김밥 진열대(김발·김밥 접시)가 반짝이며 생기고, 1초쯤 뒤 오는 손님이 김밥을 주문합니다. 메뉴판에도 김밥이 추가됩니다.
7. 옆 가게: 다른 부지에는 이웃 가게(NPC 사장님이 운영, 크기가 제각각)가 열려 있습니다. 다른 플레이어가 들어오면 그 자리는 그 사람 가게로 바뀝니다.
7. 김밥 해금을 사면: 포장마차 왼쪽에 김밥 진열대(김발·김밥 접시)가 반짝이며 생기고, 1초쯤 뒤 오는 손님이 김밥을 주문합니다. 메뉴판에도 김밥이 추가됩니다.
8. 옆 가게: 다른 부지에는 이웃 가게(NPC 사장님이 운영, 크기가 제각각)가 열려 있습니다. 다른 플레이어가 들어오면 그 자리는 그 사람 가게로 바뀝니다.
- 다른 가게 입구(이름판 아래)에서 E(휴대폰은 버튼)를 누르면 손님으로 빈자리에 앉습니다. 음식이 나오면 처음 한 번은 시식 보너스(접시 값)를 내 가게 돈으로 받습니다(1분에 한 번). 점프하면 일어납니다.
- 내 가게에 다른 플레이어가 손님으로 오면 알림이 뜨고, 그 손님 접시는 2배 값을 받습니다.
8. 나갔다가 다시 들어와서 돈·업그레이드·설정이 그대로인지 봅니다.
9. 나갔다가 다시 들어와서 돈·업그레이드·설정이 그대로인지 봅니다.
## 휴대폰에서 해 볼 것
휴대폰·태블릿은 화면을 가로로 두고 합니다. 화면을 터치하면 휴대폰 배치로 바뀝니다.
- 왼쪽 위: 보라 [2배 수익], 노랑 [돈 부스트]. 왼쪽 아래 조이스틱 자리와 겹치지 않게 위로 올렸습니다.
- 오른쪽 위: 파랑 [설정], 주황 [업그레이드]. 오른쪽 아래 점프 버튼 자리는 비워 두었습니다.
- 아래: 다음 업그레이드 카드. [사기] 버튼은 조이스틱과 점프 버튼 사이에 옵니다.
- 왼쪽 위: 분홍 [상점], 보라 [2배 돈], 주황 [부스트]가 한 줄로. 왼쪽 아래 조이스틱 자리와 겹치지 않게 위로 올렸습니다.
- 가운데 위: 돈. 오른쪽 위: 파랑 톱니바퀴(설정). 오른쪽 아래 점프 버튼 자리는 비워 두었습니다.
- 아래: 다음 업그레이드 막대. [사기] 버튼은 조이스틱과 점프 버튼 사이에 옵니다. 막대 바로 위에 손에 든 음식 그림이 보입니다.
- 요리 창은 화면을 거의 다 채웁니다. 문지르기를 할 때 캐릭터가 움직이지 않는지 봐 주세요.
- 설정 창에는 마우스 회전 줄이 없습니다(휴대폰에는 필요 없음).
- 조이스틱으로 걸을 때 버튼이 눌리지 않는지, 글자가 너무 작지 않은지 봐 주세요.
## 새 화면 UI에서 봐 줄 것
## 새 화면 UI에서 봐 줄 것(2026-10-13 처음부터 다시 디자인)
- 버튼을 누르면 쏙 들어갔다 나오는지, PC에서 마우스를 올리면 살짝 커지는지
- 돈을 벌면 돈 표시가 통 튀고 아래에 초록 `+돈` 글자가 떠오르는지
- 업그레이드·설정 창이 튀어나오듯 열리고 뒤 화면이 어두워지는지
- 아이콘(동전, 메뉴 음식, 테이블 등)이 깨지거나 빈 네모로 나오지 않는지
- 늘 보이는 것은 돈, 버튼 묶음(상점·2배 돈·부스트), 설정, 다음 업그레이드 막대, 손에 든 음식뿐입니다. 덜 어지러운지
- 색(분홍·노랑·민트·하늘·보라 사탕색)과 둥근 모양이 아이들 취향에 맞는지
- 요리 창 그림(팬·도마·찜기·냄비·튀김기, 마스코트 떡이)과 재료가 쌓이는 모습이 자연스러운지
- 아이콘·그림이 깨지거나 빈 네모로 나오지 않는지
- 글자가 버튼 밖으로 넘치거나 너무 작은 곳이 없는지(영어·일본어·중국어도)
## 개발자 테스트 버튼(주인 계정에만 보임)

View File

@@ -91,15 +91,22 @@
- 소셜(MVP): 남의 가게에 걸어 들어가 구경할 수 있고, 친구와 같은 서버에서 놉니다.
- 소셜(2차): 친구 가게의 손님이 되어 주문하기, 친구를 직원으로 고용하기.
### B. 요리 조작: 누르고 있기 + 들고 가서 내려놓기
1. 조리대에 다가가면 "떡볶이 만들기" 버튼이 뜹니다(로블록스 기본 ProximityPrompt). PC는 E키, 모바일은 화면 터치.
2. 버튼을 2.5초 누르고 있으면 완성됩니다. 게이지가 차고, 지글지글 조리음이 납니다(쇼츠용 ASMR 포인트).
3. 완성된 접시를 손에 들고 주문한 손님 테이블에 가면 자동으로 놓입니다.
4. 손님이 먹고 돈을 내면 동전이 튀어나오고 "+10" 숫자가 뜹니다.
- 타이밍 맞추기는 넣지 않습니다. 어린 아이가 실패하면 바로 그만두기 때문입니다.
- 손님 머리 위 말풍선에 메뉴 그림을 띄워서 글을 못 읽어도 알 수 있게 합니다.
- 처음 접속하면 화살표가 조리대 → 손님 순서로 안내합니다. 첫 서빙까지 30초 안이 목표입니다.
- "화구" 업그레이드로 누르는 시간이 짧아지고, "알바생"을 고용하면 조리가 자동이 됩니다.
### B. 요리 조작: 요리 창(메뉴 고르기 → 메뉴별 조리 과정 → 완성) + 들고 가서 내려놓기
2026-10-13 사용자 요청으로 "버튼 꾹 누르기"에서 바꿨습니다. 코드는 `src/shared/Recipes.luau`(과정·진행 상태), `src/client/Kitchen.luau`(화면).
1. 조리대에 다가가 버튼(PC는 E키, 휴대폰은 터치)을 누르면 요리 창이 열립니다. 창이 열린 동안은 캐릭터가 움직이지 않습니다.
2. 메뉴 고르기: 해금된 메뉴 카드에 손님 얼굴과 주문 수(x2)가 붙고 통통 튑니다. 주문이 없는 메뉴는 흐리게, 안 산 메뉴는 자물쇠입니다.
- 주문 없는 메뉴는 고를 수 없습니다. 아무도 안 시킨 접시를 들고 갇히는 일을 막기 위해서입니다(서버도 같은 규칙으로 검사).
3. 조리: 메뉴마다 2~3단계이고, 단계마다 조작이 다릅니다. 창 안 어디를 눌러도 되고 실패는 없습니다.
- 떡볶이(팬): 떡 넣기(톡톡) → 양념 붓기(꾹) → 젓기(문지르기)
- 김밥(도마): 재료 올리기(톡톡) → 말기(문지르기) → 썰기(톡톡)
- 순대(찜기): 넣기(톡톡) → 찌기(꾹) → 썰기(톡톡)
- 어묵(냄비): 꼬치에 끼우기(톡톡) → 국물에 담그기(꾹)
- 튀김(튀김기): 튀김옷(문지르기) → 튀기기(꾹) → 건지기(톡톡)
- 단계 표시는 글 대신 도구 그림 동그라미 1-2-3, 손가락 그림이 할 동작(톡톡·꾹·좌우로 문지르기)을 보여 줍니다. 누를 때마다 재료가 쌓이고 효과음이 납니다.
4. 완성: 접시가 튀어나오고 마스코트 떡이가 기뻐합니다. 주문이 남고 손에 자리가 있으면 바로 다음 메뉴 고르기, 아니면 창이 닫힙니다.
5. 완성된 접시를 손에 들고 주문한 손님 테이블에 가면 자동으로 놓입니다. 손님 머리 위 말풍선은 음식 그림이고, 받으면 하트로 바뀝니다.
- 다른 게임과 비교해 정한 것: Papa's 시리즈·Cooking Mama처럼 단계마다 다른 짧은 동작을 쓰되, 어린아이가 실패하면 그만두므로 태우기·시간 제한은 넣지 않았습니다(Restaurant Tycoon 2도 실패 없음). 한 접시 4~6초로 짧게 하고, 반복이 지루해지지 않게 "화구" 업그레이드가 누르는 양을 60%·40%로 줄이고 "알바생"이 자동으로 만들어 줍니다.
- 한 접시에 손이 더 가므로 1단계 메뉴 값을 올렸습니다(`ECONOMY.md`).
### C. 경제 수치
- 첫 10분 표: `ECONOMY.md`. 첫 구매 0:05, 10번째 구매(실내 확장) 9:39.

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 301 KiB

BIN
bunsik-tycoon/sfx/pop.ogg Normal file

Binary file not shown.

View File

@@ -1,8 +1,11 @@
--!strict
-- 튜토리얼 화살표: 캐릭터에서 목표(조리대, 손님 자리)까지 빛나는 줄과 위에서 통통 튀는 화살표.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Icons = require(ReplicatedStorage:WaitForChild("Shared"):WaitForChild("Icons"))
local Guide = {}
function Guide.start(player: Player)
@@ -26,11 +29,10 @@ function Guide.start(player: Player)
arrow.Size = UDim2.fromOffset(70, 70)
arrow.AlwaysOnTop = true
arrow.LightInfluence = 0
local label = Instance.new("TextLabel")
local label = Instance.new("ImageLabel")
label.Size = UDim2.fromScale(1, 1)
label.BackgroundTransparency = 1
label.Text = "⬇️"
label.TextScaled = true
Icons.apply(label, "arrowDown")
label.Parent = arrow
RunService.RenderStepped:Connect(function()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,9 @@
-- 화면 UI 배치 계산(로블록스 서비스 없이 숫자만 다룸, lune 단위 테스트로 검사).
-- 입력은 UI가 쓸 수 있는 화면 크기(상단 바·노치를 뺀 안전 영역, 픽셀)와 터치 화면 여부입니다.
-- 결과 좌표는 기준 단위이고, 화면 픽셀 = 기준 단위 × scale 입니다.
-- 배치 원칙(어지럽지 않게): 늘 보이는 것은 7개뿐 — 돈(위 가운데), 버튼 3개(상점·2배·부스트)는 한 묶음,
-- 설정(오른쪽 위), 다음 업그레이드 막대(아래 가운데), 손에 든 접시(막대 바로 위). 나머지는 창으로 엽니다.
-- PC는 버튼 묶음을 왼쪽에 세로로, 휴대폰은 왼쪽 위에 가로로 둡니다.
-- 터치 화면에서는 로블록스 기본 조이스틱 자리(왼쪽 40% × 아래 2/3)와 점프 버튼 자리(오른쪽 아래)에
-- 누르는 버튼을 두지 않습니다. 두 자리의 크기는 로블록스 PlayerModule(TouchJump, DynamicThumbstick)에서 가져왔습니다.
@@ -9,6 +12,8 @@ local Layout = {}
export type Rect = { x: number, y: number, w: number, h: number }
export type Grid = { cols: number, rows: number, pad: number, gap: number, top: number, cardW: number, cardH: number }
export type Result = {
scale: number,
width: number, -- 기준 단위 화면 너비
@@ -18,14 +23,16 @@ export type Result = {
carry: Rect,
hint: Rect,
toasts: Rect,
card: Rect,
buy: Rect, -- 카드 안의 [사기] 버튼(화면 기준 위치)
card: Rect, -- 다음 업그레이드 막대
buy: Rect, -- 막대 안의 [사기] 버튼(화면 기준 위치)
settings: Rect,
list: Rect,
list: Rect, -- 상점(업그레이드) 버튼
double: Rect,
boost: Rect,
panel: Rect,
panel: Rect, -- 상점 창
grid: Grid, -- 상점 창 안 카드 배치(창 기준)
settingsPanel: Rect,
kitchen: Rect, -- 요리 창
-- 설정 창 안쪽 줄(설정 창 기준 y)
rows: {
langButtonH: number,
@@ -38,10 +45,10 @@ export type Result = {
},
}
local CARD_W, CARD_H = 500, 112
local CARD_TAB = 16 -- 카드 위로 튀어나온 "다음 업그레이드" 이름표 높이(카드 사각형 안)
local BUY_W, BUY_H = 140, 70
local PANEL_W = 540
Layout.HEADER_H = 58 -- 창 위쪽 색 띠 높이(Theme.panel과 같음)
local CARD_W, CARD_H = 470, 84
local BUY_W, BUY_H = 132, 64
local function rect(x: number, y: number, w: number, h: number): Rect
return { x = x, y = y, w = w, h = h }
@@ -71,30 +78,27 @@ function Layout.compute(w: number, h: number, touch: boolean, dev: boolean): Res
local W, H = w / s, h / s
local cx = W / 2
-- 돈: 왼쪽에 동전 아이콘이 튀어나온 알약 모양
local money = rect(cx - 160, 6, 320, 64)
local carry = rect(cx - 60, 74, 120, 30)
-- 네모 아이콘 버튼(아이콘 위, 이름 아래)
local settings, list, double, boost
local hintW
local money, settings, list, double, boost, hint
if touch then
-- 왼쪽 위: 2배 수익, 돈 부스트(조이스틱 자리 H/3 위쪽). 오른쪽 위: 설정, 업그레이드 목록.
double = rect(8, 6, 84, 84)
boost = rect(100, 6, 84, 84)
list = rect(W - 92, 6, 84, 84)
settings = rect(W - 92 - 76, 6, 68, 68)
hintW = math.min(640, W - 2 * 196)
money = rect(cx - 125, 6, 250, 54)
list = rect(8, 6, 84, 84)
double = rect(100, 10, 76, 76)
boost = rect(184, 10, 76, 76)
settings = rect(W - 72, 6, 64, 64)
local hintW = math.min(600, W - 40)
hint = rect(cx - hintW / 2, 98, hintW, 72)
else
settings = rect(W - 78, 6, 68, 68)
list = rect(W - 110, H / 2 - 50, 100, 100)
double = rect(10, H / 2 - 112, 100, 100)
boost = rect(10, H / 2 + 12, 100, 100)
hintW = 640
money = rect(cx - 140, 8, 280, 58)
settings = rect(W - 70, 8, 60, 60)
local top = H / 2 - 170
list = rect(12, top, 96, 96)
double = rect(18, top + 96 + 20, 84, 84)
boost = rect(18, top + 96 + 20 + 84 + 30, 84, 84) -- 위에 "+금액" 꼬리표가 붙어서 더 띄움
local hintW = math.min(620, W - 2 * 130)
hint = rect(cx - hintW / 2, 76, hintW, 72)
end
local hint = rect(cx - hintW / 2, 110, hintW, 58)
-- 아래 카드: 터치 화면에서는 점프 버튼 왼쪽까지 밀어 둡니다.
-- 아래 막대: 터치 화면에서는 점프 버튼 왼쪽까지 밀어 둡니다.
local cardX = cx - CARD_W / 2
if touch then
local zones = Layout.touchZones(w, h)
@@ -102,33 +106,53 @@ function Layout.compute(w: number, h: number, touch: boolean, dev: boolean): Res
end
cardX = math.max(cardX, 10)
local card = rect(cardX, H - 8 - CARD_H, CARD_W, CARD_H)
local bodyH = CARD_H - CARD_TAB
local buy = rect(card.x + CARD_W - 12 - BUY_W, card.y + CARD_TAB + (bodyH - BUY_H) / 2, BUY_W, BUY_H)
local buy = rect(card.x + CARD_W - 10 - BUY_W, card.y + (CARD_H - BUY_H) / 2, BUY_W, BUY_H)
local carry = rect(card.x + CARD_W / 2 - 90, card.y - 48, 180, 42)
local toastsW = math.min(560, hintW)
local toasts = rect(cx - toastsW / 2, 176, toastsW, math.max(0, card.y - 6 - 176))
local toastsTop = hint.y + hint.h + 8
local toastsW = math.min(480, hint.w)
local toasts = rect(cx - toastsW / 2, toastsTop, toastsW, math.max(0, carry.y - 6 - toastsTop))
local panelH = math.min(450, H - 12)
local panel = rect(cx - PANEL_W / 2, math.max(6, H * 0.48 - panelH / 2), PANEL_W, panelH)
-- 상점 창: 지금 단계 업그레이드 10개를 5x2 카드로(넘기지 않아도 다 보임)
local pw = if touch then math.min(820, W - 24) else 740
local ph = math.min(if touch then 392 else 440, H - 12)
local panel = rect(cx - pw / 2, math.max(6, H * 0.5 - ph / 2), pw, ph)
local pad, gap = 16, 10
local top = Layout.HEADER_H + 12
local grid: Grid = {
cols = 5,
rows = 2,
pad = pad,
gap = gap,
top = top,
cardW = (pw - 2 * pad - 4 * gap) / 5,
cardH = (ph - top - pad - gap) / 2,
}
-- 설정 창 줄: 제목(10~54), 언어 이름(64), 언어 버튼(100~), 마우스(PC만), 효과음, 개발자(주인만)
-- 설정 창 줄: 제목 띠(0~58), 언어 이름(70), 언어 버튼(106~), 마우스(PC만), 효과음, 개발자(주인만)
local langButtonH = if touch then 52 else 44
local toggleH = if touch then 48 else 40
local y = 104 + langButtonH + 16
local toggleH = if touch then 50 else 42
local y = 106 + langButtonH + 18
local mouseY: number? = nil
if not touch then
mouseY = y
y += 92
y += toggleH + 40
end
local sfxY = y
y += toggleH + 14
y += toggleH + 16
local devY: number? = nil
if dev then
devY = y
y += 34 + toggleH + 14
y += 36 + toggleH + 16
end
local setH = y + 8
local settingsPanel = rect(cx - PANEL_W / 2, math.max(6, H * 0.48 - setH / 2), PANEL_W, setH)
local setW = 560
local setH = math.min(y + 8, H - 12)
local settingsPanel = rect(cx - setW / 2, math.max(6, H * 0.5 - setH / 2), setW, setH)
-- 요리 창: 휴대폰은 거의 화면 가득
local kw = if touch then math.min(880, W - 16) else 800
local kh = math.min(if touch then 396 else 480, H - 8)
local kitchen = rect(cx - kw / 2, math.max(4, H * 0.5 - kh / 2), kw, kh)
return {
scale = s,
@@ -146,7 +170,9 @@ function Layout.compute(w: number, h: number, touch: boolean, dev: boolean): Res
double = double,
boost = boost,
panel = panel,
grid = grid,
settingsPanel = settingsPanel,
kitchen = kitchen,
rows = {
langButtonH = langButtonH,
mouseY = mouseY,
@@ -154,7 +180,7 @@ function Layout.compute(w: number, h: number, touch: boolean, dev: boolean): Res
toggleH = toggleH,
devY = devY,
devButtonH = toggleH,
closeH = if touch then 52 else 46,
closeH = if touch then 50 else 48, -- 창 제목 띠(58) 안에 들어가는 크기
},
}
end

View File

@@ -93,7 +93,29 @@ local plotIndex = player:GetAttribute("Plot")
local world = workspace:WaitForChild("BunsikWorld")
local plot = world:WaitForChild("Plots"):WaitForChild("Plot" .. tostring(plotIndex))
local stove = plot:WaitForChild("Base"):WaitForChild("Stall"):WaitForChild("Stove") :: BasePart
Stove.attach(stove, player, send)
Stove.attach(stove, player, function()
hud.open("kitchen")
end)
-- 요리 창이 열려 있는 동안은 캐릭터가 움직이지 않게(휴대폰에서 문지르다 조이스틱이 움직이지 않게) 조작을 멈추고,
-- 조리대 버튼(E)도 꺼서 E 키를 요리 동작(톡톡·꾹)에 씁니다.
local ProximityPromptService = game:GetService("ProximityPromptService")
local controls: any = nil
pcall(function()
local PlayerModule = require(player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")) :: any
controls = PlayerModule:GetControls()
end)
hud.kitchen.onOpen(function()
ProximityPromptService.Enabled = false
if controls then
controls:Disable()
end
end)
hud.kitchen.onClose(function()
ProximityPromptService.Enabled = true
if controls then
controls:Enable()
end
end)
Plots.start(world:WaitForChild("Plots"), player, player.UserId, send)
Guide.start(player)

View File

@@ -1,57 +1,35 @@
--!strict
-- 내 가게 조리대에만 "요리하기" 버튼(ProximityPrompt)을 만듭니다. 다른 사람 가게에서는 버튼이 안 보입니다.
-- 서버가 조리대 속성(CookMenu, CookTime)으로 알려 준 상태를 그대로 보여 주고, 다 누르면 서버에 "cook"을 보냅니다.
-- 버튼을 누르면(PC는 E 키) 요리 창(Kitchen)이 열리고, 메뉴를 골라 조리 과정을 마치면 창이 서버에 "cook"을 보냅니다.
-- 서버가 조리대 속성(CookMenu: 만들 주문이 있으면 메뉴 키, HandFull)으로 알려 준 상태에 따라 버튼을 켜고 끕니다.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Shared = ReplicatedStorage:WaitForChild("Shared")
local Economy = require(Shared:WaitForChild("Economy"))
local Locale = require(Shared:WaitForChild("Locale"))
local Sounds = require(Shared:WaitForChild("Sounds"))
local Stove = {}
function Stove.attach(stove: BasePart, state: Instance, send: (string, any?) -> ()): ProximityPrompt
function Stove.attach(stove: BasePart, state: Instance, openKitchen: () -> ()): ProximityPrompt
local prompt = Instance.new("ProximityPrompt")
prompt.Name = "CookPrompt"
prompt.KeyboardKeyCode = Enum.KeyCode.E
prompt.MaxActivationDistance = 10
prompt.RequiresLineOfSight = false
prompt.HoldDuration = 0
prompt.Exclusivity = Enum.ProximityPromptExclusivity.OneGlobally
local sizzle = Instance.new("Sound")
sizzle.SoundId = Sounds.SIZZLE
sizzle.Volume = 0.6
sizzle.Looped = true
sizzle.SoundGroup = game:GetService("SoundService"):FindFirstChild("Sfx") :: SoundGroup?
sizzle.Parent = stove
local function refresh()
local lang = (state:GetAttribute("Lang") :: string?) or "ko"
local menu = stove:GetAttribute("CookMenu")
prompt.HoldDuration = (stove:GetAttribute("CookTime") :: number?) or 2.5
prompt.ObjectText = Locale.t(lang, "stoveObject")
if typeof(menu) == "string" and Economy.MENUS[menu] then
local m = Economy.MENUS[menu]
prompt.ActionText = `{m.icon} ` .. Locale.t(lang, "cookAction", { menu = Locale.menuName(lang, menu) })
prompt.Enabled = true
else
prompt.Enabled = false
end
prompt.ActionText = Locale.t(lang, "cookAction")
prompt.Enabled = typeof(menu) == "string" and menu ~= ""
end
stove.AttributeChanged:Connect(refresh)
state:GetAttributeChangedSignal("Lang"):Connect(refresh)
prompt.PromptButtonHoldBegan:Connect(function()
sizzle:Play()
end)
prompt.PromptButtonHoldEnded:Connect(function()
sizzle:Stop()
end)
prompt.Triggered:Connect(function()
sizzle:Stop()
send("cook")
end)
prompt.Triggered:Connect(openKitchen)
refresh()
prompt.Parent = stove
return prompt

View File

@@ -1,6 +1,9 @@
--!strict
-- 화면 UI 꾸미기 도구: 색, 굵은 테두리, 위아래 그러데이션, 입체 버튼(아래 그림자 판), 반짝 지나가는 빛,
-- 누르면 쏙 들어가는 애니메이션, 아이콘. 인기 시뮬레이터·타이쿤 게임의 "굵은 테두리 + 흰 글자" 스타일을 따릅니다.
-- 화면 UI 꾸미기 도구("사탕" 스타일): 밝은 색, 아주 둥근 모서리, 같은 계열의 진한 테두리, 누르면 쏙 들어가는 입체 버튼.
-- 규칙(어지럽지 않게):
-- - 바탕은 흰색·크림색, 색은 버튼마다 하나만. 테두리와 글자 외곽선은 그 색을 진하게 한 색.
-- - 글꼴은 두 가지: 숫자·영어는 둥근 Fredoka(NUM), 한국어 등 글은 굵은 글꼴(FONT, 한글은 로블록스 기본 한글 글꼴로 대체됨).
-- - 계속 움직이는 효과는 "지금 누를 수 있는 것"(살 수 있는 업그레이드 등)에만 씁니다.
-- 트윈만 쓰고 RenderStepped는 쓰지 않아서 서버(원격 테스트)에서도 만들 수 있습니다.
local TweenService = game:GetService("TweenService")
@@ -10,22 +13,23 @@ local Icons = require(ReplicatedStorage:WaitForChild("Shared"):WaitForChild("Ico
local Theme = {}
Theme.INK = Color3.fromRGB(59, 30, 18) -- 테두리·글자 외곽선(진한 갈색)
Theme.CREAM = Color3.fromRGB(255, 246, 228)
Theme.TEXT = Color3.fromRGB(84, 52, 80) -- 흰 바탕 위 글자(진한 자두색)
Theme.SOFT = Color3.fromRGB(150, 120, 145) -- 흐린 글자
Theme.WHITE = Color3.new(1, 1, 1)
Theme.BROWN = Color3.fromRGB(120, 72, 40)
Theme.CREAM = Color3.fromRGB(255, 248, 238)
Theme.LINE = Color3.fromRGB(240, 222, 214) -- 흰 바탕 위 얇은 칸 선
-- 버튼 색(위쪽 밝은 색). 아래쪽·그림자 판은 자동으로 어둡게 만듭니다.
Theme.RED = Color3.fromRGB(255, 84, 64)
Theme.ORANGE = Color3.fromRGB(255, 150, 40)
Theme.YELLOW = Color3.fromRGB(255, 205, 50)
Theme.GREEN = Color3.fromRGB(110, 225, 60)
Theme.BLUE = Color3.fromRGB(70, 175, 255)
Theme.PURPLE = Color3.fromRGB(180, 100, 255)
Theme.GRAY = Color3.fromRGB(175, 175, 180)
Theme.NAVY = Color3.fromRGB(40, 48, 80)
Theme.PINK = Color3.fromRGB(255, 94, 132) -- 대표 색(떡볶이)
Theme.YELLOW = Color3.fromRGB(255, 196, 48)
Theme.MINT = Color3.fromRGB(46, 204, 128)
Theme.SKY = Color3.fromRGB(74, 172, 255)
Theme.LAVENDER = Color3.fromRGB(158, 116, 255)
Theme.ORANGE = Color3.fromRGB(255, 140, 50)
Theme.GRAY = Color3.fromRGB(184, 178, 196)
Theme.RED = Color3.fromRGB(255, 76, 76)
Theme.FONT = Font.new("rbxasset://fonts/families/FredokaOne.json", Enum.FontWeight.Bold)
Theme.FONT = Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Heavy)
Theme.NUM = Font.new("rbxasset://fonts/families/FredokaOne.json", Enum.FontWeight.Bold)
function Theme.darken(c: Color3, k: number): Color3
return c:Lerp(Color3.new(0, 0, 0), k)
@@ -35,6 +39,11 @@ function Theme.lighten(c: Color3, k: number): Color3
return c:Lerp(Color3.new(1, 1, 1), k)
end
-- 그 색의 테두리·글자 외곽선 색
function Theme.edge(c: Color3): Color3
return c:Lerp(Color3.fromRGB(60, 20, 50), 0.55)
end
function Theme.corner(parent: Instance, r: number, scale: number?): UICorner
local c = Instance.new("UICorner")
c.CornerRadius = UDim.new(scale or 0, r)
@@ -42,6 +51,10 @@ function Theme.corner(parent: Instance, r: number, scale: number?): UICorner
return c
end
function Theme.round(parent: Instance): UICorner
return Theme.corner(parent, 0, 0.5)
end
function Theme.stroke(parent: Instance, color: Color3, thickness: number, contextual: boolean?): UIStroke
local s = Instance.new("UIStroke")
s.Color = color
@@ -52,7 +65,7 @@ function Theme.stroke(parent: Instance, color: Color3, thickness: number, contex
return s
end
-- 위(밝음) → 아래(어두움) 그러데이션. 배경색은 흰색으로 두고 색은 그러데이션이 냅니다.
-- 위(밝음) → 아래 그러데이션. 배경색은 흰색으로 두고 색은 그러데이션이 냅니다.
function Theme.gradient(parent: GuiObject, top: Color3, bottom: Color3): UIGradient
local g = parent:FindFirstChildOfClass("UIGradient") or Instance.new("UIGradient")
g.Color = ColorSequence.new(top, bottom)
@@ -72,19 +85,21 @@ function Theme.frame(parent: Instance, name: string, color: Color3?): Frame
return f
end
-- 흰 글자 + 진한 테두리(기본). dark=true면 진한 갈색 글자(밝은 바탕용).
function Theme.text(parent: Instance, name: string, dark: boolean?, strokeK: number?): TextLabel
-- 글자. outline을 주면 흰 글자 + 그 색 외곽선(색 바탕용), 없으면 진한 자두색 글자(흰 바탕용).
function Theme.text(parent: Instance, name: string, outline: Color3?, numeric: boolean?): TextLabel
local t = Instance.new("TextLabel")
t.Name = name
t.BackgroundTransparency = 1
t.FontFace = Theme.FONT
t.FontFace = if numeric then Theme.NUM else Theme.FONT
t.TextScaled = true
t.TextWrapped = true
t.AutoLocalize = false
t.Text = ""
t.TextColor3 = if dark then Theme.INK else Theme.WHITE
if not dark then
Theme.stroke(t, Theme.INK, strokeK or 2.5, true)
if outline then
t.TextColor3 = Theme.WHITE
Theme.stroke(t, outline, 2.5, true)
else
t.TextColor3 = Theme.TEXT
end
t.Parent = parent
return t
@@ -100,32 +115,23 @@ function Theme.icon(parent: Instance, name: string, icon: string): ImageLabel
return i
end
function Theme.kitchen(parent: Instance, name: string, art: string): ImageLabel
local i = Instance.new("ImageLabel")
i.Name = name
i.BackgroundTransparency = 1
i.ScaleType = Enum.ScaleType.Fit
Icons.applyKitchen(i, art)
i.Parent = parent
return i
end
Theme.setIcon = Icons.apply
-- 반짝 지나가는 빛: 같은 모양(둥근 모서리)의 흰 판 위에서 투명도 그러데이션이 왼쪽→오른쪽으로 지나갑니다.
function Theme.shine(face: GuiObject, radius: number, period: number): Tween
local s = Theme.frame(face, "Shine", Theme.WHITE)
s.Size = UDim2.fromScale(1, 1)
s.ZIndex = 6
Theme.corner(s, radius)
local g = Instance.new("UIGradient")
g.Rotation = 20
g.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1),
NumberSequenceKeypoint.new(0.42, 1),
NumberSequenceKeypoint.new(0.5, 0.45),
NumberSequenceKeypoint.new(0.58, 1),
NumberSequenceKeypoint.new(1, 1),
})
g.Offset = Vector2.new(-1, 0)
g.Parent = s
local tw = TweenService:Create(
g,
TweenInfo.new(0.7, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, false, period),
{ Offset = Vector2.new(1, 0) }
)
tw:Play()
return tw
-- 가운데 기준 배치(scale 좌표). 아이콘·그림 놓을 때 씁니다.
function Theme.place(o: GuiObject, x: number, y: number, w: number, h: number)
o.AnchorPoint = Vector2.new(0.5, 0.5)
o.Position = UDim2.fromScale(x, y)
o.Size = UDim2.fromScale(w, h)
end
export type Button = {
@@ -134,12 +140,13 @@ export type Button = {
base: Frame, -- 아래 그림자 판(입체감)
scale: UIScale,
setColor: (Color3) -> (),
color: () -> Color3,
}
-- 입체 버튼: 아래로 DEPTH만큼 어두운 판이 보이고, 누르면 윗면이 내려가며 살짝 작아집니다.
-- 입체 버튼: 아래로 DEPTH만큼 진한 판이 보이고, 누르면 윗면이 내려가며 살짝 작아집니다.
local DEPTH = 5
function Theme.button(parent: Instance, name: string, color: Color3, radius: number, strokeK: number?): Button
function Theme.button(parent: Instance, name: string, color: Color3, radius: number?): Button
local b = Instance.new("TextButton")
b.Name = name
b.BackgroundTransparency = 1
@@ -150,38 +157,51 @@ function Theme.button(parent: Instance, name: string, color: Color3, radius: num
local scale = Instance.new("UIScale")
scale.Parent = b
local base = Theme.frame(b, "Base", Theme.darken(color, 0.45))
local base = Theme.frame(b, "Base", color)
base.Size = UDim2.new(1, 0, 1, -DEPTH)
base.Position = UDim2.fromOffset(0, DEPTH)
Theme.corner(base, radius)
Theme.stroke(base, Theme.INK, strokeK or 3)
local face = Theme.frame(b, "Face", Theme.WHITE)
face.Size = UDim2.new(1, 0, 1, -DEPTH)
face.ZIndex = 2
Theme.corner(face, radius)
Theme.stroke(face, Theme.INK, strokeK or 3)
for _, f in { base, face } do
if radius then
Theme.corner(f, radius)
else
Theme.round(f)
end
end
local baseStroke = Theme.stroke(base, color, 3)
local faceStroke = Theme.stroke(face, color, 3)
-- 윗부분 반사광(흰 반투명 띠)
local gloss = Theme.frame(face, "Gloss", Theme.WHITE)
gloss.BackgroundTransparency = 0.72
gloss.Size = UDim2.new(1, -10, 0.36, 0)
gloss.Position = UDim2.fromOffset(5, 4)
gloss.BackgroundTransparency = 0.6
gloss.AnchorPoint = Vector2.new(0.5, 0)
gloss.Size = UDim2.new(1, -16, 0.3, 0)
gloss.Position = UDim2.new(0.5, 0, 0, 4)
gloss.ZIndex = 3
Theme.corner(gloss, math.max(4, radius - 4))
if radius then
Theme.corner(gloss, math.max(6, radius - 6))
else
Theme.round(gloss)
end
local current = color
local function setColor(c: Color3)
Theme.gradient(face, Theme.lighten(c, 0.12), Theme.darken(c, 0.12))
base.BackgroundColor3 = Theme.darken(c, 0.45)
current = c
Theme.gradient(face, Theme.lighten(c, 0.18), c)
base.BackgroundColor3 = Theme.darken(c, 0.3)
baseStroke.Color = Theme.edge(c)
faceStroke.Color = Theme.edge(c)
end
setColor(color)
local down = false
local hover = false
local function animate()
local target = if down then 0.92 elseif hover then 1.06 else 1
local target = if down then 0.92 elseif hover then 1.05 else 1
TweenService:Create(
scale,
TweenInfo.new(if down then 0.06 else 0.18, if down then Enum.EasingStyle.Quad else Enum.EasingStyle.Back),
TweenInfo.new(if down then 0.06 else 0.2, if down then Enum.EasingStyle.Quad else Enum.EasingStyle.Back),
{ Scale = target }
):Play()
face.Position = UDim2.fromOffset(0, if down then DEPTH - 1 else 0)
@@ -207,24 +227,143 @@ function Theme.button(parent: Instance, name: string, color: Color3, radius: num
animate()
end)
return { button = b, face = face, base = base, scale = scale, setColor = setColor }
return {
button = b,
face = face,
base = base,
scale = scale,
setColor = setColor,
color = function()
return current
end,
}
end
-- 아이콘 버튼: 둥근 네모 안에 큰 아이콘, 아래에 짧은 이름(테두리에 걸침)
function Theme.iconButton(parent: Instance, name: string, color: Color3, icon: string): (Button, TextLabel, ImageLabel)
local b = Theme.button(parent, name, color, 22)
local ic = Theme.icon(b.face, "Icon", icon)
ic.AnchorPoint = Vector2.new(0.5, 0.5)
ic.Position = UDim2.fromScale(0.5, 0.44)
ic.Size = UDim2.fromScale(0.72, 0.72)
ic.ZIndex = 4
local label = Theme.text(b.button, "Label", Theme.edge(color))
label.AnchorPoint = Vector2.new(0.5, 1)
label.Position = UDim2.new(0.5, 0, 1, 2)
label.Size = UDim2.fromScale(1.1, 0.3)
label.ZIndex = 5
return b, label, ic
end
-- 글자 버튼
function Theme.textButton(parent: Instance, name: string, color: Color3, radius: number?): (Button, TextLabel)
local b = Theme.button(parent, name, color, radius)
local label = Theme.text(b.face, "Label", Theme.edge(color))
label.Size = UDim2.new(1, -18, 0.62, 0)
label.Position = UDim2.fromScale(0.5, 0.5)
label.AnchorPoint = Vector2.new(0.5, 0.5)
label.ZIndex = 4
local function recolor(c: Color3)
local s = label:FindFirstChildOfClass("UIStroke")
if s then
s.Color = Theme.edge(c)
end
end
local set = b.setColor
b.setColor = function(c: Color3)
set(c)
recolor(c)
end
return b, label
end
-- 빨간 동그라미 알림 배지(예: 살 수 있는 업그레이드가 있으면 "!")
function Theme.badge(parent: Instance, name: string): (Frame, TextLabel)
local f = Theme.frame(parent, name, Theme.RED)
f.Size = UDim2.fromOffset(30, 30)
f.Size = UDim2.fromOffset(28, 28)
f.AnchorPoint = Vector2.new(0.5, 0.5)
f.Position = UDim2.new(1, -12, 0, 12)
f.Position = UDim2.new(1, -6, 0, 6)
f.ZIndex = 8
Theme.corner(f, 1, 1)
Theme.stroke(f, Theme.INK, 2.5)
Theme.gradient(f, Color3.fromRGB(255, 110, 90), Color3.fromRGB(220, 40, 30))
local t = Theme.text(f, "Text", false, 2)
t.Size = UDim2.new(1, -6, 1, -6)
t.Position = UDim2.fromOffset(3, 3)
Theme.round(f)
Theme.stroke(f, Theme.WHITE, 3)
local t = Theme.text(f, "Text", Theme.edge(Theme.RED), true)
t.Size = UDim2.new(1, -8, 1, -8)
t.Position = UDim2.fromOffset(4, 4)
t.ZIndex = 9
return f, t
end
-- 둥실둥실(위아래로 살짝) 움직임. 지금 누를 수 있는 것에만 씁니다.
function Theme.bob(o: GuiObject, pixels: number, period: number): Tween
local p = o.Position
local tw = TweenService:Create(
o,
TweenInfo.new(period / 2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true),
{ Position = p + UDim2.fromOffset(0, -pixels) }
)
tw:Play()
return tw
end
-- 통 튀기(크기). UIScale이 있는 것에 씁니다.
function Theme.pop(o: Instance, from: number?)
local s = o:FindFirstChildOfClass("UIScale")
if s then
s.Scale = from or 0.6
TweenService:Create(s, TweenInfo.new(0.32, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 })
:Play()
end
end
-- 창 틀: 흰 본문(아주 둥근 모서리) + 위쪽 색 띠에 가운데 제목 + 오른쪽 위 빨간 동그라미 X.
export type Panel = {
frame: Frame,
body: Frame,
title: TextLabel,
close: Button,
headerH: number,
}
function Theme.panel(parent: Instance, name: string, color: Color3): Panel
local headerH = 58
local p = Theme.frame(parent, name)
p.Visible = false
p.ZIndex = 20
local scale = Instance.new("UIScale")
scale.Parent = p
local body = Theme.frame(p, "Body", Theme.CREAM)
body.Size = UDim2.fromScale(1, 1)
body.ZIndex = 2
Theme.corner(body, 30)
Theme.stroke(body, Theme.edge(color), 4)
local header = Theme.frame(body, "Header", color)
header.Size = UDim2.new(1, 0, 0, headerH)
header.ZIndex = 2
Theme.corner(header, 30)
Theme.gradient(header, Theme.lighten(color, 0.15), color)
-- 띠 아래쪽 모서리는 각지게(본문과 이어지게)
local fill = Theme.frame(header, "Fill", color)
fill.Position = UDim2.new(0, 0, 1, -30)
fill.Size = UDim2.new(1, 0, 0, 30)
fill.ZIndex = 2
Theme.gradient(fill, color, color)
local title = Theme.text(header, "Title", Theme.edge(color))
title.AnchorPoint = Vector2.new(0.5, 0.5)
title.Position = UDim2.fromScale(0.5, 0.5)
title.Size = UDim2.new(0.6, 0, 0, 38)
title.ZIndex = 4
local close = Theme.button(p, "Close", Theme.RED)
close.button.AnchorPoint = Vector2.new(0.5, 0.5)
-- 색 띠 오른쪽 안에(화면 밖으로 안 나가게). 크기는 Layout.rows.closeH
close.button.Size = UDim2.fromOffset(48, 48)
close.button.Position = UDim2.new(1, -36, 0, headerH / 2)
close.button.ZIndex = 6
local x = Theme.icon(close.face, "X", "close")
x.Size = UDim2.fromScale(0.6, 0.6)
x.AnchorPoint = Vector2.new(0.5, 0.5)
x.Position = UDim2.fromScale(0.5, 0.5)
x.ZIndex = 4
return { frame = p, body = body, title = title, close = close, headerH = headerH }
end
return Theme

View File

@@ -1,6 +1,8 @@
--!strict
-- 파트로 모형을 만드는 작은 도구. Union은 Place Publishing API로 못 올리므로 Part 조합만 씁니다.
local Icons = require(game:GetService("ReplicatedStorage").Shared.Icons)
local Build = {}
export type PartProps = {
@@ -136,6 +138,45 @@ function Build.billboard(adornee: Instance, text: string, size: UDim2, offset: V
return gui
end
-- 손님 주문 말풍선: 흰 동그라미 안에 직접 그린 음식 그림(글을 못 읽어도 알 수 있게). 다 받으면 하트로 바뀝니다(setBubbleIcon).
function Build.orderBubble(adornee: Instance, menu: string, size: number, offset: Vector3): BillboardGui
local gui = Instance.new("BillboardGui")
gui.Size = UDim2.fromOffset(size, size)
gui.StudsOffset = offset
gui.LightInfluence = 0
gui.MaxDistance = 120
gui.Adornee = adornee :: any
gui.Parent = adornee
local bubble = Instance.new("Frame")
bubble.Name = "Bubble"
bubble.Size = UDim2.fromScale(1, 1)
bubble.BackgroundColor3 = Color3.new(1, 1, 1)
bubble.Parent = gui
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0.5, 0)
corner.Parent = bubble
local stroke = Instance.new("UIStroke")
stroke.Thickness = 3
stroke.Color = Color3.fromRGB(255, 94, 132) -- 화면 UI 대표 색(Theme.PINK)
stroke.Parent = bubble
local icon = Instance.new("ImageLabel")
icon.Name = "Icon"
icon.BackgroundTransparency = 1
icon.AnchorPoint = Vector2.new(0.5, 0.5)
icon.Position = UDim2.fromScale(0.5, 0.5)
icon.Size = UDim2.fromScale(0.8, 0.8)
icon.Parent = bubble
Icons.apply(icon, menu)
return gui
end
function Build.setBubbleIcon(gui: BillboardGui, name: string)
local icon = gui:FindFirstChild("Icon", true) :: ImageLabel?
if icon then
Icons.apply(icon, name)
end
end
-- 모델 전체를 하나로 묶습니다(첫 파트 기준). 손에 들기, 트윈 이동용.
function Build.weldAll(model: Model, root: BasePart)
for _, d in model:GetDescendants() do

View File

@@ -30,6 +30,7 @@ local neighbors: { [number]: Neighbor.Neighbor } = {} -- 플레이어가 없는
local guestAt: { [Player]: PlotController.PlotController } = {} -- 손님으로 앉아 있는 가게
local bonusAt: { [Player]: number } = {} -- 다음 시식 보너스를 받을 수 있는 시각
local COOK_RANGE = 20 -- 요리 화면에서 만든 접시는 조리대에서 이만큼 안에 있어야 받습니다
local VISIT_RANGE = 16 -- 입구에서 이만큼 안에 있어야 손님으로 들어갈 수 있습니다
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
@@ -258,11 +259,16 @@ local function onAction(player: Player, kind: any, arg: any)
return
end
if kind == "cook" then
-- 버튼을 누르고 있는 시간만큼은 지나야 다음 접시를 만들 수 있습니다.
-- 요리 화면에서 다 만들었을 때(arg = 고른 메뉴). 요리 과정을 아주 빨리 해도 걸리는 시간은 지나야 다음 접시를 만들 수 있고,
-- 조리대 가까이 있어야 합니다.
local now = os.clock()
if now - controller.lastCook >= controller.shop.stats.cook * 0.8 then
local menu = if typeof(arg) == "string" and Economy.MENUS[arg] then arg else nil
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart") :: BasePart?
local near = not root or (root.Position - controller.slot.refs.stove.Position).Magnitude <= COOK_RANGE
if menu and near and now - controller.lastCook >= controller.shop.stats.cook * 0.4 then
controller.shop.now = now
controller:cook()
controller:cook(menu)
end
elseif kind == "buy" then
local ok, err = controller:buy()

View File

@@ -456,7 +456,7 @@ local function buildMenuStand(parent: Instance, cf: CFrame, menu: string, slot:
end
local dish = Food.dish(menu, at(0.9, 3.2, 0), m)
dish.Name = "Display"
local icon = Build.billboard(stand, Economy.MENUS[menu].icon, UDim2.fromOffset(56, 56), Vector3.new(0, 4.6, 0))
local icon = Build.orderBubble(stand, menu, 56, Vector3.new(0, 4.6, 0))
icon.Name = "MenuIcon"
icon.MaxDistance = 70
end

View File

@@ -175,11 +175,13 @@ function PlotController.sync(self: PlotController)
o:SetAttribute("Tut", self.tut)
o:SetAttribute("Plot", self.slot.index)
o:SetAttribute("Carry", #shop.hand)
o:SetAttribute("Hand", table.concat(shop.hand, ","))
o:SetAttribute("Earned", self.data.Earned or 0)
self.slot.model:SetAttribute("Level", shop.bought)
end
-- 조리대 속성: CookMenu(만들 메뉴, 없으면 ""), CookTime(누르는 시간), HandFull
-- 조리대 속성: CookMenu(먼저 만들 메뉴, 없으면 ""), CookTime(화구 수준), HandFull
-- 주인 속성 Orders: 요리 화면에 보여 줄 메뉴별 주문 수("Tteokbokki=2,Gimbap=1", 메뉴 순서대로)
function PlotController.refreshPrompt(self: PlotController)
local shop = self.shop
local stove = self.slot.refs.stove
@@ -188,6 +190,14 @@ function PlotController.refreshPrompt(self: PlotController)
stove:SetAttribute("CookMenu", menu or "")
stove:SetAttribute("CookTime", shop.stats.cook)
stove:SetAttribute("HandFull", full)
local counts = Shop.openCounts(shop)
local parts = {}
for _, m in Economy.MENU_ORDER do
if counts[m] then
table.insert(parts, `{m}={counts[m]}`)
end
end
self.owner:SetAttribute("Orders", table.concat(parts, ","))
end
function PlotController.refreshHelper(self: PlotController)
@@ -302,8 +312,8 @@ function PlotController.updateGuide(self: PlotController)
end
end
function PlotController.cook(self: PlotController): string?
local menu = Shop.cook(self.shop)
function PlotController.cook(self: PlotController, choice: string?): string?
local menu = Shop.cook(self.shop, choice)
if not menu then
return nil
end
@@ -386,10 +396,7 @@ function PlotController.serve(self: PlotController, id: number): number?
end
self:layoutHand()
if view then
local label = view.bubble:FindFirstChild("Text") :: TextLabel?
if label then
label.Text = "😋"
end
Build.setBubbleIcon(view.bubble, "heart")
local anchor = if view.npc then view.npc.root else view.seat
if anchor then
floatText(anchor, "+" .. Locale.number(earn))
@@ -423,8 +430,7 @@ function PlotController.onEvent(self: PlotController, e: Shop.Event)
end
local npc = Npc.spawn(self.slot.refs.dynamic, CFrame.new(path[1]), self.rng)
npc.root.CFrame = Npc.standCFrame(npc, path[1], path[2])
local icon = Economy.MENUS[e.menu].icon
local bubble = Build.billboard(npc.root, icon, UDim2.fromOffset(70, 70), Vector3.new(0, 4, 0))
local bubble = Build.orderBubble(npc.root, e.menu, 64, Vector3.new(0, 4, 0))
bubble.Name = "Order"
self.views[e.id] = { npc = npc, seat = nil, bubble = bubble, dish = nil }
Npc.walk(npc, path, Economy.WALK_IN)
@@ -559,7 +565,7 @@ function PlotController.addGuest(self: PlotController, userId: number, character
seat.Size = Vector3.new(2, 0.4, 2)
seat.CFrame = PlotBuilder.seatCFrame(self.slot.cf, c.seat) * CFrame.new(0, 0.2, 0)
seat.Parent = self.slot.refs.dynamic
local bubble = Build.billboard(seat, Economy.MENUS[c.menu].icon, UDim2.fromOffset(70, 70), Vector3.new(0, 5, 0))
local bubble = Build.orderBubble(seat, c.menu, 64, Vector3.new(0, 5, 0))
bubble.Name = "Order"
self.views[c.id] = { npc = nil, seat = seat, bubble = bubble, dish = nil }
seat:Sit(humanoid)

View File

@@ -60,9 +60,9 @@ Economy.START = {
}
Economy.MENUS = {
Tteokbokki = { price = 10, icon = "🌶️" },
Gimbap = { price = 20, icon = "🍙" },
Sundae = { price = 35, icon = "🌭" },
Tteokbokki = { price = 15, icon = "🌶️" },
Gimbap = { price = 25, icon = "🍙" },
Sundae = { price = 40, icon = "🌭" },
Eomuk = { price = 50, icon = "🍢" },
Twigim = { price = 70, icon = "🍤" },
} :: { [string]: Menu }

View File

@@ -1,11 +1,15 @@
--!strict
-- 화면 UI 아이콘. 그림 한 장(art/ui_icons.png, tools/icons.py로 직접 그림)을 128px 칸으로 잘라 씁니다.
-- 칸 순서를 바꾸면 tools/icons.py --luau 출력으로 아래 표를 다시 맞추고, 그림을 새로 올려 ASSET을 바꿉니다.
-- 화면 UI 그림. 직접 그린 그림 두 장을 칸으로 잘라 씁니다.
-- ASSET(art/ui_icons.png, tools/icons.py): 128px 칸 8x8. 버튼 아이콘, 메뉴, 요리 재료·도구
-- KITCHEN_ASSET(art/kitchen.png, tools/kitchen_art.py): 256px 칸 4x4. 조리 도구(팬·도마·찜기·냄비·튀김기), 마스코트 떡이
-- 칸 순서를 바꾸면 각 도구의 --luau 출력으로 아래 표를 다시 맞추고, 그림을 새로 올려(tools/cloud.py image) ID를 바꿉니다.
local Icons = {}
Icons.ASSET = "rbxassetid://89649261251254"
Icons.ASSET = "rbxassetid://111384470366371"
Icons.CELL = Vector2.new(128, 128)
Icons.KITCHEN_ASSET = "rbxassetid://118704012792360"
Icons.KITCHEN_CELL = Vector2.new(256, 256)
Icons.OFFSET = {
coin = Vector2.new(0, 0),
@@ -40,6 +44,44 @@ Icons.OFFSET = {
arrowDown = Vector2.new(640, 384),
scroll = Vector2.new(768, 384),
hand = Vector2.new(896, 384),
riceCake = Vector2.new(0, 512),
riceCakeRed = Vector2.new(128, 512),
riceCakes = Vector2.new(256, 512),
sauceBowl = Vector2.new(384, 512),
sauceBlob = Vector2.new(512, 512),
spatula = Vector2.new(640, 512),
bubble = Vector2.new(768, 512),
steam = Vector2.new(896, 512),
fillings = Vector2.new(0, 640),
mat = Vector2.new(128, 640),
knife = Vector2.new(256, 640),
gimbapSlice = Vector2.new(384, 640),
sundaeRaw = Vector2.new(512, 640),
sundaePiece = Vector2.new(640, 640),
sundaeSlice = Vector2.new(768, 640),
fishCake = Vector2.new(896, 640),
batter = Vector2.new(0, 768),
shrimpRaw = Vector2.new(128, 768),
shrimpBatter = Vector2.new(256, 768),
tongs = Vector2.new(384, 768),
customer = Vector2.new(512, 768),
mascot = Vector2.new(640, 768),
heart = Vector2.new(768, 768),
cart = Vector2.new(896, 768),
pot = Vector2.new(0, 896),
} :: { [string]: Vector2 }
Icons.KITCHEN = {
pan = Vector2.new(0, 0),
board = Vector2.new(256, 0),
steamer = Vector2.new(512, 0),
pot = Vector2.new(768, 0),
fryer = Vector2.new(0, 256),
mascot = Vector2.new(256, 256),
mascotCheer = Vector2.new(512, 256),
gimbapRoll = Vector2.new(768, 256),
plateBig = Vector2.new(0, 512),
burst = Vector2.new(256, 512),
} :: { [string]: Vector2 }
-- ImageLabel/ImageButton에 아이콘을 씌웁니다.
@@ -49,4 +91,11 @@ function Icons.apply(image: ImageLabel, name: string)
image.ImageRectSize = Icons.CELL
end
-- 큰 요리 그림(조리 도구, 마스코트)
function Icons.applyKitchen(image: ImageLabel, name: string)
image.Image = Icons.KITCHEN_ASSET
image.ImageRectOffset = Icons.KITCHEN[name] or Vector2.zero
image.ImageRectSize = Icons.KITCHEN_CELL
end
return Icons

View File

@@ -20,11 +20,34 @@ local STRINGS: { [string]: { [string]: string } } = {
nextUp = "다음 업그레이드",
doubleOn = "적용 중",
close = "닫기",
cookAction = "{menu} 만들기",
cookAction = "요리하기",
cook_Twigim_3 = "집게로 건져요",
cook_Twigim_2 = "기름에 바삭하게 튀겨요",
cook_Twigim_1 = "새우에 튀김옷을 입혀요",
cook_Eomuk_2 = "국물에 퐁당 담가요",
cook_Eomuk_1 = "어묵을 꼬치에 끼워요",
cook_Sundae_3 = "먹기 좋게 썰어요",
cook_Sundae_2 = "김이 나게 푹 쪄요",
cook_Sundae_1 = "순대를 찜기에 넣어요",
cook_Gimbap_3 = "송송 썰어요",
cook_Gimbap_2 = "돌돌 말아요",
cook_Gimbap_1 = "김 위에 재료를 올려요",
cook_Tteokbokki_3 = "주걱으로 휘휘 저어요",
cook_Tteokbokki_2 = "빨간 양념을 부어요",
cook_Tteokbokki_1 = "떡을 팬에 넣어요",
gestureRub = "문질문질!",
gestureHold = "꾹 누르고 있기",
gestureTap = "톡톡! {n}번",
cookDone = "완성!",
chooseMenu = "무엇을 만들까요? 손님이 주문한 걸 골라요!",
cookTitle = "요리하기",
btnBoost = "부스트",
btnDouble = "2배 돈",
btnShop = "상점",
cookWait = "손님 기다리는 중",
cookHandFull = "손이 꽉 찼어요",
cookHandFull = "손이 꽉 찼어요! 먼저 손님에게 가져다줘요",
stoveObject = "조리대",
tut1 = "손님이 왔어요! 빛나는 조리대로 가서 버튼을 꾹 누르세요",
tut1 = "손님이 왔어요! 빛나는 조리대로 가서 요리를 시작해요",
tut2 = "다 만들었어요! 접시를 손님 자리로 가져가세요",
tut3 = "돈을 벌었어요! 아래 [사기] 버튼으로 테이블을 사세요",
tutDone = "잘했어요! 계속 손님을 받고 가게를 키워 보세요",
@@ -111,11 +134,34 @@ local STRINGS: { [string]: { [string]: string } } = {
nextUp = "Next Upgrade",
doubleOn = "Active",
close = "Close",
cookAction = "Cook {menu}",
cookAction = "Cook",
cook_Twigim_3 = "Pick it up with the tongs",
cook_Twigim_2 = "Fry it until crispy",
cook_Twigim_1 = "Coat the shrimp in batter",
cook_Eomuk_2 = "Dip it in the hot soup",
cook_Eomuk_1 = "Put the fish cake on the skewer",
cook_Sundae_3 = "Slice it up",
cook_Sundae_2 = "Steam it nice and hot",
cook_Sundae_1 = "Put the sundae in the steamer",
cook_Gimbap_3 = "Slice it",
cook_Gimbap_2 = "Roll it up",
cook_Gimbap_1 = "Put fillings on the seaweed",
cook_Tteokbokki_3 = "Stir it with the spatula",
cook_Tteokbokki_2 = "Pour in the red sauce",
cook_Tteokbokki_1 = "Put the rice cakes in the pan",
gestureRub = "Rub rub!",
gestureHold = "Press and hold",
gestureTap = "Tap! x{n}",
cookDone = "Done!",
chooseMenu = "What shall we cook? Pick what a customer ordered!",
cookTitle = "Cooking",
btnBoost = "Boost",
btnDouble = "2x Cash",
btnShop = "Shop",
cookWait = "Waiting for customers",
cookHandFull = "Hands are full",
cookHandFull = "Hands are full! Serve the customer first",
stoveObject = "Stove",
tut1 = "A customer is here! Go to the glowing stove and hold the button",
tut1 = "A customer is here! Go to the glowing stove and start cooking",
tut2 = "Done! Bring the dish to the customer's seat",
tut3 = "You earned money! Tap [Buy] at the bottom to get a table",
tutDone = "Great job! Keep serving and grow your shop",
@@ -202,11 +248,34 @@ local STRINGS: { [string]: { [string]: string } } = {
nextUp = "次のアップグレード",
doubleOn = "適用中",
close = "閉じる",
cookAction = "{menu}を作る",
cookAction = "料理する",
cook_Twigim_3 = "トングで取り出そう",
cook_Twigim_2 = "カリッと揚げよう",
cook_Twigim_1 = "エビに衣をつけよう",
cook_Eomuk_2 = "スープにつけよう",
cook_Eomuk_1 = "おでんを串にさそう",
cook_Sundae_3 = "食べやすく切ろう",
cook_Sundae_2 = "ほかほかに蒸そう",
cook_Sundae_1 = "スンデを蒸し器に入れよう",
cook_Gimbap_3 = "トントン切ろう",
cook_Gimbap_2 = "くるくる巻こう",
cook_Gimbap_1 = "のりの上に具をのせよう",
cook_Tteokbokki_3 = "ヘラでぐるぐる混ぜよう",
cook_Tteokbokki_2 = "赤いタレをかけよう",
cook_Tteokbokki_1 = "おもちをフライパンに入れよう",
gestureRub = "こすこす!",
gestureHold = "長押し",
gestureTap = "タップ!{n}回",
cookDone = "できた!",
chooseMenu = "何を作る?お客さんの注文を選んでね!",
cookTitle = "料理する",
btnBoost = "ブースト",
btnDouble = "2倍",
btnShop = "ショップ",
cookWait = "お客さんを待っています",
cookHandFull = "手がいっぱいです",
cookHandFull = "手がいっぱい!先にお客さんに運んでね",
stoveObject = "コンロ",
tut1 = "お客さんが来たよ!光っているコンロに行って、ボタンを長押ししてね",
tut1 = "お客さんが来たよ!光っているコンロに行って料理を始めよう",
tut2 = "できた!お皿をお客さんの席まで運んでね",
tut3 = "お金をかせいだよ!下の[買う]ボタンでテーブルを買ってね",
tutDone = "よくできました!お客さんを迎えて、お店を大きくしよう",
@@ -293,11 +362,34 @@ local STRINGS: { [string]: { [string]: string } } = {
nextUp = "下一个升级",
doubleOn = "已生效",
close = "关闭",
cookAction = "制作{menu}",
cookAction = "做菜",
cook_Twigim_3 = "用夹子夹出来",
cook_Twigim_2 = "炸得脆脆的",
cook_Twigim_1 = "给虾裹上面糊",
cook_Eomuk_2 = "放进汤里泡一泡",
cook_Eomuk_1 = "把鱼饼串到签子上",
cook_Sundae_3 = "切成小块",
cook_Sundae_2 = "热乎乎地蒸",
cook_Sundae_1 = "把米肠放进蒸锅",
cook_Gimbap_3 = "切成片",
cook_Gimbap_2 = "卷起来",
cook_Gimbap_1 = "在紫菜上放馅料",
cook_Tteokbokki_3 = "用铲子搅一搅",
cook_Tteokbokki_2 = "倒入红色酱料",
cook_Tteokbokki_1 = "把年糕放进锅里",
gestureRub = "来回搓!",
gestureHold = "按住不放",
gestureTap = "点一点!{n}次",
cookDone = "完成!",
chooseMenu = "做什么呢?选客人点的菜吧!",
cookTitle = "做菜",
btnBoost = "加速",
btnDouble = "双倍",
btnShop = "商店",
cookWait = "等待客人中",
cookHandFull = "手里拿满了",
cookHandFull = "手里拿满了!先端给客人吧",
stoveObject = "灶台",
tut1 = "客人来了!走到发光的灶台,按住按钮",
tut1 = "客人来了!走到发光的灶台开始做菜吧",
tut2 = "做好了!把盘子端到客人的座位上",
tut3 = "赚到钱了!点下面的[购买]按钮买一张桌子",
tutDone = "做得好!继续招待客人,把店做大吧",

View File

@@ -0,0 +1,188 @@
--!strict
-- 메뉴별 조리 과정(요리 화면의 단계)과 진행 상태 기계. 로블록스 API를 쓰지 않아서 lune 테스트와 시뮬레이터에서 그대로 씁니다.
-- 단계 종류(모두 실패 없음, 어린아이도 끝까지 할 수 있게):
-- tap = 재료를 톡톡 누르기(need번)
-- hold = 꾹 누르고 있기(need초)
-- rub = 손가락·마우스로 문지르기(이동 거리 need × RUB_UNIT 기준 단위)
-- "화구" 업그레이드(stats.cook 2.5 → 1.5 → 1)를 사면 누르는 횟수·시간이 같은 비율로 줄어듭니다.
local Recipes = {}
export type StepKind = "tap" | "hold" | "rub"
export type Step = {
kind: StepKind,
key: string, -- 안내 글 Locale 키(cook_<메뉴>_<번호>)
base: number, -- 화구 Lv0 기준 횟수·초·문지르기 양
tool: string, -- 누르는 물건 그림(Kitchen 그림 이름)
}
export type Recipe = {
stage: string, -- 조리 도구 그림(팬, 도마, 찜기, 냄비, 튀김기)
steps: { Step },
}
Recipes.BASE_COOK = 2.5 -- Economy.START.cook과 같음
Recipes.RUB_UNIT = 260 -- 문지르기 1번 = 기준 단위 260만큼 움직이기
Recipes.LIST = {
Tteokbokki = {
stage = "pan",
steps = {
{ kind = "tap", key = "cook_Tteokbokki_1", base = 4, tool = "riceCakes" },
{ kind = "hold", key = "cook_Tteokbokki_2", base = 1.0, tool = "sauceBowl" },
{ kind = "rub", key = "cook_Tteokbokki_3", base = 3, tool = "spatula" },
},
},
Gimbap = {
stage = "board",
steps = {
{ kind = "tap", key = "cook_Gimbap_1", base = 4, tool = "fillings" },
{ kind = "rub", key = "cook_Gimbap_2", base = 3, tool = "roll" },
{ kind = "tap", key = "cook_Gimbap_3", base = 4, tool = "knife" },
},
},
Sundae = {
stage = "steamer",
steps = {
{ kind = "tap", key = "cook_Sundae_1", base = 3, tool = "sundaeRaw" },
{ kind = "hold", key = "cook_Sundae_2", base = 1.2, tool = "fire" },
{ kind = "tap", key = "cook_Sundae_3", base = 4, tool = "knife" },
},
},
Eomuk = {
stage = "pot",
steps = {
{ kind = "tap", key = "cook_Eomuk_1", base = 4, tool = "fishCake" },
{ kind = "hold", key = "cook_Eomuk_2", base = 1.4, tool = "skewer" },
},
},
Twigim = {
stage = "fryer",
steps = {
{ kind = "rub", key = "cook_Twigim_1", base = 3, tool = "batter" },
{ kind = "hold", key = "cook_Twigim_2", base = 1.2, tool = "fire" },
{ kind = "tap", key = "cook_Twigim_3", base = 3, tool = "tongs" },
},
},
} :: { [string]: Recipe }
-- 화구 수준에 맞춘 단계 목표(횟수는 정수, 최소 2번)
function Recipes.need(step: Step, cook: number): number
local k = cook / Recipes.BASE_COOK
if step.kind == "tap" then
return math.max(2, math.floor(step.base * k + 0.5))
end
return step.base * k
end
-- 시뮬레이터용: 아이가 쉬지 않고 했을 때 걸리는 시간(초). 메뉴 고르기·완성 연출 포함.
Recipes.TIME_TAP = 0.3 -- 한 번 누르는 데
Recipes.TIME_RUB = 0.35 -- 문지르기 1번에
Recipes.TIME_STEP = 0.4 -- 단계가 바뀔 때 안내를 보는 시간
Recipes.TIME_CHOOSE = 1.0 -- 조리대 버튼 + 메뉴 고르기
Recipes.TIME_DONE = 0.6 -- "완성!" 연출
function Recipes.expectedTime(menu: string, cook: number): number
local r = Recipes.LIST[menu]
local t = Recipes.TIME_CHOOSE + Recipes.TIME_DONE
for _, s in r.steps do
local n = Recipes.need(s, cook)
t += Recipes.TIME_STEP
if s.kind == "tap" then
t += n * Recipes.TIME_TAP
elseif s.kind == "rub" then
t += n * Recipes.TIME_RUB
else
t += n
end
end
return t
end
-- 요리 화면 한 번의 진행 상태
export type Phase = "menu" | "cook" | "done"
export type Flow = {
phase: Phase,
cook: number, -- 화구 수준(stats.cook)
menu: string?,
step: number, -- 지금 단계(1부터)
progress: number, -- 지금 단계 진행량(0 ~ need)
need: number,
}
function Recipes.newFlow(cook: number): Flow
return { phase = "menu", cook = cook, menu = nil, step = 0, progress = 0, need = 0 }
end
function Recipes.current(flow: Flow): Step?
local r = flow.menu and Recipes.LIST[flow.menu]
return r and r.steps[flow.step]
end
local function startStep(flow: Flow, i: number)
local r = Recipes.LIST[flow.menu :: string]
flow.step = i
flow.progress = 0
local s = r.steps[i]
flow.need = if s then Recipes.need(s, flow.cook) else 0
end
-- 메뉴를 고르면 첫 단계부터 시작합니다.
function Recipes.choose(flow: Flow, menu: string): boolean
if flow.phase ~= "menu" or not Recipes.LIST[menu] then
return false
end
flow.menu = menu
flow.phase = "cook"
startStep(flow, 1)
return true
end
-- 입력을 넣습니다. kind가 지금 단계와 다르면 무시합니다.
-- 돌려주는 값: nil(무시), "progress", "step"(다음 단계로), "done"(완성)
function Recipes.input(flow: Flow, kind: StepKind, amount: number): string?
if flow.phase ~= "cook" then
return nil
end
local s = Recipes.current(flow)
if not s or s.kind ~= kind or amount <= 0 then
return nil
end
flow.progress = math.min(flow.need, flow.progress + amount)
if flow.progress < flow.need - 1e-9 then
return "progress"
end
local r = Recipes.LIST[flow.menu :: string]
if flow.step >= #r.steps then
flow.phase = "done"
return "done"
end
startStep(flow, flow.step + 1)
return "step"
end
-- 완성 뒤 다음 접시를 만들 때(메뉴 고르기로 돌아감)
function Recipes.reset(flow: Flow, cook: number)
flow.phase = "menu"
flow.cook = cook
flow.menu = nil
flow.step = 0
flow.progress = 0
flow.need = 0
end
-- 지금 단계까지 포함한 전체 진행률(0~1). 위쪽 단계 표시에 씁니다.
function Recipes.fraction(flow: Flow): number
local r = flow.menu and Recipes.LIST[flow.menu]
if not r then
return 0
end
if flow.phase == "done" then
return 1
end
local part = if flow.need > 0 then flow.progress / flow.need else 0
return ((flow.step - 1) + part) / #r.steps
end
return Recipes

View File

@@ -121,6 +121,15 @@ function Shop.nextCookMenu(self: Shop): string?
return if open[1] then open[1].menu else nil
end
-- 메뉴별로 아직 접시가 정해지지 않은 주문 수(요리 화면의 "주문" 표시)
function Shop.openCounts(self: Shop): { [string]: number }
local counts = {}
for _, c in Shop.openOrders(self) do
counts[c.menu] = (counts[c.menu] or 0) + 1
end
return counts
end
function Shop.handFull(self: Shop): boolean
return #self.hand >= self.stats.carry
end
@@ -176,12 +185,19 @@ function Shop.tick(self: Shop, now: number): { Event }
return events
end
-- 플레이어가 조리대에서 다 만들었을 때. 만든 메뉴를 돌려줍니다.
function Shop.cook(self: Shop): string?
-- 플레이어가 요리 화면에서 다 만들었을 때. 만든 메뉴를 돌려줍니다.
-- menu를 주면 그 메뉴를 기다리는 주문이 있을 때만 만들고, 없으면 먼저 온 손님 메뉴를 만듭니다.
function Shop.cook(self: Shop, menu: string?): string?
if Shop.handFull(self) then
return nil
end
local menu = Shop.nextCookMenu(self)
if menu then
if not Shop.openCounts(self)[menu] then
return nil
end
else
menu = Shop.nextCookMenu(self)
end
if menu then
table.insert(self.hand, menu)
end

View File

@@ -6,4 +6,5 @@ return {
COIN = "rbxassetid://96594483709547", -- 서빙하고 돈 받을 때
BUY = "rbxassetid://90178922626515", -- 업그레이드 구매, 돈 부스트
LEVELUP = "rbxassetid://134931950463198", -- 실내 분식집 확장
POP = "rbxassetid://114946217416724", -- 요리 화면에서 톡톡 누를 때
}

View File

@@ -46,9 +46,9 @@ T.eq(Economy.statsAt(99).seats, 8, "범위를 넘어도 안전")
Economy.statsAt(20)
T.eq(#Economy.START.menus, 1, "START.menus 불변")
T.eq(Economy.dishPrice("Tteokbokki", s0, 1), 10, "떡볶이 10")
T.eq(Economy.dishPrice("Sundae", Economy.statsAt(7), 1), 52, "순대 35 x 1.5 = 52(내림)")
T.eq(Economy.dishPrice("Tteokbokki", s0, 2), 20, "2배 수익")
T.eq(Economy.dishPrice("Tteokbokki", s0, 1), 15, "떡볶이 15")
T.eq(Economy.dishPrice("Gimbap", Economy.statsAt(7), 1), 37, "김밥 25 x 1.5 = 37(내림)")
T.eq(Economy.dishPrice("Tteokbokki", s0, 2), 30, "2배 수익")
T.eq(
Economy.boostAmount(s0),

View File

@@ -74,6 +74,21 @@ for _, d in DEVICES do
-- 창(업그레이드 목록, 설정)은 화면 안에 다 들어감
T.check(inside(L.panel, L.width, L.height), `{tag}: 업그레이드 창 화면 안`)
T.check(inside(L.settingsPanel, L.width, L.height), `{tag}: 설정 창 화면 안`)
T.check(inside(L.kitchen, L.width, L.height), `{tag}: 요리 창 화면 안`)
local g = L.grid
T.check(
g.pad * 2 + g.cols * g.cardW + (g.cols - 1) * g.gap <= L.panel.w + 1e-6,
`{tag}: 상점 카드가 창 너비 안`
)
T.check(
g.top + g.rows * g.cardH + (g.rows - 1) * g.gap + g.pad <= L.panel.h + 1e-6,
`{tag}: 상점 카드가 창 높이 안`
)
T.check(
g.cardW * L.scale >= 90 and g.cardH * L.scale >= 90,
`{tag}: 상점 카드가 손가락으로 누를 만큼 큼`
)
T.check(L.kitchen.w * L.scale >= 0.6 * d.w or L.kitchen.w >= 780, `{tag}: 요리 창이 충분히 큼`)
T.eq(L.rows.devY ~= nil, dev, `{tag}: 개발자 줄은 주인에게만`)
T.eq(L.rows.mouseY == nil, d.touch, `{tag}: 마우스 회전 줄은 PC만`)
@@ -90,7 +105,7 @@ for _, d in DEVICES do
local p = px(r, L.scale)
T.check(not overlap(p, zones.stick), `{tag}: {name} 버튼이 조이스틱 자리 피함`)
T.check(not overlap(p, zones.jump), `{tag}: {name} 버튼이 점프 버튼 자리 피함`)
T.check(p.h >= 36, `{tag}: {name} 버튼 높이 {math.floor(p.h)}px ≥ 36`)
T.check(p.h >= 44, `{tag}: {name} 버튼 높이 {math.floor(p.h)}px ≥ 44(어린이 손가락)`)
end
T.check(L.rows.langButtonH * L.scale >= 36, `{tag}: 언어 버튼 누르기 쉬움`)
T.check(L.rows.toggleH * L.scale >= 34, `{tag}: 켜기/끄기 버튼 누르기 쉬움`)

View File

@@ -2,6 +2,7 @@
local fs = require("@lune/fs")
local Economy = require("../src/shared/Economy")
local Locale = require("../src/shared/Locale")
local Recipes = require("../src/shared/Recipes")
local T = require("./check")
local ko = Locale.keys("ko")
@@ -19,6 +20,11 @@ for _, lang in Locale.LANGS do
for key in Economy.MENUS do
T.check(Locale.menuName(lang, key) ~= "menu_" .. key, `{lang} 메뉴 이름 {key}`)
end
for _, r in Recipes.LIST do
for _, st in r.steps do
T.check(Locale.t(lang, st.key) ~= st.key, `{lang} 요리 안내 {st.key}`)
end
end
for _, p in Economy.PURCHASES do
T.check(Locale.itemName(lang, p.id) ~= "item_" .. p.id, `{lang} 업그레이드 이름 {p.id}`)
end

View File

@@ -0,0 +1,74 @@
-- 요리 과정 검사: lune run tests/Recipes.spec.luau
local Economy = require("../src/shared/Economy")
local Recipes = require("../src/shared/Recipes")
local T = require("./check")
T.eq(Recipes.BASE_COOK, Economy.START.cook, "기준 화구 수준 = 처음 조리 시간")
for _, menu in Economy.MENU_ORDER do
local r = Recipes.LIST[menu]
T.check(r ~= nil, `{menu} 요리 과정 있음`)
T.check(#r.steps >= 2 and #r.steps <= 3, `{menu} 단계 2~3개`)
local kinds = {}
for i, s in r.steps do
T.eq(s.key, `cook_{menu}_{i}`, `{menu} {i}단계 안내 글 키`)
kinds[s.kind] = true
end
local n = 0
for _ in kinds do
n += 1
end
T.check(n >= 2, `{menu}: 단계마다 조작이 달라 지루하지 않음`)
-- 아이가 한 접시에 쓰는 시간: 처음 3~7초, 화구를 다 사면 더 짧아짐
local t0 = Recipes.expectedTime(menu, 2.5)
local t2 = Recipes.expectedTime(menu, 1)
T.check(t0 >= 3 and t0 <= 7, `{menu} 처음 {t0}초`)
T.check(t2 < t0 * 0.75, `{menu} 화구 Lv2면 {t2}초로 빨라짐`)
end
-- 서로 다른 메뉴는 과정이 다름
local seen = {}
for menu, r in Recipes.LIST do
local sig = r.stage
for _, s in r.steps do
sig ..= s.kind .. s.tool
end
T.check(seen[sig] == nil, `{menu} 과정이 다른 메뉴와 같지 않음`)
seen[sig] = true
end
-- 누르는 횟수는 정수, 최소 2번
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 2.5), 4, "화구 Lv0: 4번")
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 1.5), 2, "화구 Lv1: 2번(2.4 반올림)")
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 1), 2, "화구 Lv2: 최소 2번")
T.check(
math.abs(Recipes.need({ kind = "hold", key = "", base = 1, tool = "" }, 1.5) - 0.6) < 1e-9,
"꾹 누르기 0.6초"
)
-- 진행 상태: 떡볶이(톡톡 4 → 꾹 1초 → 문지르기 3)
local f = Recipes.newFlow(2.5)
T.eq(Recipes.input(f, "tap", 1), nil, "메뉴 고르기 전에는 입력 무시")
T.eq(Recipes.choose(f, "Nope"), false, "없는 메뉴는 못 고름")
T.eq(Recipes.choose(f, "Tteokbokki"), true, "떡볶이 고름")
T.eq(f.phase, "cook", "조리 시작")
T.eq(Recipes.choose(f, "Gimbap"), false, "조리 중에는 다시 못 고름")
T.eq(Recipes.input(f, "hold", 1), nil, "다른 조작은 무시(실패 없음)")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 1")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 2")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 3")
T.eq(Recipes.fraction(f), (0 + 3 / 4) / 3, "전체 진행률")
T.eq(Recipes.input(f, "tap", 1), "step", "톡 4 → 다음 단계")
T.eq(f.step, 2, "2단계")
T.eq(Recipes.input(f, "hold", 0.5), "progress", "꾹 0.5초")
T.eq(Recipes.input(f, "hold", 0.6), "step", "꾹 1초 넘음 → 다음 단계")
T.eq(Recipes.input(f, "rub", 0), nil, "움직임 0은 무시")
T.eq(Recipes.input(f, "rub", 2), "progress", "문지르기 2")
T.eq(Recipes.input(f, "rub", 5), "done", "문지르기 끝 → 완성")
T.eq(f.phase, "done", "완성 상태")
T.eq(Recipes.fraction(f), 1, "완성 진행률 1")
T.eq(Recipes.input(f, "tap", 1), nil, "완성 뒤 입력 무시")
Recipes.reset(f, 1)
T.eq(f.phase, "menu", "다음 접시: 메뉴 고르기로")
T.eq(f.cook, 1, "화구 수준 갱신")
T.done("Recipes.spec")

View File

@@ -28,8 +28,8 @@ T.eq(Shop.cook(s), "Tteokbokki", "조리하면 떡볶이")
T.eq(Shop.cook(s), nil, "손이 꽉 차면 더 못 만듦")
T.eq(Shop.nextCookMenu(s), nil, "열린 주문 없음")
local earn = Shop.serve(s, 1)
T.eq(earn, 10, "떡볶이 10원")
T.eq(s.money, 10, "돈 10")
T.eq(earn, 15, "떡볶이 15원")
T.eq(s.money, 15, "돈 15")
T.eq(#s.hand, 0, "접시를 내려놓음")
T.eq(Shop.serve(s, 1), nil, "같은 손님에게 두 번 못 줌")
T.eq(s.customers[1].state, "eating", "먹는 중")
@@ -49,7 +49,7 @@ T.eq(s.customers[1], nil, "손님 목록에서 빠짐")
local p, err = Shop.buyNext(s)
T.eq(p and p.id, "Table2", "첫 구매는 테이블 2")
T.eq(err, nil, "구매 성공")
T.eq(s.money, 0, "돈 차감")
T.eq(s.money, 5, "돈 차감(15 - 10)")
T.eq(s.stats.seats, 2, "테이블 2개")
local p2, err2 = Shop.buyNext(s)
T.eq(p2, nil, "돈이 모자라면 실패")
@@ -61,7 +61,7 @@ d.moneyMult = 2
Shop.tick(d, 0)
Shop.tick(d, 3)
Shop.cook(d)
T.eq(Shop.serve(d, 1), 20, "2배 수익이면 20원")
T.eq(Shop.serve(d, 1), 30, "2배 수익이면 30원")
-- 메뉴는 해금된 것을 돌아가며 주문
local m = Shop.new(0, 2, 0) -- 테이블2, 김밥 해금
@@ -74,7 +74,20 @@ T.eq(m.customers[2].menu, "Gimbap", "두 번째 손님 김밥")
Shop.tick(m, 9)
T.eq(Shop.cook(m), "Tteokbokki", "먼저 온 손님 메뉴부터")
T.eq(Shop.serve(m, 2), nil, "김밥 손님에게 떡볶이 불가")
T.eq(Shop.serve(m, 1), 10, "떡볶이 손님에게 성공")
T.eq(Shop.serve(m, 1), 15, "떡볶이 손님에게 성공")
-- 요리 화면에서 메뉴 고르기: 주문이 있는 메뉴만 만들 수 있음
local pick = Shop.new(0, 2, 0)
Shop.tick(pick, 0)
Shop.tick(pick, 6)
local counts = Shop.openCounts(pick)
T.eq(counts.Tteokbokki, 1, "떡볶이 주문 1")
T.eq(counts.Gimbap, 1, "김밥 주문 1")
T.eq(Shop.cook(pick, "Sundae"), nil, "주문 없는 메뉴는 못 만듦")
T.eq(Shop.cook(pick, "Gimbap"), "Gimbap", "나중에 온 손님 메뉴를 골라 만들 수 있음")
T.eq(Shop.openCounts(pick).Gimbap, nil, "만든 김밥만큼 주문이 채워짐")
T.eq(Shop.openCounts(pick).Tteokbokki, 1, "떡볶이 주문은 그대로")
T.eq(Shop.cook(pick, "Tteokbokki"), nil, "손이 꽉 차면 못 만듦")
-- 알바생: 카운터에 접시를 만들어 두고, 플레이어는 집어서 나름
local h = Shop.new(0, 8, 0)
@@ -140,11 +153,11 @@ for _, e in Shop.tick(g, 6.5) do
end
T.check(not spawnedWhileFull, "플레이어 손님 자리에는 NPC가 안 옴")
Shop.cook(g) -- 1번 손님 떡볶이
T.eq(Shop.serve(g, 1), 10, "NPC 손님은 1배")
T.eq(Shop.serve(g, 1), 15, "NPC 손님은 1배")
local gid = (guest :: any).id
T.eq(Shop.nextCookMenu(g), (guest :: any).menu, "플레이어 손님 주문도 조리대에 뜸")
Shop.cook(g)
T.eq(Shop.serve(g, gid), 20, "플레이어 손님은 2배")
T.eq(Shop.serve(g, gid), 30, "플레이어 손님은 2배")
local guestLeave = nil
for _, e in Shop.tick(g, 6.5 + Economy.EAT + 0.1) do
if e.kind == "leave" and e.guest then

View File

@@ -56,6 +56,7 @@ local function dump(o: Instance, i: number): { [string]: any }?
d.BackgroundColor3 = c3(o.BackgroundColor3)
d.BackgroundTransparency = o.BackgroundTransparency
d.ClipsDescendants = o.ClipsDescendants
d.SizeConstraint = o.SizeConstraint.Name
end
if o:IsA("ScrollingFrame") then
d.CanvasPosition = { o.CanvasPosition.X, o.CanvasPosition.Y }
@@ -139,61 +140,80 @@ local function dump(o: Instance, i: number): { [string]: any }?
return d
end
local Recipes = require(game:GetService("ReplicatedStorage").Shared.Recipes)
-- kitchen = { menu, step, frac } 이면 요리 창을 열어 그 단계까지 진행합니다(step = "done"이면 완성 화면).
local PHONE = { w = 750, h = 332, inset = 58, touch = true }
local PC = { w = 1366, h = 710, inset = 58, touch = false }
local function shot(name: string, dev: { [string]: any }, attrs: { [string]: any }, extra: { [string]: any }?)
local t = { name = name, w = dev.w, h = dev.h, inset = dev.inset, touch = dev.touch, attrs = attrs }
for k, v in extra or {} do
t[k] = v
end
return t
end
local SHOTS = {
{
name = "phone_iphone15",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 1234, Bought = 4, Carry = 1, Tut = 0 },
},
{ name = "phone_tut", w = 750, h = 332, inset = 58, touch = true, attrs = { Money = 12, Bought = 0, Tut = 3 } },
{
name = "phone_shop",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 150, Bought = 5 },
open = "Panel",
},
{
name = "phone_settings",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 150, Bought = 5 },
open = "SettingsPanel",
},
{ name = "pc_1366", w = 1366, h = 710, inset = 58, touch = false, attrs = { Money = 1234, Bought = 4, Carry = 1 } },
{
name = "pc_shop",
w = 1366,
h = 710,
inset = 58,
touch = false,
attrs = { Money = 760, Bought = 12, Double = true },
open = "Panel",
},
{
name = "pc_settings",
w = 1366,
h = 710,
inset = 58,
touch = false,
attrs = { Money = 760, Bought = 12, Dev = true },
open = "SettingsPanel",
},
{
name = "tablet_ipad",
w = 1024,
h = 710,
inset = 58,
touch = true,
attrs = { Money = 98765, Bought = 15, Carry = 2 },
},
shot("phone_main", PHONE, { Money = 85, Bought = 4, Carry = 1, Hand = "Gimbap", Tut = 0 }, { toast = true }),
shot("phone_tut", PHONE, { Money = 15, Bought = 0, Tut = 3 }),
shot("phone_shop", PHONE, { Money = 150, Bought = 5 }, { open = "shop" }),
shot("phone_settings", PHONE, { Money = 150, Bought = 5 }, { open = "settings" }),
shot(
"phone_kitchen_menu",
PHONE,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1,Gimbap=2", Tut = 1 },
{ kitchen = { menu = nil } }
),
shot(
"phone_kitchen_tteok",
PHONE,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
{ kitchen = { menu = "Tteokbokki", step = 3, frac = 0.5 } }
),
shot("pc_main", PC, { Money = 1234, Bought = 4, Carry = 1, Hand = "Tteokbokki" }, { toast = true }),
shot("pc_buyable", PC, { Money = 160, Bought = 5, Carry = 0, Tut = 0 }),
shot("pc_shop", PC, { Money = 760, Bought = 12, Double = true }, { open = "shop" }),
shot("pc_settings", PC, { Money = 760, Bought = 12, Dev = true }, { open = "settings" }),
shot(
"pc_kitchen_menu",
PC,
{ Money = 300, Bought = 13, Orders = "Gimbap=1,Sundae=2,Eomuk=1" },
{ kitchen = { menu = nil } }
),
shot(
"pc_kitchen_gimbap",
PC,
{ Money = 300, Bought = 13, Orders = "Gimbap=1" },
{ kitchen = { menu = "Gimbap", step = 2, frac = 0.6 } }
),
shot(
"pc_kitchen_sundae",
PC,
{ Money = 300, Bought = 13, Orders = "Sundae=1" },
{ kitchen = { menu = "Sundae", step = 2, frac = 0.7 } }
),
shot(
"pc_kitchen_eomuk",
PC,
{ Money = 300, Bought = 13, Orders = "Eomuk=1" },
{ kitchen = { menu = "Eomuk", step = 2, frac = 0.4 } }
),
shot(
"pc_kitchen_twigim",
PC,
{ Money = 300, Bought = 17, Orders = "Twigim=1" },
{ kitchen = { menu = "Twigim", step = 3, frac = 0.5 } }
),
shot(
"pc_kitchen_done",
PC,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
{ kitchen = { menu = "Tteokbokki", step = "done" } }
),
shot(
"tablet_ipad",
{ w = 1024, h = 710, inset = 58, touch = true },
{ Money = 98765, Bought = 15, Carry = 2, Hand = "Eomuk,Sundae" }
),
}
local shots = {}
@@ -210,14 +230,32 @@ for _, s in SHOTS do
if s.attrs.Tut == nil then
state:SetAttribute("Tut", 0)
end
if s.name == "phone_iphone15" or s.name == "pc_1366" then
if s.toast then
hud.notify("purchased", { item = "Stove1" })
end
if s.open then
hud.open(if s.open == "Panel" then "shop" else "settings")
hud.open(s.open)
end
local k = s.kitchen
if k then
hud.open("kitchen")
if k.menu then
hud.kitchen.choose(k.menu)
local r = Recipes.LIST[k.menu]
local cook = hud.kitchen.flow().cook
for i, st in r.steps do
local need = Recipes.need(st, cook)
if k.step == "done" or i < k.step then
hud.kitchen.input(st.kind, need)
elseif i == k.step then
hud.kitchen.input(st.kind, need * k.frac)
break
end
end
end
end
hud.refresh()
task.wait(0.2)
task.wait(0.3)
local zones = Layout.touchZones(s.w, s.h)
table.insert(shots, {
name = s.name,
@@ -233,4 +271,5 @@ 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 })

View File

@@ -26,7 +26,9 @@ local function section(name: string)
end
local Economy = require(ReplicatedStorage.Shared.Economy)
local Icons = require(ReplicatedStorage.Shared.Icons)
local Locale = require(ReplicatedStorage.Shared.Locale)
local Recipes = require(ReplicatedStorage.Shared.Recipes)
section("맵")
local World = require(Server.World)
@@ -98,7 +100,10 @@ local customers = 0
for _, ch in dyn:GetChildren() do
if ch.Name == "Customer" then
customers += 1
check(ch:FindFirstChild("Order", true) ~= nil, "손님 주문 말풍선")
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명")
@@ -107,13 +112,23 @@ 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(c:cook(), "Tteokbokki", "조리")
eq(owner:GetAttribute("Orders"), "Tteokbokki=1", "요리 창에 보여 줄 주문 수")
eq(c:cook("Gimbap"), nil, "주문 없는 메뉴(김밥)는 못 만듦")
eq(c:cook("Tteokbokki"), "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), 10, "서빙 10원")
eq(owner:GetAttribute("Money"), 10, "돈 10")
eq(data.Money, 10, "세이브 데이터 돈 10")
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()
@@ -398,7 +413,6 @@ eq(
section("화면 UI(서버에서 생성)")
local Hud = require(StarterPlayer.StarterPlayerScripts.Client.Hud)
local Icons = require(ReplicatedStorage.Shared.Icons)
local state = Instance.new("Folder")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Money", 25)
@@ -415,42 +429,57 @@ 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, "25", "돈 표시(숫자만, 동전 그림 옆)")
local nextCard = root:FindFirstChild("Next") :: Frame
local nextTitle = nextCard:FindFirstChild("Title", true) :: TextLabel
eq(nextTitle.Text, "김밥 해금", "다음 업그레이드")
eq(
(nextCard:FindFirstChild("Tab", true):FindFirstChild("Text") :: TextLabel).Text,
"다음 업그레이드",
"카드 이름표"
)
local nextIcon = nextCard:FindFirstChild("IconBox", true):FindFirstChild("Icon") :: ImageLabel
eq(nextIcon.Image, Icons.ASSET, "다음 업그레이드 아이콘 그림")
eq(nextIcon.ImageRectOffset, Icons.OFFSET.Gimbap, "김밥 해금 아이콘")
check((root:FindFirstChild("Hint") :: Frame).Visible, "튜토리얼 안내 보임")
eq((nextCard:FindFirstChild("Cost", true) :: TextLabel).Text, "25 / 40", "진행 막대 글자")
local hintFrame = root:FindFirstChild("Hint") :: Frame
check(hintFrame.Visible, "튜토리얼 말풍선 보임")
check(hintFrame:FindFirstChild("Mascot") ~= nil, "말풍선에 마스코트")
check((nextCard:FindFirstChild("Pointer") :: ImageLabel).Visible, "튜토리얼 3: [사기] 가리키는 손")
local buyBtn = nextCard:FindFirstChild("Buy") :: TextButton
eq(label(buyBtn), "사기", "사기 버튼 글자")
check(not (buyBtn:FindFirstChild("Shine", true) :: Frame).Visible, "돈이 모자라면 반짝임 없음")
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
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 업그레이드 배지 없음")
eq(label(listButton), "상점", "상점 버튼 글자(짧게)")
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 상점 배지 없음")
state:SetAttribute("Money", 60)
check((buyBtn:FindFirstChild("Shine", true) :: Frame).Visible, "살 수 있으면 [사기] 반짝임")
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 업그레이드 버튼에 ! 배지")
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원", "늘어난 돈")
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, "아이콘 칸 위치")
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(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, "오른쪽 위 설정 버튼")
eq(label(settingsBtn), "Settings", "설정 버튼 글자")
local settingsPanel = root:FindFirstChild("SettingsPanel") :: Frame
check(settingsPanel ~= nil and not settingsPanel.Visible, "설정 창은 처음엔 닫힘")
for _, l in { "auto", "ko", "en", "ja", "zh" } do
@@ -462,26 +491,29 @@ state:SetAttribute("Sfx", false)
eq(label(settingsPanel:FindFirstChild("Sfx")), "Off", "효과음 끔 표시")
check(not hud.menuOpen(), "창 닫힘")
hud.open("shop")
check(hud.menuOpen() and (root:FindFirstChild("Panel") :: Frame).Visible, "업그레이드 창 열기")
check((root:FindFirstChild("Dim") :: Frame).Visible, "창 뒤 어둡게")
local rowsFrame = root:FindFirstChild("Panel"):FindFirstChild("List", true) :: ScrollingFrame
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
end
end
eq(n1, 10, "상점: 지금 단계 10개가 한 화면에(넘기지 않음)")
check(
rowsFrame:FindFirstChild("Row2"):FindFirstChild("BuyRow") ~= nil,
"목록의 다음 업그레이드에 사기 버튼"
)
check(rowsFrame:FindFirstChild("Row1"):FindFirstChild("Done") ~= nil, "산 업그레이드는 체크 표시")
check(
rowsFrame:FindFirstChild("Row5"):FindFirstChild("IconBox"):FindFirstChild("Lock") ~= nil,
"잠긴 업그레이드 자물쇠"
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") :: Frame).Visible, "창 닫기")
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, "다 사면 돈 부스트 숨김")
check(root:FindFirstChild("Dev") == nil, "개발자 버튼은 설정 창 안으로")
local devMoneyBtn = settingsPanel:FindFirstChild("devMoney") :: TextButton
check(not devMoneyBtn.Visible, "개발자 버튼은 기본으로 숨김")
local setH = settingsPanel.Size.Y.Offset
@@ -490,7 +522,7 @@ check(devMoneyBtn.Visible, "게임 주인에게 개발자 버튼(설정 창)")
check(settingsPanel.Size.Y.Offset > setH, "개발자 줄만큼 설정 창이 길어짐")
local doubleBtn = root:FindFirstChild("Double") :: TextButton
check(doubleBtn.Visible, "2배 수익 버튼(상품 ID 설정됨)")
eq(label(doubleBtn), "Double Money", "2배 수익 버튼 글자")
eq(label(doubleBtn), "2x Cash", "2배 수익 버튼 글자")
state:SetAttribute("Double", true)
eq(label(doubleBtn), "Active", "2배 수익 산 뒤")
check((doubleBtn:FindFirstChild("Owned") :: ImageLabel).Visible, "2배 수익 산 뒤 체크")
@@ -502,7 +534,17 @@ eq(
Icons.OFFSET.check,
"구매 알림 아이콘"
)
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 결제 버튼은 왼쪽 위, 마우스 줄 숨김
for _ = 1, 5 do
hud.notify("purchased", { item = "Table2" })
end
local toastCount = 0
for _, ch in root.Toasts:GetChildren() do
if ch:IsA("Frame") then
toastCount += 1
end
end
check(toastCount <= 3, `알림은 3개까지만 쌓임 ({toastCount})`)
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 버튼 묶음은 왼쪽 위, 마우스 줄 숨김
hud.setLayout(Vector2.new(750, 332), true)
local lay = hud.layout()
local scaleObj = root:FindFirstChildOfClass("UIScale") :: UIScale
@@ -528,7 +570,130 @@ check((settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "PC:
check(math.abs(scaleObj.Scale - math.min(1366 / 1100, 710 / 620)) < 1e-6, "PC: 배율(상단 바 뺀 높이 기준)")
hud.destroy()
section("조리 버튼(클라이언트 모듈)")
section("요리 창(메뉴 고르기 → 조리 과정 → 완성)")
local kstate = Instance.new("Folder")
kstate:SetAttribute("Lang", "ko")
kstate:SetAttribute("Money", 0)
kstate:SetAttribute("Bought", 6) -- 떡볶이·김밥·순대 해금
kstate:SetAttribute("Tut", 1)
kstate:SetAttribute("Orders", "Gimbap=2")
local ksent = {}
local khud = Hud.build(Instance.new("Folder"), kstate, function(kind, arg)
table.insert(ksent, { kind, arg })
end)
local kroot = khud.gui:FindFirstChild("Root") :: Frame
local kitchen = khud.kitchen
local kframe = kroot:FindFirstChild("Kitchen") :: Frame
check(not kframe.Visible, "요리 창은 처음엔 닫힘")
khud.open("kitchen")
check(kframe.Visible and kitchen.isOpen() and khud.menuOpen(), "요리 창 열림(커서 풀림)")
check((kroot:FindFirstChild("Dim") :: TextButton).Visible, "요리 창 뒤 어둡게")
local menuPage = kframe:FindFirstChild("MenuPage", true) :: Frame
check(menuPage.Visible, "처음엔 메뉴 고르기")
local function menuCard(m: string): Frame
return menuPage:FindFirstChild("Menu_" .. m, true) :: Frame
end
for _, m in Economy.MENU_ORDER do
check(menuCard(m) ~= nil, `메뉴 카드 {m}`)
end
check((menuCard("Gimbap"):FindFirstChild("Orders", true) :: Frame).Visible, "주문 있는 김밥에 손님 표시")
eq((menuCard("Gimbap"):FindFirstChild("Orders", true):FindFirstChild("Text") :: TextLabel).Text, "x2", "주문 수 2")
check(
not (menuCard("Tteokbokki"):FindFirstChild("Orders", true) :: Frame).Visible,
"주문 없는 떡볶이는 표시 없음"
)
check((menuCard("Eomuk"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "안 산 어묵은 자물쇠")
check(not (menuCard("Sundae"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "산 순대는 자물쇠 없음")
check(
(menuPage:FindFirstChild("Pointer") or menuCard("Gimbap"):FindFirstChild("Pointer", true)) ~= nil,
"튜토리얼 손가락"
)
eq(kitchen.choose("Tteokbokki"), false, "주문 없는 메뉴는 못 고름")
eq(kitchen.choose("Eomuk"), false, "안 산 메뉴는 못 고름")
eq(kitchen.choose("Gimbap"), true, "김밥 고름")
local cookPage = kframe:FindFirstChild("CookPage", true) :: Frame
check(cookPage.Visible and not menuPage.Visible, "조리 화면으로")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "김 위에 재료를 올려요", "1단계 안내")
check(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).Image == Icons.KITCHEN_ASSET,
"조리 도구 그림(도마)"
)
eq((cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset, Icons.KITCHEN.board, "김밥은 도마")
local flowK = kitchen.flow()
local need1 = flowK.need
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1}번`, "톡톡 남은 횟수")
eq(kitchen.input("hold", 1), nil, "다른 동작은 무시")
eq(kitchen.input("tap", 1), "progress", "톡 1")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1 - 1}번`, "남은 횟수 줄어듦")
local strip1 = cookPage:FindFirstChild("Strip1", true) :: Frame
check(strip1 ~= nil and strip1.Visible, "누를 때마다 재료가 올라감")
for _ = 2, need1 do
kitchen.input("tap", 1)
end
eq(flowK.step, 2, "2단계(말기)")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "돌돌 말아요", "2단계 안내")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, "문질문질!", "문지르기 안내")
eq(kitchen.input("rub", flowK.need), "step", "다 문지름 → 3단계")
check((cookPage:FindFirstChild("Roll", true) :: ImageLabel).Visible, "김밥이 말림")
eq(#ksent, 0, "완성 전에는 서버에 안 보냄")
eq(kitchen.input("tap", flowK.need), "done", "썰기 끝 → 완성")
eq(ksent[1] and ksent[1][1], "cook", "서버에 cook")
eq(ksent[1] and ksent[1][2], "Gimbap", "고른 메뉴를 보냄")
local donePage = kframe:FindFirstChild("DonePage", true) :: Frame
check(donePage.Visible, "완성 화면")
eq((donePage:FindFirstChild("Dish") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Gimbap, "완성 접시 그림")
-- 주문이 남아 있고 손에 자리가 있으면 다시 메뉴 고르기, 아니면 닫힘
kstate:SetAttribute("Orders", "Gimbap=1")
kstate:SetAttribute("Carry", 0)
task.wait(1.5)
check(kitchen.isOpen() and menuPage.Visible, "주문이 남으면 다음 접시 고르기")
kitchen.choose("Gimbap")
for _ = 1, 20 do
local st = Recipes.current(kitchen.flow())
if not st then
break
end
kitchen.input(st.kind, kitchen.flow().need)
end
kstate:SetAttribute("Carry", 1) -- 손이 꽉 참(쟁반 없음)
kstate:SetAttribute("Orders", "")
task.wait(1.5)
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("Carry", 0)
kstate:SetAttribute("Orders", `{m}=1`)
khud.open("kitchen")
check(kitchen.choose(m), `{m} 고름`)
eq(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset,
Icons.KITCHEN[Recipes.LIST[m].stage],
`{m} 조리 도구 그림`
)
local guard = 0
while kitchen.flow().phase == "cook" and guard < 10 do
local st = Recipes.current(kitchen.flow()) :: Recipes.Step
check(
Icons.OFFSET[({ roll = "mat", fire = "flame", skewer = "Eomuk" } :: any)[st.tool] or st.tool] ~= nil,
`{m} 도구 그림 {st.tool}`
)
kitchen.input(st.kind, kitchen.flow().need)
guard += 1
end
eq(kitchen.flow().phase, "done", `{m} 완성`)
eq(ksent[#ksent][2], m, `{m} 서버에 보냄`)
khud.open(nil)
check(not kitchen.isOpen(), `{m} 창 닫기`)
end
-- 요리 창은 화면 안에(휴대폰)
khud.setLayout(Vector2.new(667, 317), true)
local kl = khud.layout().kitchen
check(kl.x >= 0 and kl.y >= 0 and kl.x + kl.w <= khud.layout().width + 1e-6, "휴대폰: 요리 창 화면 안")
khud.destroy()
section("조리대 버튼(클라이언트 모듈)")
local Stove = require(StarterPlayer.StarterPlayerScripts.Client.Stove)
local stove = slots[3].refs.stove
local pstate = Instance.new("Folder")
@@ -536,10 +701,9 @@ pstate:SetAttribute("Lang", "ko")
local prompt = Stove.attach(stove, pstate, function() end)
check(not prompt.Enabled, "주문 없으면 버튼 꺼짐")
stove:SetAttribute("CookMenu", "Gimbap")
stove:SetAttribute("CookTime", 1.5)
check(prompt.Enabled, "주문 있으면 버튼 켜짐")
eq(prompt.ActionText, "🍙 김밥 만들기", "버튼 글자")
eq(prompt.HoldDuration, 1.5, "누르는 시간")
eq(prompt.ActionText, "요리하기", "버튼 글자")
eq(prompt.HoldDuration, 0, "누르면 바로 요리 창(꾹 누르지 않음)")
prompt:Destroy()
section("효과음(직접 만든 오디오 에셋)")
@@ -556,17 +720,16 @@ for name, id in Sounds do
end
end
section("UI 아이콘 그림(직접 그린 이미지 에셋)")
do
local Icons = require(ReplicatedStorage.Shared.Icons)
local num = tonumber(string.match(Icons.ASSET, "%d+"))
section("UI 그림(직접 그린 이미지 에셋)")
for _, asset in { Icons.ASSET, Icons.KITCHEN_ASSET } do
local num = tonumber(string.match(asset, "%d+"))
local okInfo, info = pcall(function()
return game:GetService("MarketplaceService"):GetProductInfoAsync(num :: number, Enum.InfoType.Asset)
end)
check(okInfo, "아이콘 그림 정보 조회")
check(okInfo, `그림 {num} 정보 조회`)
if okInfo then
eq(info.AssetTypeId, 1, "아이콘 그림은 이미지")
eq(info.Creator.CreatorTargetId, game.CreatorId, "아이콘 그림은 게임 주인 소유")
eq(info.AssetTypeId, 1, `그림 {num}은 이미지`)
eq(info.Creator.CreatorTargetId, game.CreatorId, `그림 {num}은 게임 주인 소유`)
end
end

View File

@@ -6,6 +6,7 @@
python3 tools/cloud.py products # 게임패스·개발자 상품 만들기(이미 있으면 건너뜀)
python3 tools/cloud.py place # 서버 인원 6명, 설명 설정
python3 tools/cloud.py audio sfx/coin.ogg "이름" # 효과음 업로드, 에셋 ID 출력
python3 tools/cloud.py image art/kitchen.png "이름" # 그림 업로드, 에셋 ID 출력
API 키는 ~/.config/ejclaw/secrets.json 의 roblox.opencloud/bunsik-tycoon 에서 읽습니다.
"""
@@ -145,11 +146,12 @@ def place():
return request("PATCH", url, body)
def upload_audio(path, name):
def upload_audio(path, name, asset_type="Audio", mime="audio/ogg",
description="Bunsik Tycoon sound effect (synthesized, original)."):
meta = {
"assetType": "Audio",
"assetType": asset_type,
"displayName": name,
"description": "Bunsik Tycoon sound effect (synthesized, original).",
"description": description,
"creationContext": {"creator": {"userId": str(CREATOR_USER)}},
}
boundary = "----bunsik" + str(int(time.time() * 1000))
@@ -158,7 +160,7 @@ def upload_audio(path, name):
body = (f"--{boundary}\r\nContent-Disposition: form-data; name=\"request\"\r\n"
f"Content-Type: application/json\r\n\r\n{json.dumps(meta)}\r\n").encode()
body += (f"--{boundary}\r\nContent-Disposition: form-data; name=\"fileContent\"; "
f"filename=\"{os.path.basename(path)}\"\r\nContent-Type: audio/ogg\r\n\r\n").encode()
f"filename=\"{os.path.basename(path)}\"\r\nContent-Type: {mime}\r\n\r\n").encode()
body += data + f"\r\n--{boundary}--\r\n".encode()
op = request("POST", "https://apis.roblox.com/assets/v1/assets", body, f"multipart/form-data; boundary={boundary}")
for _ in range(60):
@@ -179,6 +181,10 @@ def main(argv):
if argv[:1] == ["audio"]:
print(upload_audio(argv[1], argv[2]))
return 0
if argv[:1] == ["image"]:
# 그림 업로드(화면 UI 그림 모음). 에셋 ID 출력
print(upload_audio(argv[1], argv[2], "Image", "image/png", "Bunsik Tycoon UI art (drawn in code, original)."))
return 0
if argv[:1] == ["asset"]:
print(json.dumps(asset_status(argv[1]), ensure_ascii=False))
return 0

View File

@@ -5,7 +5,7 @@ cairo로 그립니다. 서버에서는 실제 화면을 볼 수 없어서 배치
지원: Frame/TextLabel/TextButton/ImageLabel/ImageButton/ScrollingFrame, UDim2·AnchorPoint·Rotation·ZIndex,
UICorner, UIStroke(테두리·글자), UIGradient(색·투명도·회전·오프셋), UIPadding, UIListLayout, UIScale,
UITextSizeConstraint, TextScaled/TextWrapped/정렬, ImageRectOffset/Size, ClipsDescendants.
UITextSizeConstraint, SizeConstraint, TextScaled/TextWrapped/정렬, ImageRectOffset/Size, ClipsDescendants.
python3 tools/gui_render.py dump.json out_dir [--bg scene.png]
"""
@@ -200,8 +200,9 @@ class Renderer:
kids = [ch for ch in node.get("children", []) if ch.get("Visible", True)]
for ch in kids:
s = ch.get("UIScale", 1)
cw = udim(ch["Size"][0], w, k) * s
chh = udim(ch["Size"][1], h, k) * s
sc = ch.get("SizeConstraint", "RelativeXY")
cw = udim(ch["Size"][0], h if sc == "RelativeYY" else w, k) * s
chh = udim(ch["Size"][1], w if sc == "RelativeXX" else h, k) * s
ar = ch.get("UIAspectRatio")
if ar:
if cw / max(chh, 1e-6) > ar:

View File

@@ -659,6 +659,407 @@ def hand(c):
fill_stroke(c, lin(0, 6, 0, 122, "#ffe9d0", "#f5c89a"))
# ---------------------------------------------------------------- 요리 화면 재료·도구 (칸 32~63)
def ellipse(c, cx, cy, rx, ry):
c.save()
c.translate(cx, cy)
c.scale(rx, ry)
c.arc(0, 0, 1, 0, 2 * math.pi)
c.restore()
def bowl(c, top, inner, lw=LW):
"""옆에서 본 둥근 그릇. inner: 그릇 안 음식 색(위쪽 타원)."""
c.move_to(12, 60)
c.line_to(116, 60)
c.curve_to(114, 98, 92, 116, 64, 116)
c.curve_to(36, 116, 14, 98, 12, 60)
c.close_path()
fill_stroke(c, lin(0, 60, 0, 116, *top), lw)
ellipse(c, 64, 60, 52, 14)
fill_stroke(c, rgb(inner), 5)
def rice_cake(c):
# 떡 한 개(가로)
rrect(c, 14, 44, 100, 40, 20)
fill_stroke(c, lin(0, 44, 0, 84, "#fff8ee", "#f3e3cc"))
rrect(c, 26, 52, 44, 8, 4)
c.set_source_rgba(1, 1, 1, 0.9)
c.fill()
def rice_cake_red(c):
# 양념 묻은 떡
rrect(c, 14, 44, 100, 40, 20)
fill_stroke(c, lin(0, 44, 0, 84, "#ff8a6a", "#d92f1c"))
rrect(c, 26, 52, 44, 8, 4)
c.set_source_rgba(1, 1, 1, 0.6)
c.fill()
def rice_cakes(c):
# 떡이 담긴 그릇(누르는 도구)
for x, y, a in ((42, 46, -0.5), (64, 36, 0.2), (86, 46, 0.5), (54, 52, 0.1), (76, 54, -0.3)):
c.save()
c.translate(x, y)
c.rotate(a)
rrect(c, -18, -8, 36, 16, 8)
c.restore()
fill_stroke(c, lin(0, y - 8, 0, y + 8, "#ffffff", "#efdcc2"), 4)
bowl(c, ("#8fd3ff", "#3b82f6"), "#f3e3cc")
shine(c, 30, 84, 6, 12, 0.5)
def sauce_bowl(c):
# 고추장 양념 그릇 + 숟가락
c.set_line_cap(cairo.LINE_CAP_ROUND)
for w, col in ((14 + LW, INK), (12, rgb("#e2e8f0"))):
c.move_to(78, 54)
c.line_to(110, 10)
c.set_line_width(w)
c.set_source_rgb(*col)
c.stroke()
bowl(c, ("#ffffff", "#cbd5e1"), "#e8341c")
shine(c, 40, 56, 14, 4, 0.5)
shine(c, 30, 84, 6, 12, 0.5)
def sauce_blob(c):
# 팬에 부은 빨간 양념(넓은 타원, 테두리 없음)
ellipse(c, 64, 64, 62, 46)
c.set_source(rad(64, 64, 64, "#ff6a4a", "#e8341c", "#c41e10"))
c.fill()
for x, y, r in ((40, 50, 6), (80, 70, 5), (60, 84, 4), (90, 46, 4)):
c.arc(x, y, r, 0, 2 * math.pi)
c.set_source_rgba(1, 0.8, 0.7, 0.55)
c.fill()
def spatula(c):
# 볶음 주걱(대각선)
c.save()
c.translate(64, 64)
c.rotate(-0.75)
rrect(c, -6, -10, 12, 72, 6)
fill_stroke(c, lin(-6, 0, 6, 0, "#e0a96d", "#a8662e"), 5)
rrect(c, -22, -60, 44, 54, 14)
fill_stroke(c, lin(0, -60, 0, -6, "#fff3c4", "#ffb84a"), 6)
for dx in (-8, 0, 8):
rrect(c, dx - 2, -50, 4, 30, 2)
c.set_source_rgba(*INK, 0.35)
c.fill()
c.restore()
def bubble(c):
c.arc(64, 64, 40, 0, 2 * math.pi)
c.set_source_rgba(1, 1, 1, 0.35)
c.fill_preserve()
c.set_source_rgba(1, 1, 1, 0.95)
c.set_line_width(8)
c.stroke()
shine(c, 50, 48, 10, 7, 0.9)
def steam(c):
c.set_line_cap(cairo.LINE_CAP_ROUND)
for w, col in ((18, (0.62, 0.72, 0.85, 0.8)), (11, (1, 1, 1, 1))):
for x in (34, 64, 94):
c.move_to(x, 118)
c.curve_to(x - 22, 92, x + 22, 70, x, 44)
c.curve_to(x - 14, 30, x + 10, 18, x, 8)
c.set_source_rgba(*col)
c.set_line_width(w)
c.stroke()
def fillings(c):
# 김밥 재료 쟁반(단무지·당근·시금치·달걀·햄)
rrect(c, 8, 70, 112, 40, 14)
fill_stroke(c, lin(0, 70, 0, 110, "#ffe9c7", "#e6b77a"))
for i, col in enumerate(("#ffe14a", "#ff8c1a", "#3fae49", "#fff3a0", "#ff8fa3")):
x = 18 + i * 20
rrect(c, x, 22 + (i % 2) * 8, 14, 62, 7)
fill_stroke(c, rgb(col), 4)
def mat(c):
# 김발(대나무 말이)
rrect(c, 10, 22, 108, 84, 10)
fill_stroke(c, lin(0, 22, 0, 106, "#d9f2a4", "#94c25a"))
for i in range(1, 9):
x = 10 + i * 12
c.move_to(x, 26)
c.line_to(x, 102)
c.set_source_rgba(*INK, 0.35)
c.set_line_width(3)
c.stroke()
shine(c, 30, 36, 12, 6, 0.6)
def knife(c):
c.save()
c.translate(64, 64)
c.rotate(-0.6)
rrect(c, -10, 18, 20, 44, 8)
fill_stroke(c, lin(-10, 0, 10, 0, "#7c4a24", "#4a2a12"), 5)
c.move_to(-14, 20)
c.line_to(-14, -46)
c.curve_to(-14, -60, 4, -64, 16, -52)
c.line_to(16, 20)
c.close_path()
fill_stroke(c, lin(-14, 0, 16, 0, "#ffffff", "#cbd5e1", "#94a3b8"), 6)
rrect(c, -8, -44, 6, 50, 3)
c.set_source_rgba(1, 1, 1, 0.8)
c.fill()
c.restore()
def gimbap_slice(c):
c.arc(64, 64, 52, 0, 2 * math.pi)
fill_stroke(c, rgb("#1f2a1f"))
c.arc(64, 64, 40, 0, 2 * math.pi)
c.set_source_rgb(1, 1, 1)
c.fill()
for dx, dy, col in ((-12, -10, "#ff8c1a"), (12, -8, "#ffd23a"), (0, 12, "#3fae49"), (-14, 12, "#ff8fa3"), (14, 12, "#fff3a0")):
c.arc(64 + dx, 64 + dy, 9, 0, 2 * math.pi)
c.set_source_rgb(*rgb(col))
c.fill()
def sundae_raw(c):
# 접시에 담긴 통순대(누르는 도구)
ellipse(c, 64, 92, 58, 22)
fill_stroke(c, lin(0, 70, 0, 114, "#ffffff", "#cbd5e1"))
c.move_to(20, 84)
c.curve_to(14, 40, 70, 30, 72, 60)
c.curve_to(74, 84, 108, 84, 110, 60)
c.set_line_cap(cairo.LINE_CAP_ROUND)
for w, col in ((30 + LW, INK), (30, rgb("#5a2e3c"))):
c.move_to(20, 84)
c.curve_to(14, 40, 70, 30, 72, 60)
c.curve_to(74, 84, 108, 84, 110, 60)
c.set_line_width(w)
c.set_source_rgb(*col)
c.stroke()
c.move_to(24, 70)
c.curve_to(24, 48, 60, 40, 64, 56)
c.set_line_width(5)
c.set_source_rgba(1, 1, 1, 0.45)
c.stroke()
def sundae_piece(c):
# 순대 한 토막(옆)
rrect(c, 10, 40, 108, 48, 24)
fill_stroke(c, lin(0, 40, 0, 88, "#8a5a6a", "#5a2e3c", "#3a1a24"))
rrect(c, 24, 48, 50, 8, 4)
c.set_source_rgba(1, 1, 1, 0.4)
c.fill()
def sundae_slice(c):
c.arc(64, 64, 50, 0, 2 * math.pi)
fill_stroke(c, rad(64, 64, 54, "#8a5a6a", "#5a2e3c", "#3a1a24"))
for dx, dy in ((-16, -12), (12, -16), (16, 10), (-10, 16), (0, 0), (-20, 4)):
c.arc(64 + dx, 64 + dy, 6, 0, 2 * math.pi)
c.set_source_rgba(1, 0.85, 0.8, 0.7)
c.fill()
def fish_cake(c):
# 납작한 어묵 한 장(누르는 도구)
c.save()
c.translate(64, 64)
c.rotate(-0.15)
rrect(c, -52, -36, 104, 72, 14)
c.restore()
fill_stroke(c, lin(0, 28, 0, 100, "#ffe2a8", "#f2b46b", "#d98a3a"))
c.save()
c.translate(64, 64)
c.rotate(-0.15)
rrect(c, -40, -26, 50, 8, 4)
c.restore()
c.set_source_rgba(1, 1, 1, 0.6)
c.fill()
def batter(c):
# 튀김옷 그릇
bowl(c, ("#ffd1dc", "#ff7aa2"), "#fff6d6")
for x, y in ((48, 58), (76, 62), (62, 56)):
c.arc(x, y, 4, 0, 2 * math.pi)
c.set_source_rgba(*INK, 0.2)
c.fill()
shine(c, 30, 84, 6, 12, 0.5)
def shrimp(c, body, tail, dots):
c.save()
c.translate(64, 64)
c.rotate(-0.5)
c.move_to(-54, 0)
c.curve_to(-54, -28, 30, -28, 40, -6)
c.line_to(40, 6)
c.curve_to(30, 28, -54, 28, -54, 0)
c.close_path()
c.restore()
fill_stroke(c, body)
c.save()
c.translate(64, 64)
c.rotate(-0.5)
polygon(c, [(38, -2), (60, -20), (54, 0), (60, 20), (38, 2)])
c.restore()
fill_stroke(c, rgb(tail), 5)
if dots:
for x, y in ((36, 72), (50, 64), (64, 56), (46, 82), (60, 74), (74, 66), (30, 62)):
c.arc(x, y, 3.5, 0, 2 * math.pi)
c.set_source_rgba(1, 1, 1, 0.6)
c.fill()
def shrimp_raw(c):
shrimp(c, lin(20, 20, 110, 110, "#ffd0c2", "#ff9e8a", "#f07a66"), "#ff6b4a", False)
for i in range(4):
c.save()
c.translate(64, 64)
c.rotate(-0.5)
c.move_to(-30 + i * 16, -16)
c.curve_to(-26 + i * 16, -4, -26 + i * 16, 4, -30 + i * 16, 16)
c.restore()
c.set_source_rgba(*INK, 0.3)
c.set_line_width(3)
c.stroke()
def shrimp_batter(c):
shrimp(c, lin(20, 20, 110, 110, "#fffdf2", "#fff1c9", "#f5dfa0"), "#ff6b4a", True)
def tongs(c):
c.set_line_cap(cairo.LINE_CAP_ROUND)
c.set_line_join(cairo.LINE_JOIN_ROUND)
for w, col in ((14 + LW, INK), (14, rgb("#cbd5e1"))):
c.move_to(40, 118)
c.line_to(30, 20)
c.line_to(54, 10)
c.move_to(88, 118)
c.line_to(98, 20)
c.line_to(74, 10)
c.set_line_width(w)
c.set_source_rgb(*col)
c.stroke()
rrect(c, 30, 96, 68, 22, 10)
fill_stroke(c, lin(0, 96, 0, 118, "#ff8a5a", "#d92f1c"), 6)
def customer(c):
# 손님 얼굴(주문 수 표시)
c.arc(64, 70, 46, 0, 2 * math.pi)
fill_stroke(c, rad(64, 70, 50, "#fff1e0", "#ffd7b0", "#f5b885"))
c.move_to(18, 64)
c.curve_to(18, 10, 110, 10, 110, 64)
c.curve_to(96, 40, 40, 36, 18, 64)
c.close_path()
fill_stroke(c, lin(0, 20, 0, 64, "#6b4a3a", "#3f2a20"), 5)
for x in (48, 80):
c.arc(x, 74, 6, 0, 2 * math.pi)
c.set_source_rgb(*INK)
c.fill()
c.arc(x + 2, 72, 2, 0, 2 * math.pi)
c.set_source_rgb(1, 1, 1)
c.fill()
c.arc(64, 88, 10, 0.15 * math.pi, 0.85 * math.pi)
c.set_source_rgb(*INK)
c.set_line_width(4)
c.stroke()
for x in (36, 92):
ellipse(c, x, 90, 8, 5)
c.set_source_rgba(1, 0.5, 0.55, 0.5)
c.fill()
def mascot_face(c):
# 떡이(떡볶이 떡 캐릭터) 얼굴 + 요리사 모자
rrect(c, 14, 40, 100, 78, 36)
fill_stroke(c, lin(0, 40, 0, 118, "#ffffff", "#ffe4d6"))
# 모자
for x, y, r in ((40, 30, 20), (64, 20, 24), (88, 30, 20)):
c.arc(x, y, r, 0, 2 * math.pi)
fill_stroke(c, rgb("#ffffff"), 5)
rrect(c, 30, 30, 68, 20, 6)
fill_stroke(c, rgb("#ffffff"), 5)
rrect(c, 34, 32, 60, 14, 4)
c.set_source_rgb(1, 1, 1)
c.fill()
# 눈·입·볼
for x in (46, 82):
ellipse(c, x, 76, 7, 9)
c.set_source_rgb(*INK)
c.fill()
c.arc(x + 2, 72, 3, 0, 2 * math.pi)
c.set_source_rgb(1, 1, 1)
c.fill()
c.move_to(54, 90)
c.curve_to(58, 102, 70, 102, 74, 90)
c.close_path()
fill_stroke(c, rgb("#ff6b6b"), 4)
for x in (32, 96):
ellipse(c, x, 92, 9, 6)
c.set_source_rgba(1, 0.45, 0.5, 0.55)
c.fill()
def heart(c):
c.move_to(64, 112)
c.curve_to(10, 74, 8, 30, 38, 22)
c.curve_to(52, 18, 62, 28, 64, 38)
c.curve_to(66, 28, 76, 18, 90, 22)
c.curve_to(120, 30, 118, 74, 64, 112)
c.close_path()
fill_stroke(c, lin(0, 20, 0, 112, "#ff9fb5", "#ff4d7a"))
shine(c, 40, 42, 10, 7, 0.7)
def cart(c):
# 상점(업그레이드) 버튼: 위쪽 화살표가 붙은 가게 차양
rrect(c, 18, 56, 92, 58, 10)
fill_stroke(c, lin(0, 56, 0, 114, "#fff7ec", "#f3d9b8"))
rrect(c, 50, 78, 28, 36, 6)
fill_stroke(c, lin(0, 78, 0, 114, "#ffb35a", "#e07a1f"), 5)
for i in range(5):
x = 10 + i * 22
c.move_to(x, 30)
c.line_to(x + 22, 30)
c.line_to(x + 22, 52)
c.curve_to(x + 22, 64, x, 64, x, 52)
c.close_path()
fill_stroke(c, rgb("#ff5a7a" if i % 2 == 0 else "#ffffff"), 5)
rrect(c, 8, 18, 112, 16, 8)
fill_stroke(c, rgb("#ff5a7a"), 5)
def pot_icon(c):
# 요리하기(냄비) 아이콘
rrect(c, 14, 50, 100, 60, 20)
fill_stroke(c, lin(0, 50, 0, 110, "#ff8a6a", "#d92f1c"))
rrect(c, 4, 58, 16, 14, 6)
fill_stroke(c, rgb("#7c4a24"), 5)
rrect(c, 108, 58, 16, 14, 6)
fill_stroke(c, rgb("#7c4a24"), 5)
ellipse(c, 64, 50, 52, 12)
fill_stroke(c, rgb("#ffcf5a"), 5)
for x in (44, 64, 84):
c.move_to(x, 34)
c.curve_to(x - 8, 24, x + 8, 16, x, 6)
c.set_source_rgba(1, 1, 1, 0.95)
c.set_line_width(6)
c.stroke()
shine(c, 32, 70, 8, 12, 0.5)
ICONS = [
("coin", coin), ("moneyBag", money_bag), ("bolt", bolt), ("gear", gear),
("upgrade", upgrade), ("plate", plate), ("lock", lock), ("check", check),
@@ -668,6 +1069,13 @@ ICONS = [
("Twigim", twigim), ("globe", globe), ("speaker", speaker), ("mouse", mouse),
("wrench", wrench), ("star", star), ("sparkle", sparkle), ("rays", rays),
("glow", glow), ("arrowDown", arrow_down), ("scroll", scroll), ("hand", hand),
("riceCake", rice_cake), ("riceCakeRed", rice_cake_red), ("riceCakes", rice_cakes), ("sauceBowl", sauce_bowl),
("sauceBlob", sauce_blob), ("spatula", spatula), ("bubble", bubble), ("steam", steam),
("fillings", fillings), ("mat", mat), ("knife", knife), ("gimbapSlice", gimbap_slice),
("sundaeRaw", sundae_raw), ("sundaePiece", sundae_piece), ("sundaeSlice", sundae_slice), ("fishCake", fish_cake),
("batter", batter), ("shrimpRaw", shrimp_raw), ("shrimpBatter", shrimp_batter), ("tongs", tongs),
("customer", customer), ("mascot", mascot_face), ("heart", heart), ("cart", cart),
("pot", pot_icon),
]

View File

@@ -0,0 +1,322 @@
#!/usr/bin/env python3
"""요리 화면의 큰 그림(조리 도구, 마스코트 떡이)을 256px 칸 4x4 한 장(art/kitchen.png)으로 직접 그립니다.
칸 이름과 위치는 src/shared/Icons.luau 의 KITCHEN 표와 같아야 합니다(--luau 로 확인).
python3 tools/kitchen_art.py # art/kitchen.png
python3 tools/kitchen_art.py --sheet x.png
"""
import math
import os
import sys
import cairo
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from icons import INK, ellipse, fill_stroke, lin, rad, rgb, rrect, shine # noqa: E402
OUT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "art", "kitchen.png")
CELL = 256
GRID = 4
LW = 9
def fs(c, paint, lw=LW):
fill_stroke(c, paint, lw)
def flame_row(c, y=236, n=4):
# 그릇 바닥을 핥는 작은 불꽃(그릇을 그린 다음에 그림)
for i in range(n):
x = 128 + (i - (n - 1) / 2) * 40
c.move_to(x, y)
c.curve_to(x - 16, y - 4, x - 12, y - 22, x - 3, y - 32)
c.curve_to(x, y - 22, x + 8, y - 24, x + 6, y - 36)
c.curve_to(x + 18, y - 20, x + 16, y - 4, x, y)
c.close_path()
fs(c, lin(0, y - 36, 0, y, "#fff36b", "#ffa51f", "#ff5a1f"), 5)
def burner(c):
# 가스 화구 받침(불꽃 아래)
rrect(c, 44, 228, 168, 22, 10)
fs(c, lin(0, 228, 0, 250, "#94a3b8", "#475569"), 7)
def pan(c):
pan_body(c)
flame_row(c)
burner(c)
def pan_body(c):
# 손잡이
rrect(c, 196, 132, 58, 22, 10)
fs(c, lin(0, 132, 0, 154, "#7c4a24", "#4a2a12"))
# 팬(위에서 비스듬히)
ellipse(c, 118, 150, 108, 52)
fs(c, lin(0, 98, 0, 202, "#4b5563", "#1f2937"))
ellipse(c, 118, 144, 92, 40)
c.set_source(lin(0, 104, 0, 184, "#6b7280", "#374151"))
c.fill()
shine(c, 70, 124, 22, 7, 0.35)
def board(c):
# 나무 도마 + 김 + 밥
rrect(c, 8, 70, 240, 150, 26)
fs(c, lin(0, 70, 0, 220, "#f5c98a", "#d99a52"))
for y in (100, 140, 180):
c.move_to(24, y)
c.curve_to(90, y - 8, 160, y + 8, 232, y)
c.set_source_rgba(*INK, 0.12)
c.set_line_width(3)
c.stroke()
rrect(c, 36, 84, 184, 122, 10)
fs(c, lin(0, 84, 0, 206, "#2e3b2e", "#141c14"), 6)
rrect(c, 46, 94, 164, 86, 18)
c.set_source(lin(0, 94, 0, 180, "#ffffff", "#f1ede4"))
c.fill()
for x, y in ((70, 110), (100, 130), (140, 112), (170, 140), (120, 160), (80, 158), (190, 108)):
ellipse(c, x, y, 6, 3.5)
c.set_source_rgba(*INK, 0.08)
c.fill()
def steamer(c):
steamer_body(c)
flame_row(c)
burner(c)
def steamer_body(c):
# 냄비 몸통 + 대나무 찜기 테두리 + 뚜껑 없음(속이 보임)
rrect(c, 34, 112, 188, 92, 22)
fs(c, lin(0, 112, 0, 204, "#e2e8f0", "#94a3b8"))
rrect(c, 22, 96, 212, 40, 18)
fs(c, lin(0, 96, 0, 136, "#f6d58e", "#d9a24a"))
for x in range(40, 230, 24):
c.move_to(x, 100)
c.line_to(x, 132)
c.set_source_rgba(*INK, 0.25)
c.set_line_width(3)
c.stroke()
ellipse(c, 128, 100, 96, 22)
fs(c, lin(0, 78, 0, 122, "#fff3d0", "#e9c983"), 6)
for x in range(48, 212, 18):
c.move_to(x, 88)
c.line_to(x, 112)
c.set_source_rgba(*INK, 0.15)
c.set_line_width(2)
c.stroke()
def pot(c):
pot_body(c)
flame_row(c)
burner(c)
def pot_body(c):
rrect(c, 12, 118, 24, 22, 8)
fs(c, rgb("#7c4a24"), 6)
rrect(c, 220, 118, 24, 22, 8)
fs(c, rgb("#7c4a24"), 6)
rrect(c, 30, 100, 196, 106, 30)
fs(c, lin(0, 100, 0, 206, "#ff8a6a", "#d92f1c"))
ellipse(c, 128, 102, 98, 26)
fs(c, lin(0, 76, 0, 128, "#ffe08a", "#f2b046"), 7)
for x, y in ((90, 98), (150, 108), (176, 94)):
c.arc(x, y, 5, 0, 2 * math.pi)
c.set_source_rgba(1, 1, 1, 0.7)
c.fill()
# 파 송송
for x, y in ((70, 104), (120, 92), (196, 104), (140, 114)):
c.arc(x, y, 6, 0, 2 * math.pi)
fs(c, rgb("#5cc95c"), 3)
shine(c, 60, 150, 10, 22, 0.35)
def fryer(c):
fryer_body(c)
flame_row(c)
burner(c)
def fryer_body(c):
rrect(c, 26, 96, 204, 112, 26)
fs(c, lin(0, 96, 0, 208, "#cbd5e1", "#64748b"))
ellipse(c, 128, 100, 100, 26)
fs(c, lin(0, 74, 0, 126, "#ffe58a", "#f5b52a"), 7)
for x, y, r in ((80, 100, 6), (120, 92, 4), (164, 104, 5), (190, 96, 4), (100, 110, 3)):
c.arc(x, y, r, 0, 2 * math.pi)
c.set_source_rgba(1, 1, 1, 0.75)
c.fill()
shine(c, 56, 150, 10, 24, 0.4)
def mascot_body(c, cheer):
# 떡이: 하얀 가래떡 몸 + 요리사 모자 + 빨간 앞치마
arm_y = 70 if cheer else 150
c.set_line_cap(cairo.LINE_CAP_ROUND)
for x0, x1 in ((62, 22), (194, 234)):
for w, col in ((26 + LW, INK), (26, rgb("#fff7ef"))):
c.move_to(x0, 150)
c.line_to(x1, arm_y)
c.set_line_width(w)
c.set_source_rgb(*col)
c.stroke()
rrect(c, 52, 70, 152, 176, 64)
fs(c, lin(0, 70, 0, 246, "#ffffff", "#ffe6da"))
# 앞치마
c.move_to(76, 176)
c.line_to(180, 176)
c.line_to(176, 234)
c.curve_to(150, 248, 106, 248, 80, 234)
c.close_path()
fs(c, lin(0, 176, 0, 244, "#ff7a8a", "#ff4d6a"), 6)
c.arc(128, 206, 10, 0, 2 * math.pi)
fs(c, rgb("#ffd23a"), 4)
# 모자
for x, y, r in ((88, 54, 34), (128, 38, 40), (168, 54, 34)):
c.arc(x, y, r, 0, 2 * math.pi)
fs(c, rgb("#ffffff"), 7)
rrect(c, 70, 58, 116, 32, 10)
fs(c, rgb("#ffffff"), 7)
rrect(c, 76, 52, 104, 30, 8)
c.set_source_rgb(1, 1, 1)
c.fill()
# 얼굴
for x in (102, 154):
if cheer:
c.arc(x, 130, 11, math.pi, 2 * math.pi)
c.set_source_rgb(*INK)
c.set_line_width(7)
c.stroke()
else:
ellipse(c, x, 128, 10, 13)
c.set_source_rgb(*INK)
c.fill()
c.arc(x + 3, 122, 4, 0, 2 * math.pi)
c.set_source_rgb(1, 1, 1)
c.fill()
c.move_to(112, 146)
c.curve_to(116, 166 if cheer else 160, 140, 166 if cheer else 160, 144, 146)
c.close_path()
fs(c, rgb("#ff6b6b"), 5)
for x in (82, 174):
ellipse(c, x, 150, 14, 9)
c.set_source_rgba(1, 0.45, 0.5, 0.55)
c.fill()
if cheer:
for x, y in ((24, 40), (232, 36), (14, 120), (242, 118)):
c.move_to(x, y - 16)
c.line_to(x + 5, y - 5)
c.line_to(x + 16, y)
c.line_to(x + 5, y + 5)
c.line_to(x, y + 16)
c.line_to(x - 5, y + 5)
c.line_to(x - 16, y)
c.line_to(x - 5, y - 5)
c.close_path()
fs(c, rgb("#ffd23a"), 4)
def mascot(c):
mascot_body(c, False)
def mascot_cheer(c):
mascot_body(c, True)
def gimbap_roll(c):
# 돌돌 만 김밥 한 줄(옆), 오른쪽 끝 단면
rrect(c, 10, 92, 220, 72, 36)
fs(c, lin(0, 92, 0, 164, "#3a4a3a", "#141c14"))
shine(c, 90, 106, 60, 6, 0.25)
c.arc(212, 128, 38, 0, 2 * math.pi)
fs(c, rgb("#1f2a1f"), 7)
c.arc(212, 128, 29, 0, 2 * math.pi)
c.set_source_rgb(1, 1, 1)
c.fill()
for dx, dy, col in ((-9, -8, "#ff8c1a"), (9, -7, "#ffd23a"), (0, 9, "#3fae49"), (-11, 9, "#ff8fa3"), (11, 9, "#fff3a0")):
c.arc(212 + dx, 128 + dy, 7, 0, 2 * math.pi)
c.set_source_rgb(*rgb(col))
c.fill()
def plate_big(c):
# 완성 접시 받침(위에서 비스듬히)
ellipse(c, 128, 150, 116, 58)
fs(c, lin(0, 92, 0, 208, "#ffffff", "#d7dde6"))
ellipse(c, 128, 146, 82, 38)
c.set_source_rgba(*INK, 0.15)
c.set_line_width(4)
c.stroke()
def burst(c):
# 완성 축하 빛(테두리 없음)
for i in range(12):
a0 = i * math.pi / 6
a1 = a0 + math.pi / 12
c.move_to(128, 128)
c.line_to(128 + 130 * math.cos(a0), 128 + 130 * math.sin(a0))
c.line_to(128 + 130 * math.cos(a1), 128 + 130 * math.sin(a1))
c.close_path()
g = cairo.RadialGradient(128, 128, 10, 128, 128, 128)
g.add_color_stop_rgba(0, 1, 0.95, 0.6, 1)
g.add_color_stop_rgba(1, 1, 0.85, 0.3, 0)
c.set_source(g)
c.fill()
BIG = [
("pan", pan), ("board", board), ("steamer", steamer), ("pot", pot),
("fryer", fryer), ("mascot", mascot), ("mascotCheer", mascot_cheer), ("gimbapRoll", gimbap_roll),
("plateBig", plate_big), ("burst", burst),
]
def draw():
surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, CELL * GRID, CELL * GRID)
for i, (name, fn) in enumerate(BIG):
c = cairo.Context(surf)
c.translate((i % GRID) * CELL, (i // GRID) * CELL)
c.rectangle(0, 0, CELL, CELL)
c.clip()
c.translate(128, 128)
c.scale(0.94, 0.94)
c.translate(-128, -128)
fn(c)
return surf
def main(argv):
surf = draw()
if "--luau" in argv:
for i, (name, _) in enumerate(BIG):
print(f"\t{name} = Vector2.new({(i % GRID) * CELL}, {(i // GRID) * CELL}),")
return
if "--sheet" in argv:
out = argv[argv.index("--sheet") + 1]
sheet = cairo.ImageSurface(cairo.FORMAT_ARGB32, CELL * GRID, CELL * GRID)
c = cairo.Context(sheet)
c.set_source_rgb(0.55, 0.75, 0.6)
c.paint()
c.set_source_surface(surf, 0, 0)
c.paint()
for i, (name, _) in enumerate(BIG):
c.set_source_rgb(0, 0, 0)
c.move_to((i % GRID) * CELL + 6, (i // GRID) * CELL + 18)
c.set_font_size(16)
c.show_text(name)
sheet.write_to_png(out)
print(out)
return
surf.write_to_png(OUT)
print(os.path.normpath(OUT))
if __name__ == "__main__":
main(sys.argv[1:])

View File

@@ -95,6 +95,14 @@ def sizzle(sec=3.0):
return s[:-fade]
def pop():
# 요리 화면 톡톡: 통통 튀는 짧은 소리(높은 음에서 빠르게 내려감)
x = t(0.12)
f = 900 * np.exp(-x * 18) + 380
phase = 2 * np.pi * np.cumsum(f) / SR
return np.sin(phase) * env(len(x), 0.001, 0.035)
def save(name, sig):
sig = sig / max(1e-9, np.max(np.abs(sig))) * 0.85
pcm = (sig * 32767).astype(np.int16)
@@ -116,6 +124,7 @@ def main():
save("buy", buy())
save("levelup", levelup())
save("sizzle", sizzle())
save("pop", pop())
if __name__ == "__main__":

View File

@@ -1,7 +1,9 @@
-- 경제 시뮬레이터 본체: 실제 게임 로직(src/shared/Shop)을 봇이 쉬지 않고 최적으로 플레이합니다.
-- 실행은 tools/sim.luau, 검사는 tests/Sim.spec.luau
-- 봇 가정: 조리대 <-> 테이블 편도 WALK/2초, 알바생이 있으면 직접 조리하지 않고 나르기만 합니다.
-- 조리 시간은 요리 화면을 쉬지 않고 했을 때의 시간(Recipes.expectedTime: 메뉴 고르기 + 단계 + 완성 연출)입니다.
local Economy = require("../src/shared/Economy")
local Recipes = require("../src/shared/Recipes")
local Shop = require("../src/shared/Shop")
local Sim = {}
@@ -31,7 +33,8 @@ function Sim.run(mult: number, limit: number): { { t: number, id: string, cost:
local canCook = not shop.stats.helper and not Shop.handFull(shop) and Shop.nextCookMenu(shop) ~= nil
if canCook then
pending = "cook"
busyUntil = t + shop.stats.cook
local menu = Shop.nextCookMenu(shop) :: string
busyUntil = t + Recipes.expectedTime(menu, shop.stats.cook)
elseif #shop.hand > 0 and (Shop.handFull(shop) or #shop.counter == 0) then
pending = "arrive_tables"
busyUntil = t + Economy.WALK / 2