feat: 新增麻痹异常状态机制
1. 新增麻痹概率属性与相关属性计算方法 2. 为英雄普攻和技能添加麻痹触发逻辑 3. 配置闪电系技能默认30%麻痹概率 4. 更新英雄技能说明与配置参数
This commit is contained in:
@@ -202,6 +202,10 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpda
|
||||
const stunChance = (damageEvent.Attrs[Attrs.stun_chance] || 0) - TAttrsComp.getFinalStunRes();
|
||||
const isStun = !TAttrsComp.isStun() && this.checkChance(stunChance);
|
||||
|
||||
// 麻痹判定(无麻痹抗性,仅按概率)
|
||||
const paralyzeChance = damageEvent.Attrs[Attrs.paralyze_chance] || 0;
|
||||
const isParalyze = !TAttrsComp.isParalyze() && this.checkChance(paralyzeChance);
|
||||
|
||||
// ✅ 触发视图层表现(伤害数字、受击动画、冰冻、击晕、击退)
|
||||
if (targetView) {
|
||||
if (isDot) {
|
||||
@@ -242,6 +246,9 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpda
|
||||
smc.vmdata.scores.stun_count++;
|
||||
}
|
||||
}
|
||||
if (isParalyze) {
|
||||
TAttrsComp.toParalyze();
|
||||
}
|
||||
}
|
||||
|
||||
// 命中附带 debuff(如灼烧 DoT):仅普攻路径,复用友方 timed_buff_id 机制;
|
||||
|
||||
@@ -81,6 +81,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
freeze_res: number = 0; // 冰冻抗性
|
||||
stun_chance: number = 0; // 击晕概率
|
||||
stun_res: number = 0; // 击晕抗性
|
||||
paralyze_chance: number = 0; // 麻痹概率(雷电技能默认 para=30,此处为基础/光环加成)
|
||||
knockback_chance: number = 0; // 击退强化(原击退概率,现转换为击退距离增量)
|
||||
knockback_distance: number = 0; // 击退距离强化
|
||||
knockback_res: number = 0; // 击退抗性(削减击退距离增量)
|
||||
@@ -459,6 +460,12 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
return base + mods.flatSum + mods.pctSum;
|
||||
}
|
||||
|
||||
/** 最终麻痹概率 = 基础 + 限时修饰(加法模型),雷电技能默认再叠加技能自身 para=30 */
|
||||
public getFinalParalyzeChance(): number {
|
||||
const mods = this.aggregateTimedMods(Attrs.paralyze_chance);
|
||||
return this.paralyze_chance + mods.flatSum + mods.pctSum;
|
||||
}
|
||||
|
||||
/** 最终击退强化 = 基础击退强化 + 限时修饰(加法模型,转换为击退距离增量) */
|
||||
public getFinalKnockbackChance(): number {
|
||||
const mods = this.aggregateTimedMods(Attrs.knockback_chance);
|
||||
@@ -642,6 +649,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.freeze_res = 0;
|
||||
this.stun_chance = 0;
|
||||
this.stun_res = 0;
|
||||
this.paralyze_chance = 0;
|
||||
this.knockback_chance = 0;
|
||||
this.knockback_distance = 0;
|
||||
this.knockback_res = 0;
|
||||
|
||||
@@ -122,6 +122,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
mockAttrs.critical = 0;
|
||||
mockAttrs.freeze_chance = 0;
|
||||
mockAttrs.stun_chance = 0;
|
||||
mockAttrs.paralyze_chance = 0;
|
||||
mockAttrs.puncture_chance = 0;
|
||||
mockAttrs.fac = FacSet.HERO;
|
||||
mockAttrs.type = HType.Long; // 假定为远程,拥有较长索敌范围
|
||||
|
||||
Reference in New Issue
Block a user