feat(rogue): 添加基于等级的怪物经验计算函数

- 新增 calculateMonsterExp 函数,根据怪物ID和等级动态计算经验值
- 替换 MissionComp 中硬编码的经验值逻辑,使用新的计算函数
- 设计经验增长公式以平衡升级曲线,目标让玩家在13分钟左右达到20级
This commit is contained in:
panw
2026-01-28 17:01:29 +08:00
parent 940211d465
commit 624c8a6c4e
2 changed files with 17 additions and 13 deletions

View File

@@ -372,6 +372,21 @@ export function calculateMonsterGold(uuid: number, level: number, type: MonType)
return gold;
}
/**
* 计算怪物经验值
* 目标让玩家在13分钟左右升到20级
* @param uuid 怪物ID
* @param level 怪物等级
*/
export function calculateMonsterExp(uuid: number, level: number): number {
const cost = MonsterCost[uuid] || 1;
// 基础系数 0.8,成长因子 1.1
// 这样设计是为了对抗升级所需经验的指数增长 (1.2^L),同时平衡刷怪数量的线性增长
// T=0 (Lv1): Unit Exp ≈ 0.8
// T=13 (Lv14): Unit Exp ≈ 0.8 * 1.1^13 ≈ 2.76
return Math.max(1, Math.floor(cost * 0.8 * Math.pow(1.1, level - 1)));
}
// 怪物消耗点数配置
export const MonsterCost: Record<number, number> = {
5201: 1, // 兽人战士 (Warrior)