fix(技能): 调整贝塞尔曲线起始高度并修复范围技能目标位置
当技能类型为贝塞尔曲线时,直接使用最近敌人的位置作为目标位置,避免范围技能目标位置计算错误。同时将贝塞尔曲线的起始高度从18调整为25,以优化技能表现。
This commit is contained in:
@@ -2,7 +2,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { Vec3 } from "cc";
|
import { Vec3 } from "cc";
|
||||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
import { HeroViewComp } from "./HeroViewComp";
|
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 { Skill } from "../skill/Skill";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { HType } from "../common/config/heroSet";
|
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 {
|
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) {
|
if (config.DTType !== DTType.range) {
|
||||||
return this.buildEnemyCastTargetPos(heroView, nearestEnemy, maxRange);
|
return this.buildEnemyCastTargetPos(heroView, nearestEnemy, maxRange);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class SMoveDataComp extends ecs.Comp {
|
|||||||
|
|
||||||
/** 贝塞尔曲线控制点 */
|
/** 贝塞尔曲线控制点 */
|
||||||
controlPoint: Vec3 = v3(0, 0, 0);
|
controlPoint: Vec3 = v3(0, 0, 0);
|
||||||
bezierStartHeight: number = 18;
|
bezierStartHeight: number = 25;
|
||||||
bezierMidHeight: number = 140;
|
bezierMidHeight: number = 140;
|
||||||
bezierArc: number = 1;
|
bezierArc: number = 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user