feat: 新增穿透伤害加成机制与相关配置
1. 新增全局穿透伤害衰减系数配置与英雄属性字段 2. 实现穿透伤害加成的计算逻辑与增益buff 3. 补全技能与英雄配置的相关变更 4. 新增穿透伤害相关的光环与技能配置
This commit is contained in:
@@ -114,7 +114,7 @@ export class SkillView extends CCComp {
|
||||
}
|
||||
}
|
||||
// 命中次数按碰撞事件统计:不依赖是否最终造成伤害
|
||||
|
||||
|
||||
let model = targetView.ent.get(HeroAttrsComp);
|
||||
if (this.debugMode) {
|
||||
mLogger.log(this.debugMode, 'SkillView', `[skillView] 碰撞3`, oCol.group, seCol.group, model);
|
||||
@@ -123,7 +123,7 @@ export class SkillView extends CCComp {
|
||||
if (model.is_dead) return;
|
||||
if (this.sData.fac == model.fac) return;
|
||||
// 检查是否已经命中过这个目标(日志安全输出)
|
||||
this.apply_damage(targetView)
|
||||
this.apply_damage(targetView, this.sData.hit_count)
|
||||
}
|
||||
|
||||
onAnimationFinished(){
|
||||
@@ -146,17 +146,29 @@ export class SkillView extends CCComp {
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
// 仅负责伤害派发,不处理命中次数与实体销毁
|
||||
apply_damage(target:HeroViewComp,is_range:boolean=false){
|
||||
if(target == null) return;
|
||||
/**
|
||||
* 仅负责伤害派发,不处理命中次数与实体销毁
|
||||
* @param target 目标英雄视图
|
||||
* @param punctureIndex 当前是第几个被命中的目标(1=首目标;>=2 视为穿透目标,单体技能按 FightSet.PUNCTURE_DMG_RATIO 折算伤害,范围技能不衰减)
|
||||
*/
|
||||
apply_damage(target: HeroViewComp, punctureIndex: number = 1) {
|
||||
if (target == null) return;
|
||||
// 安全检查:如果目标实体已不存在,直接返回
|
||||
if (!target.ent) return;
|
||||
if (!this.sData) return;
|
||||
if (!this.SConf) return;
|
||||
if (this.debugMode) {
|
||||
const targetName = target.ent.get(HeroAttrsComp)?.hero_name ?? "未知目标";
|
||||
mLogger.log(this.debugMode, 'SkillView', `[skillView] 伤害 [${this.group}][eid:${this.sData.casterEid}]的 [${this.SConf.name}]对 [${target.box_group}][${targetName}][${target.ent.eid}]`);
|
||||
mLogger.log(this.debugMode, 'SkillView', `[skillView] 伤害 [${this.group}][eid:${this.sData.casterEid}]的 [${this.SConf.name}]对 [${target.box_group}][${targetName}][${target.ent.eid}] 第${punctureIndex}目标`);
|
||||
}
|
||||
// 穿透伤害衰减:仅单体伤害技能(DTType.single)且命中第2个及以后目标时按比例折算
|
||||
// 乘法模型:最终穿透系数 = PUNCTURE_DMG_RATIO * (1 + puncture_dmg_bonus/100)
|
||||
// 注:puncture_dmg_bonus 单位为百分点(30 = +30%),与项目其他概率/加成属性保持一致
|
||||
const punctureDmgBonus = this.sData.Attrs[Attrs.puncture_dmg_bonus] || 0;
|
||||
const decayRatio = (this.SConf.DTType === DTType.single && punctureIndex >= 2)
|
||||
? FightSet.PUNCTURE_DMG_RATIO * (1 + punctureDmgBonus / 100)
|
||||
: 1;
|
||||
const finalRatio = this.sData.dmg_ratio * decayRatio;
|
||||
// 使用伤害队列系统处理伤害
|
||||
DamageQueueHelper.addDamageToEntity(
|
||||
target.ent,
|
||||
@@ -164,7 +176,7 @@ export class SkillView extends CCComp {
|
||||
this.sData.casterEid,
|
||||
this.sData.s_uuid,
|
||||
this.sData.ext_dmg,
|
||||
this.sData.dmg_ratio,
|
||||
finalRatio,
|
||||
);
|
||||
}
|
||||
close_collider(){
|
||||
|
||||
Reference in New Issue
Block a user