refactor: 移除 BossList 并重构 boss 检测逻辑
移除 RogueConfig 中已弃用的 BossList 常量,改为直接使用 MonList 中的分类来检测 boss 类型。这消除了冗余的配置数据,使 boss 类型的判断逻辑与 MonList 的维护来源保持一致,提高了代码的可维护性。
This commit is contained in:
@@ -8,7 +8,7 @@ import { HeroInfo, HType } from "../common/config/heroSet";
|
|||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import {BoxSet } from "../common/config/GameSet";
|
import {BoxSet } from "../common/config/GameSet";
|
||||||
import { BossList, MonList, MonType, SpawnPowerBias, StageBossGrow, StageGrow, UpType, WaveSlotConfig, DefaultWaveSlot, IWaveSlot } from "./RogueConfig";
|
import { MonList, MonType, SpawnPowerBias, StageBossGrow, StageGrow, UpType, WaveSlotConfig, DefaultWaveSlot, IWaveSlot } from "./RogueConfig";
|
||||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||||
import { MoveComp } from "../hero/MoveComp";
|
import { MoveComp } from "../hero/MoveComp";
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
@@ -106,7 +106,7 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
const item = this.MonQueue.shift();
|
const item = this.MonQueue.shift();
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
const upType = this.getRandomUpType();
|
const upType = this.getRandomUpType();
|
||||||
const isBoss = BossList.includes(item.uuid);
|
const isBoss = MonList[MonType.MeleeBoss].includes(item.uuid) || MonList[MonType.LongBoss].includes(item.uuid);
|
||||||
// 简单推断:如果是 boss 默认给 2 格(你也可以从配置里反查或者加专门的英雄表配置)
|
// 简单推断:如果是 boss 默认给 2 格(你也可以从配置里反查或者加专门的英雄表配置)
|
||||||
const slotsPerMon = isBoss ? 2 : 1;
|
const slotsPerMon = isBoss ? 2 : 1;
|
||||||
this.enqueueMonsterRequest(item.uuid, isBoss, upType, Math.max(1, Number(item.level ?? 1)), slotsPerMon, true);
|
this.enqueueMonsterRequest(item.uuid, isBoss, upType, Math.max(1, Number(item.level ?? 1)), slotsPerMon, true);
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ export const MonList = {
|
|||||||
[MonType.MeleeBoss]:[6006,6015], // 近战boss
|
[MonType.MeleeBoss]:[6006,6015], // 近战boss
|
||||||
[MonType.LongBoss]:[6104], // 远程boss
|
[MonType.LongBoss]:[6104], // 远程boss
|
||||||
}
|
}
|
||||||
export const BossList = [6006,6104,6015]
|
/*
|
||||||
export const SpawnPowerBias = 1
|
*** 全局刷怪强度配置,后期根据玩家强度动态调整
|
||||||
|
*/
|
||||||
|
export const SpawnPowerBias = 1
|
||||||
export interface IWaveSlot {
|
export interface IWaveSlot {
|
||||||
type: number; // 对应 MonType
|
type: number; // 对应 MonType
|
||||||
count: number; // 占位数量
|
count: number; // 占位数量
|
||||||
|
|||||||
Reference in New Issue
Block a user