refactor(战斗系统): 重构攻击处理逻辑并优化击退机制
- 将闪避、暴击和击退的概率检查统一为checkChance方法 - 移除HeroAtkComp类并清理无用代码 - 新增clearTalBuffByAttr方法用于清除特定属性的天赋buff - 修改HeroViewComp.do_atked方法支持可选击退参数 - 移除Attrs.BACK属性及相关配置
This commit is contained in:
@@ -425,6 +425,17 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
delete this.BUFFS_TAL[t_uuid];
|
||||
this.recalculateSingleAttr(attrIndex);
|
||||
}
|
||||
clearTalBuffByAttr(attrIndex: number) {
|
||||
let changed = false;
|
||||
for (const key in this.BUFFS_TAL) {
|
||||
const b = this.BUFFS_TAL[Number(key)];
|
||||
if (b && b.attrIndex === attrIndex) {
|
||||
delete this.BUFFS_TAL[Number(key)];
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (changed) this.recalculateSingleAttr(attrIndex);
|
||||
}
|
||||
|
||||
addTalent(eff: number, value: number) {
|
||||
const t = this.Talents[eff] || { value: 0, count: 0 };
|
||||
|
||||
Reference in New Issue
Block a user