fix(游戏平衡): 调整怪物生成参数和预算计算

- 修改MonSet中的坐标参数以优化怪物生成位置
- 降低基础预算值防止队列积压
- 增加怪物生成间隔时间并移除暂停机制
This commit is contained in:
walkpan
2026-01-02 14:40:43 +08:00
parent ffa6bbec6f
commit 91129505d2
3 changed files with 12 additions and 30 deletions

View File

@@ -66,12 +66,12 @@ export const MonSet = {
}
export enum MonStart {
SLINE_1=130, //上线y
SLINE_2=110, //下线y
SLINE_3=150, //下线y
SLINE_4=90, //y起始点
START_X=240, //x起始点
START_I=60, //x轴间隔
SLINE_1=140, //上线y
SLINE_2=100, //下线y
SLINE_3=180, //下线y
SLINE_4=60, //y起始点
START_X=360, //x起始点
START_I=90, //x轴间隔
}
export enum HeroConf{

View File

@@ -26,11 +26,11 @@ export class MissionMonCompComp extends CCComp {
buffs: BuffConf[]
}> = [];
private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 0.1; // 每个怪物生成间隔时间
private spawnInterval: number = 0.6; // 每个怪物生成间隔时间(减半速度)
private spawnTimer: number = 0; // 生成计时器
private spawnCount: number = 0; // 召唤计数器
private pauseInterval: number = 5.0; // 暂停间隔时间5秒
private isPausing: boolean = false; // 是否正在暂停
// private pauseInterval: number = 5.0; // 暂停间隔时间5秒
// private isPausing: boolean = false; // 是否正在暂停
private eventProcessed: boolean = false; // 事件是否已处理
/** 全局生成顺序计数器,用于层级管理 */
private globalSpawnOrder: number = 0;
@@ -97,29 +97,10 @@ export class MissionMonCompComp extends CCComp {
if (this.MonQueue.length > 0 && !this.isSpawning) {
this.spawnTimer += dt;
// 检查是否需要暂停每召唤5次后暂停5秒
if (this.isPausing) {
if (this.spawnTimer >= this.pauseInterval) {
// 暂停结束,重置状态
this.isPausing = false;
this.spawnCount = 0;
this.spawnTimer = 0;
// console.log("[MissionMonComp]: 暂停结束,继续召唤怪物");
}
return; // 暂停期间不召唤怪物
}
// 正常召唤间隔
if (this.spawnTimer >= this.spawnInterval) {
this.spawnNextMonster();
this.spawnTimer = 0;
// 检查是否需要进入暂停状态
if (this.spawnCount >= 5) {
this.isPausing = true;
this.spawnTimer = 0; // 重置计时器用于暂停计时
// console.log("[MissionMonComp]: 已召唤5只怪物开始暂停5秒");
}
}
}
}
@@ -127,7 +108,7 @@ export class MissionMonCompComp extends CCComp {
do_mon_wave(){
// 重置召唤相关状态
this.spawnCount = 0;
this.isPausing = false;
// this.isPausing = false;
this.spawnTimer = 0;
this.eventProcessed = false;

View File

@@ -256,7 +256,8 @@ function getSpawnWeights(timeInSeconds: number): SpawnWeight[] {
export function calculateBudget(timeInSeconds: number, heroHpRatio: number = 1.0): number {
// 基础预算:每秒产生的点数
// 假设1分钟时为20点公式: Budget = Base * (1 + 60/60 * 0.2) = Base * 1.2 = 20 => Base ≈ 16
const Base_Budget = 16;
// 修改:降低基础预算,避免队列积压。每秒 1.5 点左右(减半)。
const Base_Budget = 1.5;
// 时间因子:随时间增加难度
const timeFactor = 1 + (timeInSeconds / 60) * 0.2;