refactor(战斗系统): 重构攻击处理逻辑并优化击退机制
- 将闪避、暴击和击退的概率检查统一为checkChance方法 - 移除HeroAtkComp类并清理无用代码 - 新增clearTalBuffByAttr方法用于清除特定属性的天赋buff - 修改HeroViewComp.do_atked方法支持可选击退参数 - 移除Attrs.BACK属性及相关配置
This commit is contained in:
@@ -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; // 🔥 添加后退状态标记
|
||||
|
||||
Reference in New Issue
Block a user