refactor(rogue): 重构肉鸽刷怪系统,新增动态难度与分批刷怪
1. 重构RogueConfig:替换旧强化系统为动态难度调节器,调整波次配置为20波通关,新增技能池与阵营适配 2. 优化刷怪逻辑:实现每波3批10秒间隔的分批刷怪,调整怪物上限为18只 3. 新增驻场技能支持:添加resolveFieldByLv处理等级化驻场技能,扩展FieldSkillHelper支持多阵营统计 4. 调整关卡判定:将最大波次从15改为20,新增英雄死亡计数与难度动态调节 5. 优化代码结构:移除废弃字段,统一技能注入方式,修复槽位复用逻辑
This commit is contained in:
@@ -48,7 +48,7 @@ import { Tooltip } from "../skill/Tooltip";
|
||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||
import { FieldSkillType } from "../common/config/SkillSet";
|
||||
import { FieldSkillHelper } from "../hero/FieldSkillHelper";
|
||||
import { spawningEngine } from "./RogueConfig";
|
||||
import { spawningEngine, MAX_WAVE, DynamicTuner } from "./RogueConfig";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 任务(关卡)生命周期阶段 */
|
||||
@@ -524,20 +524,28 @@ export class MissionComp extends CCComp {
|
||||
|
||||
let allAlive = true;
|
||||
let hasHero = false;
|
||||
let heroDeathCount = 0;
|
||||
ecs.query(this.heroAttrsMatcher).forEach(entity => {
|
||||
const attrs = entity.get(HeroAttrsComp);
|
||||
if (attrs && attrs.fac === FacSet.HERO) {
|
||||
hasHero = true;
|
||||
if (attrs.is_dead) allAlive = false;
|
||||
if (attrs.is_dead) {
|
||||
allAlive = false;
|
||||
heroDeathCount++;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 【动态难度调节】根据本波战况自动放水 / 加压
|
||||
DynamicTuner.adjust(this.clearTime, heroDeathCount);
|
||||
mLogger.log(this.debugMode, 'MissionComp', `[DynamicTuner] wave=${this.currentWave} clearTime=${this.clearTime.toFixed(1)}s deaths=${heroDeathCount} factor=${DynamicTuner.factor.toFixed(2)}`);
|
||||
// 【评分系统 - 战绩分】记录全员存活的胜利回合数(额外加分)
|
||||
if (hasHero && allAlive) {
|
||||
smc.vmdata.scores.wave_all_alive_count++;
|
||||
}
|
||||
|
||||
// 【评分系统 - 战绩分】判断是否通过最后一关(第15回合)
|
||||
if (this.currentWave === 15) {
|
||||
// 【评分系统 - 战绩分】判断是否通过最后一关(第20回合)
|
||||
if (this.currentWave === MAX_WAVE) {
|
||||
smc.vmdata.scores.passed_wave_20 = true;
|
||||
}
|
||||
}
|
||||
@@ -889,8 +897,8 @@ export class MissionComp extends CCComp {
|
||||
// 怪物全灭检测:如果战斗阶段场上没有任何活着的怪物,且待刷新的怪物队列也为空,直接结束战斗进入下一波的准备阶段
|
||||
const pendingCount = smc.vmdata.mission_data.pending_mon_num || 0;
|
||||
if (monsterCount === 0 && pendingCount === 0 && smc.mission.play && !smc.mission.pause && this.currentPhase === MissionPhase.Battle) {
|
||||
if (this.currentWave >= 15) {
|
||||
// 15 波通关
|
||||
if (this.currentWave >= MAX_WAVE) {
|
||||
// 20 波通关
|
||||
this.open_Victory(null, false);
|
||||
} else {
|
||||
oops.message.dispatchEvent("TimeUpAdvanceWave");
|
||||
|
||||
Reference in New Issue
Block a user