refactor(map): 重构怪物类型枚举和配置以提高可读性
- 将 MonType 枚举值重命名为更具描述性的名称(如 AP -> Melee) - 为 StageGrow 和 StageBossGrow 配置添加注释说明 - 更新 MissionMonComp 中的回退逻辑以使用新的 Melee 类型 - 清理未使用的配置常量(StageDuration、SpawnCd 等) - 扩展 BossList 包含更多Boss怪物ID
This commit is contained in:
@@ -189,7 +189,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
const typeKeys = Object.keys(MonType).map(k => (MonType as any)[k]).filter(v => typeof v === "number");
|
||||
const randomType = typeKeys[Math.floor(Math.random() * typeKeys.length)] as number;
|
||||
// 如果某类型配置被清空,回退到 AP 类型,避免空池异常
|
||||
const pool = MonList[randomType] || MonList[MonType.AP];
|
||||
const pool = MonList[randomType] || MonList[MonType.Melee];
|
||||
const index = Math.floor(Math.random() * pool.length);
|
||||
return pool[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user