fix(技能): 调整贝塞尔曲线起始高度并修复范围技能目标位置

当技能类型为贝塞尔曲线时,直接使用最近敌人的位置作为目标位置,避免范围技能目标位置计算错误。同时将贝塞尔曲线的起始高度从18调整为25,以优化技能表现。
This commit is contained in:
panw
2026-03-30 16:48:30 +08:00
parent bbced29a0e
commit 3d97da8271
2 changed files with 5 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { Vec3 } from "cc";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { HeroViewComp } from "./HeroViewComp";
import { DTType, SkillConfig, SkillKind, SkillSet, SkillUpList, TGroup } from "../common/config/SkillSet";
import { DTType, RType, SkillConfig, SkillKind, SkillSet, SkillUpList, TGroup } from "../common/config/SkillSet";
import { Skill } from "../skill/Skill";
import { smc } from "../common/SingletonModuleComp";
import { HType } from "../common/config/heroSet";
@@ -375,6 +375,9 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
* - 范围技能:优先前排敌人位置
*/
private resolveEnemyCastTargetPos(config: SkillConfig, heroAttrs: HeroAttrsComp, heroView: HeroViewComp, nearestEnemy: HeroViewComp, maxRange: number): Vec3 | null {
if (config.RType === RType.bezier) {
return nearestEnemy.node?.position.clone() ?? null;
}
if (config.DTType !== DTType.range) {
return this.buildEnemyCastTargetPos(heroView, nearestEnemy, maxRange);
}

View File

@@ -65,7 +65,7 @@ export class SMoveDataComp extends ecs.Comp {
/** 贝塞尔曲线控制点 */
controlPoint: Vec3 = v3(0, 0, 0);
bezierStartHeight: number = 18;
bezierStartHeight: number = 25;
bezierMidHeight: number = 140;
bezierArc: number = 1;