buff 治疗等技能完善
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user