181404010226 4 сар өмнө
parent
commit
72b0e15736
29 өөрчлөгдсөн 750 нэмэгдсэн , 2321 устгасан
  1. BIN
      UI.zip
  2. 274 211
      assets/Scenes/GameLevel.scene
  3. 2 2
      assets/resources/data/enemies.json
  4. BIN
      assets/resources/data/excel/__pycache__/config_manager.cpython-313.pyc
  5. 240 40
      assets/resources/data/excel/config_manager.py
  6. 0 127
      assets/resources/data/excel/test_excel_parse.py
  7. 0 12
      assets/resources/data/excel/test_excel_parse.py.meta
  8. 1 4
      assets/resources/data/excel/update_excel_from_json.py
  9. BIN
      assets/resources/data/excel/关卡配置/关卡配置表_完整版_更新_v2.xlsx
  10. BIN
      assets/resources/data/excel/敌人配置表.xlsx
  11. BIN
      assets/resources/data/excel/方块武器配置/方块武器配置表_更新_v2.xlsx
  12. 0 125
      assets/resources/data/excel/更新说明.md
  13. 0 11
      assets/resources/data/excel/更新说明.md.meta
  14. 0 137
      assets/resources/data/excel/自动部署工具.bat
  15. 0 12
      assets/resources/data/excel/自动部署工具.bat.meta
  16. 9 133
      assets/resources/data/levels/Level1.json
  17. 10 195
      assets/resources/data/levels/Level2.json
  18. 9 235
      assets/resources/data/levels/Level3.json
  19. 9 257
      assets/resources/data/levels/Level4.json
  20. 10 324
      assets/resources/data/levels/Level5.json
  21. 6 84
      assets/resources/data/levels/Level6.json
  22. 6 96
      assets/resources/data/levels/Level7.json
  23. 6 117
      assets/resources/data/levels/Level8.json
  24. 6 144
      assets/resources/data/levels/Level9.json
  25. 1 2
      assets/scripts/Animations/BallAni.ts
  26. 12 12
      assets/scripts/CombatSystem/EnemyComponent.ts
  27. 35 33
      assets/scripts/CombatSystem/EnemyController.ts
  28. 95 5
      assets/scripts/CombatSystem/EnemyInstance.ts
  29. 19 3
      assets/scripts/LevelSystem/LevelConfigManager.ts

BIN
UI.zip


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 274 - 211
assets/Scenes/GameLevel.scene


+ 2 - 2
assets/resources/data/enemies.json

@@ -26,7 +26,7 @@
       "range": 30,
       "attackSpeed": 0.8,
       "defense": 5,
-      "goldReward": 15
+      "goldReward": 1
     },
     {
       "id": "wandering_zombie",
@@ -40,7 +40,7 @@
       "range": 40,
       "attackSpeed": 1.2,
       "defense": 2,
-      "goldReward": 18
+      "goldReward": 1
     },
     {
       "id": "mage_zombie",

BIN
assets/resources/data/excel/__pycache__/config_manager.cpython-313.pyc


+ 240 - 40
assets/resources/data/excel/config_manager.py

@@ -509,7 +509,8 @@ class ConfigManagerGUI:
                         continue
                     
                     # 检查参数是否有效
-                    if param_name in self.param_types:
+                    param_types = self.current_mapping.get('param_types', {})
+                    if param_name in param_types:
                         try:
                             # 优先使用第3列(默认值),如果不存在则使用第2列
                             param_value = row.iloc[2] if len(row) > 2 and not pd.isna(row.iloc[2]) else row.iloc[1]
@@ -517,7 +518,7 @@ class ConfigManagerGUI:
                             if pd.isna(param_value):
                                 continue
                             
-                            param_type = self.param_types[param_name]
+                            param_type = param_types[param_name]
                             if param_type == bool:
                                 config[param_name] = str(param_value).lower() in ['true', '1', 'yes', 'on']
                             else:
@@ -526,46 +527,66 @@ class ConfigManagerGUI:
                             continue
             
             elif format_type == 'horizontal':
-                # 横向表格:第一行是参数名,下面是数据行
-                # 检查第1行是否为描述行
-                # 如果第1行的第一个单元格包含描述性文字,则跳过它
-                data_start_row = 1
-                if len(df) > 1:
-                    first_cell = str(df.iloc[1, 0]).strip()
-                    # 如果第1行第一个单元格是描述性文字,则从第2行开始
-                    if first_cell in ['唯一标识符', '描述', 'description', 'desc']:
-                        data_start_row = 2
-                    else:
-                        data_start_row = 1
-                print(f"横向表格解析: 数据起始行={data_start_row}, 总行数={len(df)}")
+                # 横向表格:第一行是参数名(列名),数据从第0行开始
+                print(f"横向表格解析: 总行数={len(df)}")
                 print(f"表格列名: {list(df.columns)}")
                 
                 # 打印前几行数据用于调试
-                for i in range(min(5, len(df))):
+                for i in range(min(3, len(df))):
                     print(f"第{i}行数据: {df.iloc[i].to_dict()}")
                 
-                # 解析多行数据(如敌人配置、武器配置等)
+                # 检查第0行是否为有效数据行
+                # 如果第0行第一个单元格是描述性文字或空值,则跳过
+                data_start_row = 0
+                if len(df) > 0:
+                    first_cell = str(df.iloc[0, 0]).strip().lower()
+                    # 跳过描述行、空行或标题行
+                    if (first_cell in ['唯一标识符', '描述', 'description', 'desc', 'nan', ''] or 
+                        first_cell == df.columns[0].lower()):
+                        data_start_row = 1
+                        print(f"跳过第0行(描述行或标题行): {first_cell}")
+                
+                print(f"数据起始行: {data_start_row}")
+                
+                # 解析多行数据(如敌人配置、武器配置、关卡配置等)
                 config_list = []
                 for i in range(data_start_row, len(df)):
                     row_config = {}
+                    row_has_data = False
+                    
+                    param_types = self.current_mapping.get('param_types', {})
+                    print(f"可用的参数类型: {list(param_types.keys())}")
+                    
                     for col_idx, col_name in enumerate(df.columns):
                         param_name = str(col_name).strip()
-                        if param_name in self.param_types:
+                        print(f"检查列名: '{param_name}' 是否在参数类型中")
+                        if param_name in param_types:
                             try:
                                 param_value = df.iloc[i, col_idx]
-                                if pd.isna(param_value):
+                                if pd.isna(param_value) or str(param_value).strip() == '':
+                                    print(f"跳过空值: {param_name} = {param_value}")
                                     continue
                                 
-                                param_type = self.param_types[param_name]
+                                param_type = param_types[param_name]
                                 if param_type == bool:
                                     row_config[param_name] = str(param_value).lower() in ['true', '1', 'yes', 'on']
                                 else:
                                     row_config[param_name] = param_type(param_value)
-                            except (ValueError, TypeError, IndexError):
+                                row_has_data = True
+                                print(f"成功转换字段: {param_name} = {param_value} ({param_type})")
+                            except (ValueError, TypeError, IndexError) as e:
+                                print(f"转换字段 {param_name} 时出错: {e}")
                                 continue
+                        else:
+                            print(f"字段 '{param_name}' 不在参数类型定义中,跳过")
                     
-                    if row_config:  # 只添加非空配置
+                    if row_config and row_has_data:  # 只添加非空且有有效数据的配置
                         config_list.append(row_config)
+                        print(f"成功解析第{i}行,包含{len(row_config)}个字段")
+                    else:
+                        print(f"跳过第{i}行(无有效数据)")
+                
+                print(f"总共解析出{len(config_list)}个有效配置项")
                 
                 # 对于横向表格,返回配置列表
                 config = {'items': config_list}
@@ -655,17 +676,31 @@ class ConfigManagerGUI:
             return
         
         try:
+            print(f"开始导入配置...")
+            print(f"配置数据: {self.config_data}")
+            print(f"当前映射: {self.current_mapping}")
+            print(f"选中文件: {self.selected_files}")
+            
             format_type = self.current_mapping['format_type']
+            print(f"格式类型: {format_type}")
             
             if format_type == 'vertical':
                 # 处理纵向表格(如BallController)
+                print("开始处理纵向表格配置...")
                 self._import_vertical_config()
             elif format_type == 'horizontal':
                 # 处理横向表格(如敌人配置、武器配置)
+                print("开始处理横向表格配置...")
                 self._import_horizontal_config()
+            else:
+                raise ValueError(f"未知的格式类型: {format_type}")
             
         except Exception as e:
-            messagebox.showerror("错误", f"导入配置失败: {str(e)}")
+            import traceback
+            error_details = traceback.format_exc()
+            print(f"导入配置失败,详细错误信息:")
+            print(error_details)
+            messagebox.showerror("错误", f"导入配置失败: {str(e)}\n\n详细错误信息已输出到控制台,请查看。")
     
     def _import_vertical_config(self):
         """导入纵向表格配置"""
@@ -698,73 +733,204 @@ class ConfigManagerGUI:
     
     def _import_horizontal_config(self):
         """导入横向表格配置"""
+        print(f"横向表格配置导入开始...")
+        print(f"配置数据结构: {list(self.config_data.keys()) if self.config_data else 'None'}")
+        
         if 'items' not in self.config_data:
-            messagebox.showwarning("警告", "横向表格数据格式错误")
+            print(f"错误: 配置数据中缺少'items'字段")
+            print(f"实际配置数据: {self.config_data}")
+            messagebox.showwarning("警告", "横向表格数据格式错误:缺少'items'字段")
             return
         
         items = self.config_data['items']
+        print(f"配置项数量: {len(items) if items else 0}")
         if not items:
             messagebox.showwarning("警告", "没有有效的配置项")
             return
         
+        # 打印前几个配置项用于调试
+        for i, item in enumerate(items[:3]):
+            print(f"配置项{i}: {item}")
+        
         # 读取现有JSON配置
-        if self.json_config_path.exists():
-            with open(self.json_config_path, 'r', encoding='utf-8') as f:
-                current_config = json.load(f)
-        else:
+        print(f"JSON配置文件路径: {self.json_config_path}")
+        
+        # 检查是否是关卡配置(目录类型)
+        if str(self.json_config_path).endswith('levels'):
+            print("处理关卡配置目录...")
+            # 关卡配置是目录,确保目录存在
+            if not self.json_config_path.exists():
+                print(f"创建关卡配置目录: {self.json_config_path}")
+                self.json_config_path.mkdir(parents=True, exist_ok=True)
             current_config = {}
+        else:
+            # 普通JSON文件配置
+            if self.json_config_path.exists():
+                print("读取现有JSON配置文件...")
+                with open(self.json_config_path, 'r', encoding='utf-8') as f:
+                    current_config = json.load(f)
+            else:
+                print("创建新的JSON配置...")
+                current_config = {}
         
         # 根据不同的配置类型处理
+        if not self.selected_files:
+            print("错误: 没有选中的文件")
+            messagebox.showerror("错误", "没有选中的文件")
+            return
+            
         filename = Path(self.selected_files[0]).name
+        print(f"处理文件: {filename}")
         
         if '敌人配置' in filename:
+            print("处理敌人配置...")
             # 敌人配置:更新enemies数组
             if 'enemies' not in current_config:
                 current_config['enemies'] = []
             
             # 将Excel数据转换为JSON格式
             updated_enemies = []
-            for item in items:
+            for i, item in enumerate(items):
+                print(f"转换敌人数据 {i+1}/{len(items)}: {item}")
                 enemy_data = self._convert_enemy_data(item)
                 if enemy_data:
                     updated_enemies.append(enemy_data)
+                    print(f"成功转换敌人数据: {enemy_data['id']}")
+                else:
+                    print(f"跳过无效的敌人数据: {item}")
             
+            print(f"总共转换了 {len(updated_enemies)} 个敌人配置")
             current_config['enemies'] = updated_enemies
             
         elif '武器配置' in filename:
+            print("处理武器配置...")
             # 武器配置:更新weapons数组
             if 'weapons' not in current_config:
                 current_config['weapons'] = []
             
             # 将Excel数据转换为JSON格式
             updated_weapons = []
-            for item in items:
+            for i, item in enumerate(items):
+                print(f"转换武器数据 {i+1}/{len(items)}: {item}")
                 weapon_data = self._convert_weapon_data(item)
                 if weapon_data:
                     updated_weapons.append(weapon_data)
+                    print(f"成功转换武器数据: {weapon_data.get('id', 'Unknown')}")
+                else:
+                    print(f"跳过无效的武器数据: {item}")
             
+            print(f"总共转换了 {len(updated_weapons)} 个武器配置")
             current_config['weapons'] = updated_weapons
             
         elif '技能配置' in filename:
+            print("处理技能配置...")
             # 技能配置:更新skills数组
             if 'skills' not in current_config:
                 current_config['skills'] = []
             
             # 将Excel数据转换为JSON格式
             updated_skills = []
-            for item in items:
+            for i, item in enumerate(items):
+                print(f"转换技能数据 {i+1}/{len(items)}: {item}")
                 skill_data = self._convert_skill_data(item)
                 if skill_data:
                     updated_skills.append(skill_data)
+                    print(f"成功转换技能数据: {skill_data.get('id', 'Unknown')}")
+                else:
+                    print(f"跳过无效的技能数据: {item}")
             
+            print(f"总共转换了 {len(updated_skills)} 个技能配置")
             current_config['skills'] = updated_skills
+            
+        elif '关卡配置' in filename:
+            print("处理关卡配置...")
+            # 关卡配置:为每个关卡创建单独的JSON文件
+            levels_dir = self.json_config_path
+            print(f"关卡配置目录: {levels_dir}")
+            
+            try:
+                # 检查并创建目录
+                if not levels_dir.exists():
+                    print(f"创建关卡配置目录: {levels_dir}")
+                    levels_dir.mkdir(parents=True, exist_ok=True)
+                else:
+                    print(f"关卡配置目录已存在: {levels_dir}")
+                
+                # 测试目录写入权限
+                test_file = levels_dir / "test_permission.tmp"
+                try:
+                    with open(test_file, 'w', encoding='utf-8') as f:
+                        f.write("test")
+                    test_file.unlink()  # 删除测试文件
+                except PermissionError:
+                    messagebox.showerror("错误", f"没有写入权限到目录: {levels_dir}\n请检查目录权限或以管理员身份运行")
+                    return
+                
+                # 将Excel数据转换为JSON格式并保存为单独文件
+                updated_count = 0
+                failed_count = 0
+                
+                for item in items:
+                    try:
+                        level_data = self._convert_level_data(item)
+                        if level_data and '关卡ID' in item and item['关卡ID']:
+                            level_id = item['关卡ID']
+                            level_file = levels_dir / f"{level_id}.json"
+                            
+                            print(f"保存关卡配置: {level_file}")
+                            with open(level_file, 'w', encoding='utf-8') as f:
+                                json.dump(level_data, f, indent=2, ensure_ascii=False)
+                            updated_count += 1
+                        else:
+                            print(f"跳过无效的关卡数据: {item}")
+                            failed_count += 1
+                    except Exception as e:
+                        print(f"保存关卡配置时出错: {e}")
+                        failed_count += 1
+                        continue
+                
+                if updated_count > 0:
+                    message = f"关卡配置导入成功!\n更新了 {updated_count} 个关卡文件"
+                    if failed_count > 0:
+                        message += f"\n跳过了 {failed_count} 个无效配置"
+                    messagebox.showinfo("成功", message)
+                    self.status_var.set("关卡配置导入成功")
+                else:
+                    messagebox.showerror("错误", "没有成功导入任何关卡配置\n请检查Excel文件格式和数据")
+                    self.status_var.set("关卡配置导入失败")
+                
+            except Exception as e:
+                error_msg = f"关卡配置导入失败: {str(e)}"
+                print(error_msg)
+                messagebox.showerror("错误", error_msg)
+                self.status_var.set("关卡配置导入失败")
+            
+            self.clear_selection()
+            return
         
-        # 写入更新后的配置
-        with open(self.json_config_path, 'w', encoding='utf-8') as f:
-            json.dump(current_config, f, indent=2, ensure_ascii=False)
+        else:
+            # 未知配置类型
+            print(f"警告: 未知的配置文件类型: {filename}")
+            messagebox.showwarning("警告", f"未知的配置文件类型: {filename}\n支持的类型: 敌人配置、武器配置、技能配置、关卡配置")
+            return
         
-        messagebox.showinfo("成功", f"配置导入成功!\n更新了 {len(items)} 个配置项")
-        self.status_var.set("配置导入成功")
+        # 写入更新后的配置(关卡配置已在前面处理,跳过)
+        if not str(self.json_config_path).endswith('levels'):
+            try:
+                print(f"写入配置文件: {self.json_config_path}")
+                print(f"配置内容预览: {str(current_config)[:200]}...")
+                
+                with open(self.json_config_path, 'w', encoding='utf-8') as f:
+                    json.dump(current_config, f, indent=2, ensure_ascii=False)
+                
+                print("配置文件写入成功")
+                messagebox.showinfo("成功", f"配置导入成功!\n更新了 {len(items)} 个配置项")
+                self.status_var.set("配置导入成功")
+                
+            except Exception as e:
+                print(f"写入配置文件失败: {e}")
+                messagebox.showerror("错误", f"写入配置文件失败: {str(e)}")
+                return
         
         # 刷新预览
         self.clear_selection()
@@ -772,8 +938,10 @@ class ConfigManagerGUI:
     def _convert_enemy_data(self, item):
         """转换敌人数据格式"""
         try:
+            print(f"开始转换敌人数据: {item}")
             enemy_id = item.get('敌人ID', '')
-            print(f"正在转换敌人数据: {enemy_id} - {item.get('敌人名称', '')}")
+            enemy_name = item.get('敌人名称', '')
+            print(f"敌人ID: {enemy_id}, 敌人名称: {enemy_name}")
             
             # 检查必要字段
             if not enemy_id:
@@ -803,9 +971,14 @@ class ConfigManagerGUI:
     def _convert_weapon_data(self, item):
         """转换武器数据格式"""
         try:
-            return {
-                'id': item.get('ID', ''),
-                'name': item.get('名称', ''),
+            print(f"开始转换武器数据: {item}")
+            weapon_id = item.get('ID', '')
+            weapon_name = item.get('名称', '')
+            print(f"武器ID: {weapon_id}, 武器名称: {weapon_name}")
+            
+            result = {
+                'id': weapon_id,
+                'name': weapon_name,
                 'type': item.get('类型', ''),
                 'rarity': item.get('稀有度', ''),
                 'weight': item.get('权重', 1),
@@ -814,8 +987,10 @@ class ConfigManagerGUI:
                 'range': item.get('射程', 100),
                 'bulletSpeed': item.get('子弹速度', 100)
             }
+            print(f"成功转换武器数据: {result}")
+            return result
         except Exception as e:
-            print(f"转换武器数据失败: {e}")
+            print(f"转换武器数据失败: {e} - 数据: {item}")
             return None
     
     def _convert_skill_data(self, item):
@@ -850,6 +1025,31 @@ class ConfigManagerGUI:
             print(f"转换技能数据失败: {e} - 数据: {item}")
             return None
     
+    def _convert_level_data(self, item):
+        """转换关卡数据格式"""
+        try:
+            # 处理可用武器字符串,转换为数组
+            available_weapons = []
+            if '可用武器' in item and item['可用武器']:
+                weapons_str = str(item['可用武器'])
+                available_weapons = [weapon.strip() for weapon in weapons_str.split(',')]
+            
+            return {
+                "levelId": str(item.get('关卡ID', '')),
+                "name": str(item.get('关卡名称', '')),
+                "scene": str(item.get('场景', '')),
+                "description": str(item.get('描述', '')),
+                "weapons": available_weapons,
+                "timeLimit": int(item.get('时间限制', 300)),
+                "difficulty": str(item.get('难度', 'normal')),
+                "healthMultiplier": float(item.get('生命倍数', 1.0)),
+                "coinReward": int(item.get('金币奖励', 0)),
+                "diamondReward": int(item.get('钻石奖励', 0))
+            }
+        except Exception as e:
+            print(f"转换关卡数据时出错: {e}")
+            return None
+    
     def restore_default_config(self):
         """恢复默认配置"""
         result = messagebox.askyesno("确认", "确定要恢复默认配置吗?\n当前配置将被覆盖!")

+ 0 - 127
assets/resources/data/excel/test_excel_parse.py

@@ -1,127 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import pandas as pd
-import json
-from pathlib import Path
-
-def test_excel_parsing():
-    """测试Excel文件解析"""
-    excel_path = "敌人配置表.xlsx"
-    sheet_name = "敌人基础配置"
-    
-    print(f"正在读取Excel文件: {excel_path}")
-    
-    try:
-        # 读取Excel文件
-        df = pd.read_excel(excel_path, sheet_name=sheet_name)
-        print(f"成功读取Excel文件,共{len(df)}行,{len(df.columns)}列")
-        
-        # 打印列名
-        print(f"列名: {list(df.columns)}")
-        
-        # 打印前几行数据
-        print("\n前5行数据:")
-        for i in range(min(5, len(df))):
-            print(f"第{i}行: {df.iloc[i].to_dict()}")
-        
-        # 模拟配置解析逻辑
-        param_types = {
-            '敌人ID': str,
-            '敌人名称': str,
-            '敌人类型': str,
-            '稀有度': str,
-            '权重': int,
-            '生命值': int,
-            '移动速度': int,
-            '攻击力': int,
-            '攻击范围': int,
-            '攻击速度': float,
-            '防御力': int,
-            '金币奖励': int
-        }
-        
-        # 检查第1行是否为描述行
-        data_start_row = 1
-        if len(df) > 1:
-            first_cell = str(df.iloc[1, 0]).strip()
-            print(f"第1行第一个单元格: '{first_cell}'")
-            # 如果第1行第一个单元格是描述性文字,则从第2行开始
-            if first_cell in ['唯一标识符', '描述', 'description', 'desc']:
-                data_start_row = 2
-                print("检测到描述行,跳过第1行")
-            else:
-                data_start_row = 1
-                print("第1行是数据行,从第1行开始")
-        print(f"\n数据起始行: {data_start_row}")
-        
-        # 解析多行数据
-        config_list = []
-        for i in range(data_start_row, len(df)):
-            row_config = {}
-            print(f"\n处理第{i}行数据:")
-            
-            for col_idx, col_name in enumerate(df.columns):
-                param_name = str(col_name).strip()
-                print(f"  列{col_idx}: {param_name}")
-                
-                if param_name in param_types:
-                    try:
-                        param_value = df.iloc[i, col_idx]
-                        print(f"    原始值: {param_value} (类型: {type(param_value)})")
-                        
-                        if pd.isna(param_value):
-                            print(f"    跳过空值")
-                            continue
-                        
-                        param_type = param_types[param_name]
-                        if param_type == bool:
-                            row_config[param_name] = str(param_value).lower() in ['true', '1', 'yes', 'on']
-                        else:
-                            row_config[param_name] = param_type(param_value)
-                        
-                        print(f"    转换后: {row_config[param_name]}")
-                    except (ValueError, TypeError, IndexError) as e:
-                        print(f"    转换失败: {e}")
-                        continue
-                else:
-                    print(f"    参数名不在类型映射中")
-            
-            if row_config:  # 只添加非空配置
-                config_list.append(row_config)
-                print(f"  添加配置: {row_config}")
-            else:
-                print(f"  跳过空配置")
-        
-        print(f"\n最终解析结果: 共{len(config_list)}个配置项")
-        for i, config in enumerate(config_list):
-            print(f"配置{i}: {config}")
-        
-        # 转换为敌人数据格式
-        print("\n转换为敌人数据格式:")
-        enemies = []
-        for item in config_list:
-            enemy_data = {
-                'id': item.get('敌人ID', ''),
-                'name': item.get('敌人名称', ''),
-                'type': item.get('敌人类型', ''),
-                'rarity': item.get('稀有度', ''),
-                'weight': item.get('权重', 1),
-                'health': item.get('生命值', 100),
-                'speed': item.get('移动速度', 50),
-                'attack': item.get('攻击力', 10),
-                'range': item.get('攻击范围', 100),
-                'attackSpeed': item.get('攻击速度', 1.0),
-                'defense': item.get('防御力', 0),
-                'goldReward': item.get('金币奖励', 10)
-            }
-            enemies.append(enemy_data)
-            print(f"敌人数据: {enemy_data}")
-        
-    except Exception as e:
-        print(f"解析失败: {e}")
-        import traceback
-        traceback.print_exc()
-
-if __name__ == "__main__":
-    test_excel_parsing()

+ 0 - 12
assets/resources/data/excel/test_excel_parse.py.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.0.0",
-  "importer": "*",
-  "imported": true,
-  "uuid": "53d93cfd-5877-46e6-a680-cad132a1c127",
-  "files": [
-    ".json",
-    ".py"
-  ],
-  "subMetas": {},
-  "userData": {}
-}

+ 1 - 4
assets/resources/data/excel/update_excel_from_json.py

@@ -125,10 +125,7 @@ def create_levels_excel():
                 '关卡名称': level_data['name'],
                 '场景': level_data['scene'],
                 '描述': level_data['description'],
-                '可用武器': ', '.join(level_data['weapons']),
-                '初始生命': level_data['levelSettings']['initialHealth'],
-                '时间限制': level_data['levelSettings']['timeLimit'],
-                '难度': level_data['levelSettings']['difficulty']
+                '可用武器': ', '.join(level_data['weapons'])
             })
             
             # 波次和敌人配置

BIN
assets/resources/data/excel/关卡配置/关卡配置表_完整版_更新_v2.xlsx


BIN
assets/resources/data/excel/敌人配置表.xlsx


BIN
assets/resources/data/excel/方块武器配置/方块武器配置表_更新_v2.xlsx


+ 0 - 125
assets/resources/data/excel/更新说明.md

@@ -1,125 +0,0 @@
-# Excel配置表更新说明
-
-## 概述
-
-根据最新的JSON配置文件,已成功更新了以下Excel配置表:
-
-1. **方块武器配置表_更新.xlsx** - 基于 `weapons.json` 的最新武器配置
-2. **关卡配置表_完整版_更新.xlsx** - 基于 `levels/` 目录下所有关卡JSON文件的配置
-
-## 更新内容详情
-
-### 1. 方块武器配置表更新
-
-**文件位置**: `d:/CocosGame/Pong/assets/resources/data/excel/方块武器配置/方块武器配置表_更新_v2.xlsx`
-
-**包含工作表**:
-
-#### 武器基础配置
-- **ID**: 武器唯一标识符
-- **名称**: 武器显示名称
-- **类型**: 武器类型(single_shot, piercing, explosive等)
-- **稀有度**: 武器稀有度(common, uncommon, rare, epic)
-- **权重**: 武器在随机生成中的权重
-- **伤害**: 基础伤害值
-- **射速**: 射击频率
-- **射程**: 武器射程
-- **子弹速度**: 子弹飞行速度
-
-
-#### 子弹配置
-- **武器ID/名称**: 对应的武器信息
-- **子弹数量类型**: single, spread, burst
-- **子弹数量**: 每次射击的子弹数量
-- **散射角度**: 多发子弹的散射角度
-- **连发数量**: 连发模式下的子弹数量
-- **连发延迟**: 连发间隔时间
-- **轨迹类型**: straight, arc, homing等
-- **轨迹速度**: 子弹轨迹速度
-- **重力**: 重力影响
-- **生命周期类型**: 子弹消失条件
-- **最大生存时间**: 子弹最大存在时间
-- **穿透次数**: 可穿透敌人数量
-- **反弹次数**: 可反弹次数
-- **是否返回原点**: 回旋镖类型武器
-
-#### 方块形状配置
-- **ID**: 形状标识符
-- **名称**: 形状名称
-- **形状矩阵**: 4x4矩阵表示的方块形状
-
-#### 稀有度权重
-- **稀有度**: 稀有度等级
-- **权重**: 对应的权重值
-
-### 2. 关卡配置表更新
-
-**文件位置**: `d:/CocosGame/Pong/assets/resources/data/excel/关卡配置/关卡配置表_完整版_更新_v2.xlsx`
-
-**包含工作表**:
-
-#### 关卡基础配置
-- **关卡ID**: 关卡标识符(Level1, Level2等)
-- **关卡名称**: 关卡显示名称
-- **场景**: 关卡场景类型
-- **描述**: 关卡描述信息
-- **可用武器**: 该关卡可使用的武器列表
-- **初始生命**: 玩家初始生命值
-- **时间限制**: 关卡时间限制(秒)
-- **难度**: 关卡难度等级
-
-#### 波次配置
-- **关卡ID**: 所属关卡
-- **波次ID**: 波次编号
-- **敌人种类数**: 该波次包含的敌人种类数量
-
-#### 敌人配置
-- **关卡ID**: 所属关卡
-- **波次ID**: 所属波次
-- **敌人类型**: 敌人类型名称
-- **数量**: 该类型敌人的数量
-- **生成间隔**: 敌人生成间隔时间
-- **生成延迟**: 该类型敌人开始生成的延迟时间
-- **特性**: 敌人特殊能力和特征
-
-## 主要更新特性
-
-### 关卡配置的重要改进
-
-1. **多敌人类型支持**: 每个波次现在可以配置多种不同类型的敌人,而不是之前的单一敌人类型
-
-2. **独立生成控制**: 每种敌人类型都有独立的:
-   - 数量控制
-   - 生成间隔
-   - 生成延迟
-   - 特性配置
-
-3. **策略深度增强**: 通过多敌人类型的组合,提供更丰富的游戏策略和挑战
-
-4. **武器配置优化**: 删除了无用的精度(accuracy)字段,简化配置结构
-
-### 武器配置的完整性
-
-1. **详细的子弹配置**: 包含完整的子弹行为参数
-2. **视觉效果配置**: 包含特效和音效配置
-3. **方块形状系统**: 完整的俄罗斯方块形状配置
-4. **稀有度系统**: 平衡的稀有度权重分配
-
-## 使用建议
-
-1. **备份原文件**: 在使用新配置前,建议备份原有的Excel文件
-2. **逐步测试**: 建议先在测试环境中验证新配置的正确性
-3. **平衡性调整**: 根据实际游戏体验,可能需要调整数值平衡
-4. **版本控制**: 建议将配置文件纳入版本控制系统
-
-## 技术说明
-
-- 更新脚本: `update_excel_from_json.py`
-- 数据源: `weapons.json` 和 `levels/` 目录下的JSON文件
-- 生成工具: Python pandas + openpyxl
-- 编码格式: UTF-8
-
-## 后续维护
-
-当JSON配置文件发生变化时,可以重新运行 `update_excel_from_json.py` 脚本来更新Excel文件,确保配置的一致性。
-

+ 0 - 11
assets/resources/data/excel/更新说明.md.meta

@@ -1,11 +0,0 @@
-{
-  "ver": "1.0.1",
-  "importer": "text",
-  "imported": true,
-  "uuid": "251ca7b8-e7b7-4ec9-911e-5e4af8593ee0",
-  "files": [
-    ".json"
-  ],
-  "subMetas": {},
-  "userData": {}
-}

+ 0 - 137
assets/resources/data/excel/自动部署工具.bat

@@ -1,137 +0,0 @@
-@echo off
-setlocal enabledelayedexpansion
-cd /d "%~dp0"
-
-echo ========================================
-echo Game Configuration Tool - Auto Deploy
-echo ========================================
-echo.
-echo This script will automatically:
-echo 1. Check Python environment
-echo 2. Install required dependencies
-echo 3. Launch configuration tool
-echo.
-echo Starting deployment...
-echo.
-
-:: Check Python environment
-echo [Step 1/3] Checking Python environment...
-echo.
-
-set PYTHON_CMD=
-for %%i in (python py python3) do (
-    %%i --version >nul 2>&1
-    if !errorlevel! equ 0 (
-        set PYTHON_CMD=%%i
-        goto :python_found
-    )
-)
-
-echo [ERROR] Python not found!
-echo Please visit https://www.python.org/downloads/ to install Python
-echo Make sure to check "Add Python to PATH" during installation
-echo.
-goto :error_exit
-
-:python_found
-echo [SUCCESS] Python environment check passed
-%PYTHON_CMD% --version
-echo.
-
-:: Check dependencies
-echo [Step 2/3] Checking and installing dependencies...
-echo.
-
-:: Check pandas
-echo Checking pandas...
-%PYTHON_CMD% -c "import pandas" >nul 2>&1
-if errorlevel 1 (
-    echo pandas not found, installing...
-    %PYTHON_CMD% -m pip install pandas>=1.3.0
-    if errorlevel 1 (
-        echo [ERROR] pandas installation failed! Trying Chinese mirror...
-        %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas>=1.3.0
-        if errorlevel 1 (
-            echo [ERROR] Failed to install pandas!
-            goto :error
-        )
-    )
-    echo [SUCCESS] pandas installed
-) else (
-    echo [SUCCESS] pandas already installed
-)
-
-:: Check openpyxl
-echo Checking openpyxl...
-%PYTHON_CMD% -c "import openpyxl" >nul 2>&1
-if errorlevel 1 (
-    echo openpyxl not found, installing...
-    %PYTHON_CMD% -m pip install openpyxl>=3.0.0
-    if errorlevel 1 (
-        echo [ERROR] openpyxl installation failed! Trying Chinese mirror...
-        %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple openpyxl>=3.0.0
-        if errorlevel 1 (
-            echo [ERROR] Failed to install openpyxl!
-            goto :error
-        )
-    )
-    echo [SUCCESS] openpyxl installed
-) else (
-    echo [SUCCESS] openpyxl already installed
-)
-
-echo.
-echo [SUCCESS] All dependencies check completed!
-echo.
-
-:: Launch configuration tool
-echo [Step 3/3] Launching configuration tool...
-echo.
-
-if not exist "config_manager.py" (
-    echo [ERROR] config_manager.py file not found!
-    echo Please make sure to run this script in the correct directory
-    pause
-    exit /b 1
-)
-
-echo Starting configuration management tool...
-echo.
-echo ========================================
-echo Tool started successfully! Please operate in the popup window
-echo ========================================
-echo.
-echo Instructions:
-echo 1. Select Excel configuration files on the left
-echo 2. Click "Preview Selected Files" to view content
-echo 3. Click "Import Configuration" to complete data import
-echo.
-echo Closing this window will also close the configuration tool
-echo.
-
-%PYTHON_CMD% config_manager.py
-echo.
-echo Configuration tool closed
-pause
-exit /b 0
-
-:error
-echo.
-echo ========================================
-echo [ERROR] Deployment failed!
-echo ========================================
-echo.
-echo Possible solutions:
-echo 1. Check network connection
-echo 2. Manual installation:
-echo    %PYTHON_CMD% -m pip install pandas openpyxl
-echo 3. Use Chinese mirror:
-echo    %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas openpyxl
-echo 4. Contact technical support
-echo.
-pause
-exit /b 1
-
-:error_exit
-pause
-exit /b 1

+ 0 - 12
assets/resources/data/excel/自动部署工具.bat.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.0.0",
-  "importer": "*",
-  "imported": true,
-  "uuid": "f909647c-56cc-40c4-81e9-5e15c721ec4f",
-  "files": [
-    ".bat",
-    ".json"
-  ],
-  "subMetas": {},
-  "userData": {}
-}

+ 9 - 133
assets/resources/data/levels/Level1.json

@@ -1,139 +1,15 @@
 {
-  "name": "新手引导(草地平原)",
+  "levelId": "Level1",
+  "name": "新手关卡(草地平原)",
   "scene": "grassland",
   "description": "新手引导关卡,学习基础塔防玩法",
-  "level": 1,
   "weapons": [
-    "毛豆射手"
+    "毛豆射手",
+    "尖胡萝卜"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 3,
-          "spawnInterval": 5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 1,
-          "spawnInterval": 4,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 2,
-          "spawnInterval": 8,
-          "spawnDelay": 10,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 1,
-          "spawnInterval": 3,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 3,
-          "spawnInterval": 6,
-          "spawnDelay": 5,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 2,
-          "spawnInterval": 10,
-          "spawnDelay": 15,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 1,
-          "spawnInterval": 3,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 2,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 1,
-          "spawnInterval": 7,
-          "spawnDelay": 12,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 1,
-          "spawnInterval": 2.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 5,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 2,
-          "spawnInterval": 6,
-          "spawnDelay": 10,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 2,
-          "spawnInterval": 12,
-          "spawnDelay": 20,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 300,
-    "difficulty": "easy",
-    "energyMax": 3,
-    "healthMultiplier": 1.0
-  },
-  "rewards": {
-    "coins": 100,
-    "diamonds": 10,
-    "unlockWeapon": "尖胡萝卜"
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 10 - 195
assets/resources/data/levels/Level2.json

@@ -1,201 +1,16 @@
 {
+  "levelId": "Level2",
   "name": "丛林探险(森林场景)",
   "scene": "forest",
-  "description": "森林场景的塔防挑战",
-  "level": 2,
+  "description": "森林场景的塔防挑战,引入新的敌人类型和武器组合",
   "weapons": [
-    "毛豆射手",
-    "尖胡萝卜"
+    "锯齿草",
+    "西瓜炸弹",
+    "毛豆射手"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 3.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 2,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 6,
-          "spawnInterval": 3,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 2,
-          "spawnInterval": 10,
-          "spawnDelay": 15,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 2.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 5,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 3,
-          "spawnInterval": 6,
-          "spawnDelay": 10,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 6,
-          "spawnInterval": 3.5,
-          "spawnDelay": 5,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 2,
-          "spawnInterval": 12,
-          "spawnDelay": 18,
-          "characteristics": ["远程攻击", "魔法抗性"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 6,
-          "spawnInterval": 3.5,
-          "spawnDelay": 5,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["远程攻击", "魔法抗性"]
-        }
-      ]
-    },
-    {
-      "waveId": 6,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 12,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 4,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 4,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 10,
-          "spawnDelay": 20,
-          "characteristics": ["远程攻击", "魔法抗性"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 360,
-    "difficulty": "easy",
-    "energyMax": 4,
-    "healthMultiplier": 1.2
-  },
-  "rewards": {
-    "coins": 200,
-    "diamonds": 20,
-    "unlockWeapon": "锯齿草"
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 9 - 235
assets/resources/data/levels/Level3.json

@@ -1,242 +1,16 @@
 {
+  "levelId": "Level3",
   "name": "魔法废墟(魔幻场景)",
   "scene": "magic_ruins",
   "description": "魔幻场景的塔防挑战,引入远程攻击敌人和隐身机制",
-  "level": 3,
   "weapons": [
-    "毛豆射手",
-    "尖胡萝卜",
-    "锯齿草"
+    "回旋镖盆栽",
+    "炙热辣椒",
+    "尖胡萝卜"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 2.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 2,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 10,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 2,
-          "spawnInterval": 10,
-          "spawnDelay": 15,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 6,
-          "spawnInterval": 2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 6,
-          "spawnInterval": 3,
-          "spawnDelay": 5,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 7,
-          "spawnDelay": 10,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 2,
-          "spawnInterval": 10,
-          "spawnDelay": 15,
-          "characteristics": ["远程射箭攻击防御塔"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 10,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 2,
-          "spawnInterval": 12,
-          "spawnDelay": 18,
-          "characteristics": ["重装甲", "护甲破坏阈值"]
-        }
-      ]
-    },
-    {
-      "waveId": 6,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 5,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 2,
-          "spawnInterval": 12,
-          "spawnDelay": 15,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        }
-      ]
-    },
-    {
-      "waveId": 7,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 12,
-          "spawnInterval": 1,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 5,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 4,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 3,
-          "spawnInterval": 10,
-          "spawnDelay": 20,
-          "characteristics": ["重装甲", "护甲破坏阈值"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 2,
-          "spawnInterval": 15,
-          "spawnDelay": 25,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 420,
-    "difficulty": "normal",
-    "energyMax": 5,
-    "healthMultiplier": 1.4
-  },
-  "rewards": {
-    "coins": 300,
-    "diamonds": 30,
-    "unlockWeapon": "西瓜炸弹"
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 9 - 257
assets/resources/data/levels/Level4.json

@@ -1,264 +1,16 @@
 {
+  "levelId": "Level4",
   "name": "钢铁堡垒(工业场景)",
   "scene": "industrial",
-  "description": "工业场景的高难度塔防挑战,面对强化敌人和BOSS",
-  "level": 4,
+  "description": "工业场景的高难度挑战,引入BOSS战和超高防御敌人",
   "weapons": [
-    "毛豆射手",
-    "尖胡萝卜",
-    "锯齿草",
+    "仙人散弹",
+    "秋葵导弹",
     "西瓜炸弹"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 12,
-          "spawnInterval": 2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 10,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 15,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 2,
-          "spawnInterval": 12,
-          "spawnDelay": 18,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 8,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 10,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 12,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 12,
-          "spawnInterval": 1,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 3,
-          "spawnInterval": 10,
-          "spawnDelay": 15,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        }
-      ]
-    },
-    {
-      "waveId": 6,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 1,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 3,
-          "spawnDelay": 5,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 4,
-          "spawnInterval": 7,
-          "spawnDelay": 12,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        }
-      ]
-    },
-    {
-      "waveId": 7,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 15,
-          "spawnInterval": 0.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 5,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 5,
-          "spawnInterval": 6,
-          "spawnDelay": 10,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 4,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 4,
-          "spawnInterval": 7,
-          "spawnDelay": 15,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 480,
-    "difficulty": "hard",
-    "energyMax": 6,
-    "healthMultiplier": 1.6
-  },
-  "rewards": {
-    "coins": 400,
-    "diamonds": 40,
-    "unlockWeapon": "回旋镖盆栽"
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 10 - 324
assets/resources/data/levels/Level5.json

@@ -1,335 +1,21 @@
 {
+  "levelId": "Level5",
   "name": "终极挑战(赛博都市)",
   "scene": "cyberpunk",
   "description": "终极挑战关卡,包含多个BOSS和复杂的敌人组合",
-  "level": 5,
   "weapons": [
     "毛豆射手",
     "尖胡萝卜",
     "锯齿草",
     "西瓜炸弹",
-    "回旋镖盆栽"
+    "回旋镖盆栽",
+    "炙热辣椒",
+    "仙人散弹",
+    "秋葵导弹"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 15,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 5,
-          "spawnInterval": 4,
-          "spawnDelay": 8,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 6,
-          "spawnInterval": 3,
-          "spawnDelay": 6,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 4,
-          "spawnInterval": 5,
-          "spawnDelay": 10,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 12,
-          "spawnInterval": 1.2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 10,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 10,
-          "spawnInterval": 1,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 6,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 12,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 10,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 15,
-          "spawnInterval": 0.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 5,
-          "spawnInterval": 6,
-          "spawnDelay": 8,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 10,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 12,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 4,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 20,
-          "spawnInterval": 0.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 5,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 5,
-          "spawnInterval": 6,
-          "spawnDelay": 12,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 4,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 5,
-          "spawnDelay": 10,
-          "characteristics": ["远程射箭攻击防御塔"]
-        }
-      ]
-    },
-    {
-      "waveId": 6,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 25,
-          "spawnInterval": 0.6,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 10,
-          "spawnInterval": 2.5,
-          "spawnDelay": 4,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 6,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 7,
-          "spawnInterval": 4,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 5,
-          "spawnDelay": 10,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 5,
-          "spawnInterval": 6,
-          "spawnDelay": 12,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 6,
-          "spawnInterval": 7,
-          "spawnDelay": 15,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        }
-      ]
-    },
-    {
-      "waveId": 7,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 30,
-          "spawnInterval": 0.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 12,
-          "spawnInterval": 2,
-          "spawnDelay": 3,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 5,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 8,
-          "spawnInterval": 3.5,
-          "spawnDelay": 6,
-          "characteristics": ["远程射箭攻击防御塔"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 6,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["周期性隐身", "需追踪轨迹"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 8,
-          "spawnInterval": 4,
-          "spawnDelay": 10,
-          "characteristics": ["死亡爆炸", "需优先清除"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 10,
-          "spawnInterval": 2.5,
-          "spawnDelay": 7,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 8,
-          "spawnInterval": 4,
-          "spawnDelay": 12,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 600,
-    "difficulty": "extreme",
-    "energyMax": 8,
-    "healthMultiplier": 2.0
-  },
-  "rewards": {
-    "coins": 500,
-    "diamonds": 50,
-    "unlockWeapon": "炙热辣椒"
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 6 - 84
assets/resources/data/levels/Level6.json

@@ -1,8 +1,8 @@
 {
+  "levelId": "Level6",
   "name": "沙漠绿洲(沙漠场景)",
   "scene": "desert",
   "description": "沙漠场景的挑战,炎热环境下的生存战斗",
-  "level": 6,
   "weapons": [
     "毛豆射手",
     "尖胡萝卜",
@@ -11,87 +11,9 @@
     "回旋镖盆栽",
     "炙热辣椒"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 18,
-          "spawnInterval": 1.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 4,
-          "spawnInterval": 6,
-          "spawnDelay": 12,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 15,
-          "spawnInterval": 1.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 5,
-          "spawnInterval": 5,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 3,
-          "spawnInterval": 8,
-          "spawnDelay": 15,
-          "characteristics": ["远程弓箭攻击"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 20,
-          "spawnInterval": 1.2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 4,
-          "spawnInterval": 10,
-          "spawnDelay": 20,
-          "characteristics": ["隐身能力", "快速移动"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 6,
-          "spawnInterval": 4,
-          "spawnDelay": 25,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    }
-  ],
-  "rewards": {
-    "coins": 800,
-    "experience": 150,
-    "unlockWeapon": "炙热辣椒"
-  },
-  "difficulty": {
-    "enemyHealthMultiplier": 1.5,
-    "enemySpeedMultiplier": 1.1,
-    "waveIntensity": 0.8
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 6 - 96
assets/resources/data/levels/Level7.json

@@ -1,8 +1,8 @@
 {
+  "levelId": "Level7",
   "name": "冰雪王国(冰雪场景)",
   "scene": "ice",
   "description": "冰雪场景的极地挑战,寒冷环境下的防御战",
-  "level": 7,
   "weapons": [
     "毛豆射手",
     "尖胡萝卜",
@@ -12,99 +12,9 @@
     "炙热辣椒",
     "仙人散弹"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 22,
-          "spawnInterval": 1.6,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 8,
-          "spawnInterval": 4,
-          "spawnDelay": 10,
-          "characteristics": ["高生命", "慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 18,
-          "spawnInterval": 1.4,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 6,
-          "spawnDelay": 12,
-          "characteristics": ["远程弓箭攻击"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 3,
-          "spawnInterval": 12,
-          "spawnDelay": 20,
-          "characteristics": ["爆炸伤害", "自爆攻击"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 25,
-          "spawnInterval": 1.0,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 8,
-          "spawnInterval": 3,
-          "spawnDelay": 15,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 5,
-          "spawnInterval": 8,
-          "spawnDelay": 25,
-          "characteristics": ["隐身能力", "快速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "BOSS1",
-          "count": 1,
-          "spawnInterval": 0,
-          "spawnDelay": 30,
-          "characteristics": ["超高生命", "多种攻击方式", "召唤小怪"]
-        }
-      ]
-    }
-  ],
-  "rewards": {
-    "coins": 1000,
-    "experience": 200,
-    "unlockWeapon": "仙人散弹"
-  },
-  "difficulty": {
-    "enemyHealthMultiplier": 1.7,
-    "enemySpeedMultiplier": 1.2,
-    "waveIntensity": 0.9
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 6 - 117
assets/resources/data/levels/Level8.json

@@ -1,8 +1,8 @@
 {
+  "levelId": "Level8",
   "name": "火山熔岩(火山场景)",
   "scene": "volcano",
   "description": "火山场景的极限挑战,熔岩环境下的终极考验",
-  "level": 8,
   "weapons": [
     "毛豆射手",
     "尖胡萝卜",
@@ -13,120 +13,9 @@
     "仙人散弹",
     "秋葵导弹"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 30,
-          "spawnInterval": 1.2,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 10,
-          "spawnInterval": 3,
-          "spawnDelay": 8,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 6,
-          "spawnInterval": 5,
-          "spawnDelay": 15,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 25,
-          "spawnInterval": 1.0,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 8,
-          "spawnInterval": 4,
-          "spawnDelay": 10,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 6,
-          "spawnInterval": 6,
-          "spawnDelay": 18,
-          "characteristics": ["远程弓箭攻击"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 4,
-          "spawnInterval": 10,
-          "spawnDelay": 25,
-          "characteristics": ["爆炸伤害", "自爆攻击"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 20,
-          "spawnInterval": 0.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 12,
-          "spawnInterval": 2.5,
-          "spawnDelay": 12,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 8,
-          "spawnInterval": 6,
-          "spawnDelay": 20,
-          "characteristics": ["隐身能力", "快速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "BOSS2",
-          "count": 1,
-          "spawnInterval": 0,
-          "spawnDelay": 30,
-          "characteristics": ["超高生命", "范围攻击", "召唤增援"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 6,
-          "spawnInterval": 8,
-          "spawnDelay": 45,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    }
-  ],
-  "rewards": {
-    "coins": 1200,
-    "experience": 250,
-    "unlockWeapon": "秋葵导弹"
-  },
-  "difficulty": {
-    "enemyHealthMultiplier": 2.0,
-    "enemySpeedMultiplier": 1.3,
-    "waveIntensity": 1.0
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 6 - 144
assets/resources/data/levels/Level9.json

@@ -1,8 +1,8 @@
 {
+  "levelId": "Level9",
   "name": "终极试炼(终极场景)",
   "scene": "ultimate",
   "description": "终极试炼关卡,解锁最后的植物武器,面对最强挑战",
-  "level": 9,
   "weapons": [
     "毛豆射手",
     "尖胡萝卜",
@@ -14,147 +14,9 @@
     "秋葵导弹",
     "狼牙棒"
   ],
-  "waves": [
-    {
-      "waveId": 1,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 40,
-          "spawnInterval": 0.8,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "路障僵尸",
-          "count": 15,
-          "spawnInterval": 2.5,
-          "spawnDelay": 5,
-          "characteristics": ["高生命", "慢速移动"]
-        },
-        {
-          "enemyType": "漫步僵尸",
-          "count": 10,
-          "spawnInterval": 4,
-          "spawnDelay": 12,
-          "characteristics": ["左右摇摆", "近战范围大"]
-        }
-      ]
-    },
-    {
-      "waveId": 2,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 35,
-          "spawnInterval": 0.6,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "法师僵尸",
-          "count": 12,
-          "spawnInterval": 3,
-          "spawnDelay": 8,
-          "characteristics": ["远程魔法子弹攻击防御塔"]
-        },
-        {
-          "enemyType": "弓箭僵尸",
-          "count": 10,
-          "spawnInterval": 4,
-          "spawnDelay": 15,
-          "characteristics": ["远程弓箭攻击"]
-        },
-        {
-          "enemyType": "火药桶僵尸",
-          "count": 6,
-          "spawnInterval": 8,
-          "spawnDelay": 22,
-          "characteristics": ["爆炸伤害", "自爆攻击"]
-        }
-      ]
-    },
-    {
-      "waveId": 3,
-      "enemies": [
-        {
-          "enemyType": "普通僵尸",
-          "count": 30,
-          "spawnInterval": 0.5,
-          "spawnDelay": 0,
-          "characteristics": ["中速移动", "无技能"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 15,
-          "spawnInterval": 2,
-          "spawnDelay": 10,
-          "characteristics": ["超高生命", "极慢速移动"]
-        },
-        {
-          "enemyType": "隐身僵尸",
-          "count": 12,
-          "spawnInterval": 4,
-          "spawnDelay": 18,
-          "characteristics": ["隐身能力", "快速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 4,
-      "enemies": [
-        {
-          "enemyType": "BOSS1",
-          "count": 1,
-          "spawnInterval": 0,
-          "spawnDelay": 25,
-          "characteristics": ["超高生命", "多种攻击方式", "召唤小怪"]
-        },
-        {
-          "enemyType": "BOSS2",
-          "count": 1,
-          "spawnInterval": 0,
-          "spawnDelay": 60,
-          "characteristics": ["超高生命", "范围攻击", "召唤增援"]
-        },
-        {
-          "enemyType": "铁桶僵尸",
-          "count": 10,
-          "spawnInterval": 6,
-          "spawnDelay": 40,
-          "characteristics": ["超高生命", "极慢速移动"]
-        }
-      ]
-    },
-    {
-      "waveId": 5,
-      "enemies": [
-        {
-          "enemyType": "终极BOSS",
-          "count": 1,
-          "spawnInterval": 0,
-          "spawnDelay": 30,
-          "characteristics": ["极高生命", "全屏攻击", "无敌阶段", "召唤军团"]
-        }
-      ]
-    }
-  ],
-  "levelSettings": {
-    "initialHealth": 100,
-    "timeLimit": 720,
-    "difficulty": "nightmare",
-    "energyMax": 10,
-    "healthMultiplier": 2.5
-  },
-  "rewards": {
-    "coins": 1500,
-    "experience": 300,
-    "diamonds": 100,
-    "unlockWeapon": "终极豌豆"
-  },
-  "difficulty": {
-    "enemyHealthMultiplier": 2.5,
-    "enemySpeedMultiplier": 1.5,
-    "waveIntensity": 1.2
-  }
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "coinReward": 0,
+  "diamondReward": 0
 }

+ 1 - 2
assets/scripts/Animations/BallAni.ts

@@ -106,11 +106,10 @@ export class BallAni extends Component {
         const originalMaterial = sprite ? sprite.material : null;
         const originalSpriteScale = sprite ? new Vec3(1, 1, 1) : new Vec3(1, 1, 1);
         
-        console.log('[BallAni] 开始方块视觉缩放动画,有敌人:', hasActiveEnemies);
         
         if (hasActiveEnemies) {
             // 有敌人时播放Sprite缩放动画(不影响碰撞体积)
-            const shrinkSpriteScale = new Vec3(0.5, 0.5, 1);
+            const shrinkSpriteScale = new Vec3(0.7, 0.7, 1);
             
             // 应用材质
             console.log('[BallAni] 检查材质状态:', {

+ 12 - 12
assets/scripts/CombatSystem/EnemyComponent.ts

@@ -13,37 +13,37 @@ export class EnemyComponent extends Component {
 
     // 获取敌人生命值
     public getHealth(): number {
-        return this.enemyConfig?.stats?.health || 100;
+        return this.enemyConfig?.health || 100;
     }
 
     // 获取敌人速度
     public getSpeed(): number {
-        return this.enemyConfig?.stats?.speed || 50;
+        return this.enemyConfig?.speed || 50;
     }
 
     // 获取敌人伤害
     public getDamage(): number {
-        return this.enemyConfig?.stats?.damage || 20;
+        return this.enemyConfig?.attack || 20;
     }
 
     // 获取敌人攻击范围
     public getAttackRange(): number {
-        return this.enemyConfig?.stats?.attackRange || 30;
+        return this.enemyConfig?.range || 30;
     }
 
     // 获取敌人攻击速度
     public getAttackSpeed(): number {
-        return this.enemyConfig?.stats?.attackSpeed || 1.0;
+        return this.enemyConfig?.attackSpeed || 1.0;
     }
 
     // 获取敌人防御力
     public getDefense(): number {
-        return this.enemyConfig?.stats?.defense || 0;
+        return this.enemyConfig?.defense || 0;
     }
 
     // 获取击杀奖励
     public getCoinReward(): number {
-        return this.enemyConfig?.stats?.coinReward || 10;
+        return this.enemyConfig?.goldReward || 10;
     }
 
     // 获取移动类型
@@ -105,10 +105,10 @@ export class EnemyComponent extends Component {
         return `${this.enemyConfig.name}\n` +
                `类型: ${this.enemyConfig.type}\n` +
                `稀有度: ${this.enemyConfig.rarity}\n` +
-               `生命值: ${this.enemyConfig.stats.health}\n` +
-               `速度: ${this.enemyConfig.stats.speed}\n` +
-               `伤害: ${this.enemyConfig.stats.damage}\n` +
-               `攻击范围: ${this.enemyConfig.stats.attackRange}`;
+               `生命值: ${this.enemyConfig.health}\n` +
+               `速度: ${this.enemyConfig.speed}\n` +
+               `伤害: ${this.enemyConfig.attack}\n` +
+               `攻击范围: ${this.enemyConfig.range}`;
     }
 
     // 死亡时调用
@@ -117,4 +117,4 @@ export class EnemyComponent extends Component {
             this.spawner.onEnemyDeath(this.node);
         }
     }
-} 
+}

+ 35 - 33
assets/scripts/CombatSystem/EnemyController.ts

@@ -541,7 +541,12 @@ export class EnemyController extends BaseSingleton {
         // === 根据配置设置敌人 ===
         const enemyComp = enemy.addComponent(EnemyInstance);
 
+        // 确保敌人数据库已加载
+        await EnemyInstance.loadEnemyDatabase();
+
         let enemyConfig: EnemyConfig = null;
+        let enemyId: string = null;
+        
         if (this.configManager && this.configManager.isConfigLoaded()) {
             // 优先使用当前波次配置中的敌人类型
             if (this.currentWaveEnemyConfigs.length > 0) {
@@ -550,7 +555,7 @@ export class EnemyController extends BaseSingleton {
                 const enemyType = enemyTypeConfig.enemyType || enemyTypeConfig;
                 
                 // 尝试通过敌人名称映射获取ID
-                let enemyId = enemyType;
+                enemyId = enemyType;
                 if (this.configManager.getNameToIdMapping) {
                     const mapping = this.configManager.getNameToIdMapping();
                     if (mapping && mapping[enemyType]) {
@@ -561,13 +566,14 @@ export class EnemyController extends BaseSingleton {
                 enemyConfig = this.configManager.getEnemyById(enemyId) || this.configManager.getRandomEnemy();
             } else {
                 enemyConfig = this.configManager.getRandomEnemy();
+                enemyId = enemyConfig?.id || 'normal_zombie';
             }
         }
 
         // 获取当前关卡的血量倍率
         const healthMultiplier = await this.getCurrentHealthMultiplier();
         
-        if (enemyConfig) {
+        if (enemyConfig && enemyId) {
             try {
                 const cfgComp = enemy.addComponent(EnemyComponent);
                 cfgComp.enemyConfig = enemyConfig;
@@ -576,26 +582,22 @@ export class EnemyController extends BaseSingleton {
                 console.error(`[EnemyController] 添加EnemyComponent失败:`, error);
             }
 
-            // 应用数值,血量乘以倍率
-            let baseHealth, finalHealth;
+            // 使用EnemyInstance的新配置系统
             try {
-                let speed, attackPower;
-                
-                // 根据更新后的EnemyConfig接口访问属性
-                baseHealth = enemyConfig.health;
-                speed = enemyConfig.speed;
-                attackPower = enemyConfig.attack;
+                // 设置敌人配置
+                enemyComp.setEnemyConfig(enemyId);
                 
-                finalHealth = Math.round(baseHealth * healthMultiplier);
+                // 应用血量倍率
+                const baseHealth = enemyComp.health || this.defaultHealth;
+                const finalHealth = Math.round(baseHealth * healthMultiplier);
                 enemyComp.health = finalHealth;
                 enemyComp.maxHealth = finalHealth;
-                enemyComp.speed = speed;
-                enemyComp.attackPower = attackPower;
+                
+                console.log(`[EnemyController] 敌人 ${enemyId} 配置已应用,血量: ${finalHealth}`);
             } catch (error) {
-                console.error(`[EnemyController] 应用敌人数值时出错:`, error);
+                console.error(`[EnemyController] 应用敌人配置时出错:`, error);
                 // 使用默认值
-                baseHealth = this.defaultHealth;
-                finalHealth = Math.round(baseHealth * healthMultiplier);
+                const finalHealth = Math.round(this.defaultHealth * healthMultiplier);
                 enemyComp.health = finalHealth;
                 enemyComp.maxHealth = finalHealth;
                 enemyComp.speed = this.defaultEnemySpeed;
@@ -605,12 +607,22 @@ export class EnemyController extends BaseSingleton {
             // 加载动画
             this.loadEnemyAnimation(enemy, enemyConfig);
         } else {
-            // 使用默认值,血量乘以倍率
-            const finalHealth = Math.round(this.defaultHealth * healthMultiplier);
-            enemyComp.health = finalHealth;
-            enemyComp.maxHealth = finalHealth;
-            enemyComp.speed = this.defaultEnemySpeed;
-            enemyComp.attackPower = this.defaultAttackPower;
+            // 使用默认配置
+            try {
+                enemyComp.setEnemyConfig('normal_zombie'); // 默认敌人类型
+                const baseHealth = enemyComp.health || this.defaultHealth;
+                const finalHealth = Math.round(baseHealth * healthMultiplier);
+                enemyComp.health = finalHealth;
+                enemyComp.maxHealth = finalHealth;
+            } catch (error) {
+                console.error(`[EnemyController] 应用默认敌人配置时出错:`, error);
+                // 使用硬编码默认值
+                const finalHealth = Math.round(this.defaultHealth * healthMultiplier);
+                enemyComp.health = finalHealth;
+                enemyComp.maxHealth = finalHealth;
+                enemyComp.speed = this.defaultEnemySpeed;
+                enemyComp.attackPower = this.defaultAttackPower;
+            }
         }
 
         // 额外的属性设置
@@ -821,17 +833,7 @@ export class EnemyController extends BaseSingleton {
         }
     }
 
-    // === 调试方法 ===
-    public testEnemyAttack() {
-        console.log('=== 测试敌人攻击墙体 ===');
-        
-        // 手动触发墙体受到伤害
-        const testDamage = 50;
-        console.log(`模拟敌人攻击,伤害: ${testDamage}`);
-        this.damageWall(testDamage);
-        
-        return this.wallComponent ? this.wallComponent.getCurrentHealth() : 0;
-    }
+
     
     public getCurrentWallHealth(): number {
         return this.wallComponent ? this.wallComponent.getCurrentHealth() : 0;

+ 95 - 5
assets/scripts/CombatSystem/EnemyInstance.ts

@@ -1,7 +1,8 @@
-import { _decorator, Component, Node, ProgressBar, Label, Vec3, find, UITransform, Collider2D, Contact2DType, IPhysics2DContact, instantiate, resources, Prefab } from 'cc';
+import { _decorator, Component, Node, ProgressBar, Label, Vec3, find, UITransform, Collider2D, Contact2DType, IPhysics2DContact, instantiate, resources, Prefab, JsonAsset } from 'cc';
 import { sp } from 'cc';
 import { DamageNumberAni } from '../Animations/DamageNumberAni';
 import { HPBarAnimation } from '../Animations/HPBarAnimation';
+import { EnemyComponent } from './EnemyComponent';
 const { ccclass, property } = _decorator;
 
 // 前向声明EnemyController接口,避免循环引用
@@ -26,12 +27,21 @@ enum EnemyState {
 // 单个敌人实例的组件
 @ccclass('EnemyInstance')
 export class EnemyInstance extends Component {
-    // 敌人属性
+    // 敌人属性(从配置文件读取)
     public health: number = 30;
     public maxHealth: number = 30;
     public speed: number = 50;
     public attackPower: number = 10;
     
+    // 敌人配置ID
+    public enemyId: string = '';
+    
+    // 敌人配置数据
+    private enemyConfig: any = null;
+    
+    // 敌人配置数据库
+    private static enemyDatabase: any = null;
+    
     // === 新增属性 ===
     /** 是否从上方生成 */
     public spawnFromTop: boolean = true;
@@ -71,12 +81,92 @@ export class EnemyInstance extends Component {
         this.initializeEnemy();
     }
     
+    // 静态方法:加载敌人配置数据库
+    public static async loadEnemyDatabase(): Promise<void> {
+        if (EnemyInstance.enemyDatabase) return;
+        
+        return new Promise((resolve, reject) => {
+            resources.load('data/enemies', JsonAsset, (err, jsonAsset) => {
+                if (err) {
+                    console.error('[EnemyInstance] 加载敌人配置失败:', err);
+                    reject(err);
+                    return;
+                }
+                
+                EnemyInstance.enemyDatabase = jsonAsset.json;
+                console.log('[EnemyInstance] 敌人配置数据库加载成功');
+                resolve();
+            });
+        });
+    }
+    
+    // 设置敌人配置
+    public setEnemyConfig(enemyId: string): void {
+        this.enemyId = enemyId;
+        
+        if (!EnemyInstance.enemyDatabase) {
+            console.error('[EnemyInstance] 敌人配置数据库未加载');
+            return;
+        }
+        
+        // 从数据库中查找敌人配置
+        const enemies = EnemyInstance.enemyDatabase.enemies;
+        this.enemyConfig = enemies.find((enemy: any) => enemy.id === enemyId);
+        
+        if (!this.enemyConfig) {
+            console.error(`[EnemyInstance] 未找到敌人配置: ${enemyId}`);
+            return;
+        }
+        
+        // 应用配置到敌人属性
+        this.applyEnemyConfig();
+    }
+    
+    // 应用敌人配置到属性
+    private applyEnemyConfig(): void {
+        if (!this.enemyConfig) return;
+        
+        this.health = this.enemyConfig.health || 30;
+        this.maxHealth = this.health;
+        this.speed = this.enemyConfig.speed || 50;
+        this.attackPower = this.enemyConfig.attack || 10;
+        
+        console.log(`[EnemyInstance] 应用敌人配置: ${this.enemyConfig.name}, 血量: ${this.health}, 速度: ${this.speed}, 攻击力: ${this.attackPower}`);
+    }
+    
+    // 获取敌人配置信息
+    public getEnemyConfig(): any {
+        return this.enemyConfig;
+    }
+    
+    // 获取敌人名称
+    public getEnemyName(): string {
+        return this.enemyConfig?.name || '未知敌人';
+    }
+    
+    // 获取敌人类型
+    public getEnemyType(): string {
+        return this.enemyConfig?.type || 'basic';
+    }
+    
+    // 获取敌人稀有度
+    public getEnemyRarity(): string {
+        return this.enemyConfig?.rarity || 'common';
+    }
+    
+    // 获取金币奖励
+    public getGoldReward(): number {
+        return this.enemyConfig?.goldReward || 1;
+    }
+    
     // 初始化敌人
     private initializeEnemy() {
-        this.health = this.maxHealth;
+        // 确保血量正确设置
+        if (this.maxHealth > 0) {
+            this.health = this.maxHealth;
+        }
+        
         this.state = EnemyState.MOVING;
-        if (this.speed === 0) this.speed = 50;
-        if (this.attackPower === 0) this.attackPower = 10;
         this.attackInterval = 2.0; // 默认攻击间隔
         this.attackTimer = 0;
         

+ 19 - 3
assets/scripts/LevelSystem/LevelConfigManager.ts

@@ -169,8 +169,18 @@ export class LevelConfigManager extends Component {
     private validateLevelConfigData(jsonData: any, levelId: number): LevelConfig | null {
         try {
             // 基本字段验证
-            if (!jsonData.name || !jsonData.scene || !jsonData.weapons || !jsonData.waves) {
+            const weapons = jsonData.weapons || jsonData.availableWeapons;
+            if (!jsonData.name || !jsonData.scene || !weapons) {
                 console.error(`关卡 ${levelId} JSON数据缺少必要字段`);
+                if (!jsonData.name) console.error(`  缺少字段: name`);
+                if (!jsonData.scene) console.error(`  缺少字段: scene`);
+                if (!weapons) console.error(`  缺少字段: weapons 或 availableWeapons`);
+                return null;
+            }
+
+            // 检查武器列表是否为空
+            if (!Array.isArray(weapons) || weapons.length === 0) {
+                console.error(`关卡 ${levelId} 没有配置武器列表`);
                 return null;
             }
 
@@ -180,9 +190,15 @@ export class LevelConfigManager extends Component {
                 name: jsonData.name,
                 scene: jsonData.scene,
                 description: jsonData.description,
-                weapons: jsonData.weapons || [],
+                weapons: weapons,
                 waves: [],
-                levelSettings: jsonData.levelSettings
+                levelSettings: {
+                    initialHealth: jsonData.initialHealth,
+                    timeLimit: jsonData.timeLimit,
+                    difficulty: jsonData.difficulty,
+                    healthMultiplier: jsonData.healthMultiplier,
+                    ...jsonData.levelSettings
+                }
             };
 
             // 验证波次配置

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно