// 배경 레이어 시스템 (ASCII Patrol 스타일 패럴렉스) // 각 환경은 여러 레이어로 구성되며, 레이어마다 다른 스크롤 속도를 가짐 /// 배경 레이어 데이터 class BackgroundLayer { const BackgroundLayer({ required this.lines, required this.scrollSpeed, this.yStart = 0, }); /// 레이어 패턴 (각 줄은 반복 가능한 패턴) final List lines; /// 스크롤 속도 (0.0 = 정지, 1.0 = 최고속) /// 원경일수록 느리게, 전경일수록 빠르게 final double scrollSpeed; /// 시작 Y 위치 (0~7) final int yStart; } /// 환경 타입 enum EnvironmentType { /// 마을 - 건물 실루엣 town, /// 숲 - 나무 forest, /// 동굴 - 바위 cave, /// 던전 - 벽돌 dungeon, /// 기술 - 회로 tech, /// 보이드 - 별/공허 (보스) void_, } /// TaskType과 몬스터 이름에서 환경 타입 추론 EnvironmentType inferEnvironment(String? taskType, String? monsterName) { // 마을 관련 태스크 if (taskType == 'heading' || taskType == 'buyEquip') { return EnvironmentType.town; } // 몬스터 이름에서 환경 추론 if (monsterName != null) { final lower = monsterName.toLowerCase(); // 보이드/우주 if (lower.contains('void') || lower.contains('cosmic') || lower.contains('star') || lower.contains('galaxy')) { return EnvironmentType.void_; } // 기술/사이버 if (lower.contains('cyber') || lower.contains('robot') || lower.contains('ai') || lower.contains('data') || lower.contains('server')) { return EnvironmentType.tech; } // 언데드/던전 if (lower.contains('zombie') || lower.contains('skeleton') || lower.contains('ghost') || lower.contains('undead') || lower.contains('dungeon')) { return EnvironmentType.dungeon; } // 동굴 if (lower.contains('cave') || lower.contains('bat') || lower.contains('spider') || lower.contains('worm')) { return EnvironmentType.cave; } } // 기본: 숲 return EnvironmentType.forest; }