refactor: 统一全量buff数值为百分比口径
本次变更对齐了所有buff和技能的数值结算规则: 1. 新增项目规范明确buff数值统一使用百分比/百分点结算 2. 修改技能描述配置、属性计算逻辑,将固定数值加成改为百分比计算 3. 调整buff配置的修改类型为PercentAdd,同步更新buff说明文本 4. 重构属性计算逻辑,区分百分比加成和固定加成的处理方式 5. 更新战力计算逻辑适配新的百分比口径规则
This commit is contained in:
@@ -82,7 +82,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
knockback_chance: number = 0; // 击退强化(原击退概率,现转换为击退距离增量)
|
||||
knockback_distance: number = 0; // 击退距离强化
|
||||
knockback_res: number = 0; // 击退抗性(削减击退距离增量)
|
||||
crit_damage: number = 0; // 额外暴击伤害
|
||||
critical_damage: number = 0; // 额外暴击伤害(与 Attrs.critical_damage 同名,供 add_special_attr 动态累加)
|
||||
puncture_chance: number = 0; // 穿透概率
|
||||
puncture_dmg_bonus: number = 0; // 穿透后伤害增量(百分点,乘算加成)
|
||||
wfuny: number = 0; // 风怒
|
||||
@@ -334,8 +334,8 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
|
||||
/** 英雄实时暴击伤害 = 基础额外暴伤 + 驻场暴伤。 */
|
||||
public getRuntimeCritDamageBonus(): number {
|
||||
if (this.fac !== FacSet.HERO) return this.crit_damage;
|
||||
return this.crit_damage + HeroAttrsComp.getFieldPercentValue(FieldSkillType.HeroCritDamage);
|
||||
if (this.fac !== FacSet.HERO) return this.critical_damage;
|
||||
return this.critical_damage + HeroAttrsComp.getFieldPercentValue(FieldSkillType.HeroCritDamage);
|
||||
}
|
||||
|
||||
/** 攻速加成通过缩短普通攻击技能 CD 生效,正值越高,攻击越快。 */
|
||||
@@ -606,7 +606,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.knockback_chance = 0;
|
||||
this.knockback_distance = 0;
|
||||
this.knockback_res = 0;
|
||||
this.crit_damage = 0;
|
||||
this.critical_damage = 0;
|
||||
this.revived_count = 0;
|
||||
this.invincible_time = 0;
|
||||
this.puncture_chance = 0;
|
||||
|
||||
@@ -551,18 +551,24 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
return;
|
||||
}
|
||||
|
||||
// 永久 buff 的数值直接取 config.ap(已由 SkillConfig/SkillOverrides 提供最终值)
|
||||
// 永久 buff 统一按百分比结算:攻击/生命按基础值相对放大,其余按百分点累加
|
||||
const totalBuffValue = config.ap;
|
||||
|
||||
switch (config.buff_type) {
|
||||
case Attrs.ap:
|
||||
model.add_ap(totalBuffValue);
|
||||
case Attrs.ap: {
|
||||
// 攻击力按基础 ap 的百分比提升
|
||||
const addAp = Math.floor(model.ap * totalBuffValue / 100);
|
||||
model.add_ap(addAp);
|
||||
break;
|
||||
case Attrs.hp_max:
|
||||
model.add_hp_max(totalBuffValue);
|
||||
}
|
||||
case Attrs.hp_max: {
|
||||
// 最大生命按基础 hp_max 的百分比提升
|
||||
const addHp = Math.floor(model.hp_max * totalBuffValue / 100);
|
||||
model.add_hp_max(addHp);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// 除了 hp_max 和 ap,其他固定属性走统一的 add_special_attr 方法
|
||||
// 暴击/击晕/穿透/攻速等概率类属性按百分点直接累加
|
||||
model.add_special_attr(config.buff_type, totalBuffValue);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user