buff 治疗等技能完善

This commit is contained in:
2025-07-09 17:54:03 +08:00
parent f73badd5fc
commit 7dcaf19925
4 changed files with 311 additions and 233 deletions

View File

@@ -89,8 +89,9 @@ export class SkillCom extends CCComp {
if(this.group==BoxSet.MONSTER) bm.controlPointSide=-1
bm.moveTo(this.targetPos)
break;
case AType.fixedStart:
case AType.StartEnd:
// 2段位移先升高然后移到目的地
this.executeTwoStageMovement();
break;
case AType.fixedEnd:
this.node.setPosition(this.targetPos.x,this.targetPos.y,0)
@@ -174,6 +175,38 @@ export class SkillCom extends CCComp {
return debuff
}
/**
* 执行2段位移先升高然后移到目的地
*/
private executeTwoStageMovement() {
const totalDuration = SkillSet[this.s_uuid].in;
const firstStageDuration = totalDuration * 0.4; // 第一段占40%时间
const secondStageDuration = totalDuration * 0.6; // 第二段占60%时间
// 第一段:升高
const riseHeight = 100; // 升高高度
const midPosition = v3(this.node.position.x, this.node.position.y + riseHeight, 0);
// 第二段:移动到目标位置
const finalPosition = v3(this.targetPos.x, this.targetPos.y, 0);
// 创建缓动序列
tween(this.node)
// 第一段:升高
.to(firstStageDuration, { position: midPosition }, {
easing: 'quadOut' // 使用二次缓出效果,让上升更自然
})
// 第二段:移动到目标位置
.to(secondStageDuration, { position: finalPosition }, {
easing: 'quadInOut' // 使用二次缓入缓出效果
}).call(()=>{
this.do_buff()
})
.start();
}
do_buff(){
console.log("[SkillCom]:do_buff")
}
private startLinearMove(dt: number) {
if (!this.speed || this.is_destroy) return;
if(this.s_uuid == 6005){