From 01cca9232ce6478aa351f73d6c0d862a865c068a Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 13 Aug 2026 13:49:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=85=EC=96=91=20=EB=AA=A8=EB=8B=AC=C2=B7?= =?UTF-8?q?=EA=B3=A0=EC=96=91=EC=9D=B4=20=EC=B9=B4=EB=93=9C=EC=97=90=20?= =?UTF-8?q?=EC=8B=A4=EC=A0=9C=20=EC=8A=A4=ED=94=84=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - catSprite(breed, frame) 헬퍼 + CAT_SPRITE_DIR 품종별 폴더 매핑 준비 - 모달 후보는 idle 스프라이트(h-20), 카드 헤더는 미니 아바타(h-7) - 품종 시트가 들어오면 CAT_SPRITE_DIR 등록만으로 확장 Co-Authored-By: Claude Fable 5 --- src/components/game/Game.tsx | 18 +++++++++++++++--- src/lib/game/data.ts | 12 ++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/game/Game.tsx b/src/components/game/Game.tsx index f74bdf9..856d9f2 100644 --- a/src/components/game/Game.tsx +++ b/src/components/game/Game.tsx @@ -7,6 +7,7 @@ import { engine, effectiveRate, activeRecipe, fullnessPenalty } from "@/lib/game import { APTITUDE_LABEL, BREEDS, + catSprite, HALL_LEVELS, KITCHEN_BUILD_COST, KITCHEN_MEAL_CAP, @@ -176,7 +177,12 @@ function AdoptModal({ className="flex flex-col rounded-xl border border-gray-200 p-4 dark:border-gray-700" >
-
{cat.emoji}
+ {/* eslint-disable-next-line @next/next/no-img-element */} + {cat.name}
{cat.name}
{cat.breedName}{" "} @@ -430,8 +436,14 @@ function CatCard({ }`} >
- - {cat.emoji} {cat.name}{" "} + + {/* eslint-disable-next-line @next/next/no-img-element */} + + {cat.name}{" "} Lv{cat.level} {cat.breedName} diff --git a/src/lib/game/data.ts b/src/lib/game/data.ts index 287d4d6..13272ce 100644 --- a/src/lib/game/data.ts +++ b/src/lib/game/data.ts @@ -4,6 +4,18 @@ import type { AptitudeKey } from "./types"; export const APTITUDE_RATE = [0, 1.0, 2.2, 4.8, 10.0, 21.0, 45.0]; export const BASE_RATE = 0.2; +// 품종별 스프라이트 폴더 (public/assets/cats/{폴더}/). 미등록 품종은 기본(오렌지 태비) 사용 +export const CAT_SPRITE_DIR: Record = { + // 예: korean_shorthair: "korean_shorthair", ← 품종 시트가 준비되면 등록 +}; + +export type CatFrame = "idle" | "walk1" | "walk2" | "work"; + +export function catSprite(breed: string, frame: CatFrame): string { + const dir = CAT_SPRITE_DIR[breed]; + return dir ? `/assets/cats/${dir}/${frame}.png` : `/assets/cats/${frame}.png`; +} + // 적성별 도구 일러스트 (public/assets/tools/) export const TOOL_IMG: Record = { fishing: "/assets/tools/fishing.png",