feat(attr): add vulnerable resist attribute and damage calculation
1. 新增易伤抗性属性vulnerable_res,支持百分比减免易伤附加伤害 2. 实现易伤伤害计算逻辑,支持叠加层数与值覆盖 3. 更新技能与Buff配置,修正灼烧技能描述为易伤效果 4. 新增中毒、减攻Debuff配置与易伤Buff常量定义
This commit is contained in:
@@ -86,6 +86,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
puncture_chance: number = 0; // 穿透概率
|
||||
puncture_dmg_bonus: number = 0; // 穿透后伤害增量(百分点,乘算加成)
|
||||
wfuny: number = 0; // 风怒
|
||||
vulnerable_res: number = 0; // 易伤抗性(百分比减免易伤附加伤害)
|
||||
|
||||
revived_count: number = 0; // 已复活次数
|
||||
invincible_time: number = 0;// 无敌时间
|
||||
@@ -510,6 +511,12 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
return this.knockback_res + mods.flatSum + mods.pctSum;
|
||||
}
|
||||
|
||||
/** 最终易伤抗性 = 基础 + 限时修饰(加法模型),百分比减免易伤附加伤害 */
|
||||
public getFinalVulnerableRes(): number {
|
||||
const mods = this.aggregateTimedMods(Attrs.vulnerable_res);
|
||||
return this.vulnerable_res + mods.flatSum + mods.pctSum;
|
||||
}
|
||||
|
||||
/** 根据攻速加成换算实际攻击间隔,避免直接改写配置里的基础 CD。 */
|
||||
public getEffectiveSkillCd(skillId: number): number {
|
||||
const skill = this.skills[skillId];
|
||||
@@ -605,6 +612,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.puncture_chance = 0;
|
||||
this.puncture_dmg_bonus = 0;
|
||||
this.wfuny = 0;
|
||||
this.vulnerable_res = 0;
|
||||
this.boom = false;
|
||||
|
||||
// 重置技能距离缓存
|
||||
|
||||
Reference in New Issue
Block a user