refactor: 统一全量buff数值为百分比口径

本次变更对齐了所有buff和技能的数值结算规则:
1.  新增项目规范明确buff数值统一使用百分比/百分点结算
2.  修改技能描述配置、属性计算逻辑,将固定数值加成改为百分比计算
3.  调整buff配置的修改类型为PercentAdd,同步更新buff说明文本
4.  重构属性计算逻辑,区分百分比加成和固定加成的处理方式
5.  更新战力计算逻辑适配新的百分比口径规则
This commit is contained in:
panFD
2026-08-16 19:21:23 +08:00
parent 284d124486
commit a5ca43a62c
7 changed files with 55 additions and 46 deletions

View File

@@ -1114,7 +1114,7 @@ function calcBuffPermanentEquivalent(buff: BuffConfig, apEff: number, cd: number
}
/** 计算 Support 类技能单次触发的效果价值 */
function calcSupportEffectValue(config: SkillConfig, apEff: number, cd: number, seconds: number): number {
function calcSupportEffectValue(config: SkillConfig, hpEff: number, apEff: number, cd: number, seconds: number): number {
const weights = HERO_POWER_WEIGHTS;
const value = config.ap || 0;
@@ -1131,10 +1131,12 @@ function calcSupportEffectValue(config: SkillConfig, apEff: number, cd: number,
switch (config.buff_type) {
case Attrs.ap:
return (value / cd) * weights.W_DPS_PER_SEC * seconds;
// 永久 buff 已改为百分比口径value 是百分比,需先换算为基础 ap 的绝对增量
return ((value / 100) * apEff / cd) * weights.W_DPS_PER_SEC * seconds;
case Attrs.hp_max:
case Attrs.hp:
return value * weights.W_HP;
// 永久 buff 已改为百分比口径value 是百分比,需先换算为基础 hp 的绝对增量
return (value / 100) * hpEff * weights.W_HP;
case Attrs.critical:
return (value / 100) * (apEff / cd) * 0.5 * weights.W_DPS_PER_SEC * seconds;
case Attrs.critical_damage:
@@ -1154,7 +1156,7 @@ function calcSupportEffectValue(config: SkillConfig, apEff: number, cd: number,
/** 计算单条技能配置单次触发的效果价值 */
function calcSkillEffectValue(skill: SkillConfig, overrides: SkillOverrides | undefined, hero: heroInfo, targetLv: number, seconds: number): number {
const { ap: apEff } = getEffectiveStats(hero, targetLv);
const { hp: hpEff, ap: apEff } = getEffectiveStats(hero, targetLv);
const cd = getAttackCd(hero);
const config = overrides ? mergeSkillParams(skill, overrides) : skill;
const weights = HERO_POWER_WEIGHTS;
@@ -1168,7 +1170,7 @@ function calcSkillEffectValue(skill: SkillConfig, overrides: SkillOverrides | un
// 护盾为数值减免型1 点护盾 ≈ 1 点预期伤害减免
return (config.ap || 0) * weights.W_shield;
case SkillKind.Support:
return calcSupportEffectValue(config, apEff, cd, seconds);
return calcSupportEffectValue(config, hpEff, apEff, cd, seconds);
default:
return 0;
}