chore: 调整游戏数值与配置,优化怪物与战场体验

1. 调整怪物移动速度、攻击距离等基础属性
2. 修正英雄站位坐标,优化战场布局
3. 重构分段刷怪逻辑,修复刷怪计数异常问题
4. 调整怪物属性模板与关卡掉落预算,平衡游戏难度
5. 优化刷怪波次的怪物数量配置,调整生成节奏
This commit is contained in:
panw
2026-05-26 09:45:47 +08:00
parent b256171471
commit 9a0b768be8
5 changed files with 78 additions and 86 deletions

View File

@@ -106,6 +106,8 @@ export class MissionMonCompComp extends CCComp {
private phaseTargetCount: number = 0;
/** 当前阶段已生成的怪物数 */
private phaseSpawnedCount: number = 0;
/** 本波怪物总数量(分段计算基准,避免 shift 后长度变化) */
private waveTotalForPhase: number = 0;
// ======================== 生命周期 ========================
@@ -136,24 +138,26 @@ export class MissionMonCompComp extends CCComp {
// 逐步刷怪逻辑 (分 3 段刷出)
if (this.pendingMonsters.length > 0) {
// 如果当前阶段的怪物已经刷完,则进入延迟等待下一阶段
if (this.phaseSpawnedCount >= this.phaseTargetCount && this.currentSpawnPhase < 3) {
this.phaseDelayTimer -= dt;
if (this.phaseDelayTimer <= 0) {
this.currentSpawnPhase++;
this.phaseSpawnedCount = 0;
this.phaseTargetCount = this.currentSpawnPhase === 3 ?
this.pendingMonsters.length :
Math.ceil(this.pendingMonsters.length / (4 - this.currentSpawnPhase));
this.phaseDelayTimer = 3.0;
const base = this.waveTotalForPhase;
if (this.currentSpawnPhase === 2) {
this.phaseTargetCount = Math.ceil(base / 3);
} else {
this.phaseTargetCount = base - this.phaseTargetCount * 2;
if (this.phaseTargetCount <= 0) this.phaseTargetCount = this.pendingMonsters.length;
}
}
return;
}
this.spawnTimer += dt;
// 控制刷怪速率:例如每 0.2 秒刷 1-2 只
if (this.spawnTimer > 0.2) {
this.spawnTimer = 0;
// 一次出 2 只,加快进度
for (let i = 0; i < 2; i++) {
if (this.pendingMonsters.length === 0 || this.phaseSpawnedCount >= this.phaseTargetCount) break;
const monData = this.pendingMonsters.shift()!;
@@ -194,13 +198,11 @@ export class MissionMonCompComp extends CCComp {
this.pendingMonsters = monsters;
smc.vmdata.mission_data.pending_mon_num = this.pendingMonsters.length;
this.waveTargetCount = monsters.length;
this.waveTotalForPhase = monsters.length;
// 初始化分段刷怪状态
this.currentSpawnPhase = 1;
this.phaseSpawnedCount = 0;
// 第一段生成 1/3 的怪物
this.phaseTargetCount = Math.ceil(this.pendingMonsters.length / 3);
// 每段之间的延迟时间,可以根据需要调整,例如 3 秒
this.phaseTargetCount = Math.ceil(monsters.length / 3);
this.phaseDelayTimer = 3.0;
let hasBoss = monsters.some(m => m.isBoss);