refactor(战斗系统): 重构攻击处理逻辑并优化击退机制

- 将闪避、暴击和击退的概率检查统一为checkChance方法
- 移除HeroAtkComp类并清理无用代码
- 新增clearTalBuffByAttr方法用于清除特定属性的天赋buff
- 修改HeroViewComp.do_atked方法支持可选击退参数
- 移除Attrs.BACK属性及相关配置
This commit is contained in:
2025-11-20 16:48:14 +08:00
parent b4fd807ddc
commit 51f32b1d29
4 changed files with 42 additions and 54 deletions

View File

@@ -350,7 +350,7 @@ export class HeroViewComp extends CCComp {
this.ent.destroy();
}
do_atked(damage:number,isCrit:boolean,s_uuid:number){
do_atked(damage:number,isCrit:boolean,s_uuid:number,isBack:boolean=false){
// 受到攻击时显示血条并设置显示时间即使伤害为0也显示
this.top_node.active = true;
this.hpBarShowCD = this.hpBarShowTime;
@@ -359,8 +359,8 @@ export class HeroViewComp extends CCComp {
// 视图层表现
let SConf=SkillSet[s_uuid]
this.back()
this.showDamage(damage, isCrit, SConf.DAnm); // 暴击状态由战斗系统内部处理, DAnm和EAnm共用设定数组
if (isBack) this.back()
this.showDamage(damage, isCrit, SConf.DAnm);
}
private isBackingUp: boolean = false; // 🔥 添加后退状态标记