feat(penetration): 将穿刺机制从固定次数改为概率触发模式

统一重命名所有穿刺相关属性为 `puncture_chance` 以规范代码命名,新增FightSet.PUNCTURE_DOWN配置项控制每次穿透后的概率衰减值。调整6408号穿刺强化技能,将提升穿刺次数效果改为提升20%穿透概率并修正AP消耗。在技能命中逻辑中添加穿透概率判定逻辑,实现概率穿透效果,同时更新所有引用原属性的代码位置确保功能正常。
This commit is contained in:
walkpan
2026-05-23 14:08:45 +08:00
parent cb53417ea8
commit 0b59f601d8
7 changed files with 41 additions and 9 deletions

View File

@@ -212,13 +212,14 @@ export class Skill extends ecs.Entity {
const sCrt = (config.crt ?? 0)+(SUp.crt*skill_lv);
const sFrz = (config.frz ?? 0)+(SUp.frz*skill_lv);
const sAp =config.ap+(SUp.ap*skill_lv);
const sHit=config.hit_count+(SUp.hit_count*skill_lv) + cAttrsComp.puncture
const sHit=config.hit_count+(SUp.hit_count*skill_lv);
sDataCom.Attrs[Attrs.ap] = Math.floor(cAttrsComp.ap*sAp/100); //技能的ap是百分值 需要/100 而且需要再最终计算总ap时再/100不然会出现ap为90%变0
sDataCom.Attrs[Attrs.critical] = cAttrsComp.getRuntimeCritical() + sCrt;
sDataCom.Attrs[Attrs.critical_damage] = cAttrsComp.getRuntimeCritDamageBonus();
sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.getRuntimeFreezeChance() + sFrz;
sDataCom.Attrs[Attrs.knockback_chance] = cAttrsComp.knockback_chance || 0;
sDataCom.Attrs[Attrs.knockback_distance] = cAttrsComp.knockback_distance || 0;
sDataCom.Attrs[Attrs.puncture_chance] = cAttrsComp.getRuntimePunctureChance(); // 初始化携带施法者的穿透概率
sDataCom.s_uuid=s_uuid
sDataCom.skill_lv = Math.max(0, skill_lv);
sDataCom.fac=cAttrsComp.fac