refactor: 简化攻击距离与职业类型系统
- 移除 SkillRange 枚举和 SkillDisVal 常量,统一使用 HType 表示攻击距离 - 删除 heroInfo 中的 rangeType 字段,直接使用 type 字段 - 更新英雄配置,将职业类型简化为近战、中程、远程三类 - 移除怪物属性中的 mp 和 def 字段,简化属性计算 - 更新移动和技能距离计算逻辑,直接使用 HType 判断
This commit is contained in:
@@ -39,9 +39,7 @@ export interface IMonsConfig {
|
||||
*/
|
||||
export interface MonAttrs {
|
||||
hp: number;
|
||||
mp: number;
|
||||
ap: number;
|
||||
def: number;
|
||||
speed: number;
|
||||
exp?: number;
|
||||
gold?: number;
|
||||
@@ -285,7 +283,7 @@ export function getMonAttr(stage: number, uuid: number, monType: MonType = MonTy
|
||||
const baseMonster = HeroInfo[uuid];
|
||||
if (!baseMonster) {
|
||||
mLogger.warn(true, 'RogueConfig', `[RogueConfig] 未找到怪物ID: ${uuid}`);
|
||||
return { hp: 100, mp: 100, ap: 10, def: 0, speed: 100 };
|
||||
return { hp: 100, ap: 10, speed: 100 };
|
||||
}
|
||||
|
||||
// 计算波次因子
|
||||
@@ -308,15 +306,9 @@ export function getMonAttr(stage: number, uuid: number, monType: MonType = MonTy
|
||||
const ap = applyGrowthFormula(baseMonster.ap, waveFactor, GrowthType.LINEAR) * typeMultiplier * qualityRatio;
|
||||
const speed = applyGrowthFormula(baseMonster.speed, waveFactor, GrowthType.LOGARITHMIC);
|
||||
|
||||
// MP和DEF使用线性成长 (应用质量系数)
|
||||
const mp = applyGrowthFormula(baseMonster.mp, waveFactor, GrowthType.LINEAR) * qualityRatio;
|
||||
const def = applyGrowthFormula(baseMonster.def, waveFactor, GrowthType.LINEAR) * typeMultiplier * qualityRatio;
|
||||
|
||||
return {
|
||||
hp: Math.floor(hp),
|
||||
mp: Math.floor(mp),
|
||||
ap: Math.floor(ap),
|
||||
def: Math.floor(def),
|
||||
speed: Math.floor(speed)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user