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:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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),
|
||||
]
|
||||
|
||||
|
||||
|
||||
322
bunsik-tycoon/tools/kitchen_art.py
Normal file
322
bunsik-tycoon/tools/kitchen_art.py
Normal 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:])
|
||||
@@ -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__":
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user