refactor: 整理技能与战斗相关的配置与逻辑

1.  新增技能飞行距离配置项,支持自定义直线技能飞行距离
2.  调整英雄后退击退范围从30改为20
3.  重构击退逻辑,统一敌我双方的边界钳制处理
4.  优化Boss数值配置,固定基础面板为初始英雄2倍强度
5.  修正技能6006的动画资源引用为atk1
6.  调整近战英雄默认停火距离从80改为60
7.  更新注释文档与配置注释,优化代码可读性
This commit is contained in:
panFD
2026-08-14 00:36:26 +08:00
parent 4fee02d82e
commit df0dedba75
12 changed files with 301 additions and 55 deletions

View File

@@ -423,30 +423,20 @@ export class HeroViewComp extends CCComp {
if (this.isBackingUp) return;
this.isBackingUp = true; // 🔥 设置后退状态
if (this.model.fac == FacSet.MON) {
// 基础击退距离,加上额外的距离强化
let dist = FightSet.BACK_RANG + distance;
let tx = this.node.position.x + dist;
if (tx > 320) tx = 320;
tween(this.node)
.to(0.1, { position: v3(tx, this.node.position.y, 0) })
.call(() => {
this.isBackingUp = false; // 🔥 动画完成后重置状态
})
.start();
}
// 基础击退距离 + 额外距离强化,双方阵营统一
const dist = FightSet.BACK_RANG + distance;
const isHero = this.model.fac == FacSet.HERO;
// 边界钳制HERO 不越过 BoxSet.LETF_ENDMON 不越过 BoxSet.RIGHT_END
const tx = isHero
? Math.max(BoxSet.LETF_END, this.node.position.x - dist)
: Math.min(BoxSet.RIGHT_END, this.node.position.x + dist);
if (this.model.fac == FacSet.HERO) {
let dist = 5 + distance;
let tx = this.node.position.x - dist;
if (tx < -320) tx = -320;
tween(this.node)
.to(0.1, { position: v3(tx, this.node.position.y, 0) })
.call(() => {
this.isBackingUp = false; // 🔥 动画完成后重置状态
})
.start();
}
tween(this.node)
.to(0.1, { position: v3(tx, this.node.position.y, 0) })
.call(() => {
this.isBackingUp = false; // 🔥 动画完成后重置状态
})
.start();
}
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem