diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 3c95b608..643f12c9 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -204,5 +204,5 @@ export const HeroInfo: Record = { type:HType.Melee,lv:1,hp:150,ap:10,speed:110,skills:[6001,6003],info:"战术目标:提供加速光环,改变怪群推进节奏"}, // 6. 精英/BOSS型 5701:{uuid:5701,name:"兽人首领(BOSS)",icon:"1001",path:"mo4", fac:FacSet.MON, kind:1,as:2.5,ss:10, - type:HType.Melee,lv:3,hp:2000,ap:60,speed:120,skills:[6001,6003],info:"终极考验:极高HP,检测大招重置与辐射协同输出"}, + type:HType.Melee,lv:3,hp:2000,ap:60,speed:120,skills:[6002,6004],info:"终极考验:极高HP,检测大招重置与辐射协同输出"}, }; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 6a40496d..cdd45cc3 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -41,7 +41,7 @@ export class HeroViewComp extends CCComp { // ==================== UI 节点引用 ==================== private top_node: Node = null!; private topOpacity: UIOpacity = null!; - private hpBarBasePos: Vec3 = v3(); + private topBasePos: Vec3 = v3(); private readonly barIdleOpacity: number = 153; private readonly barActiveOpacity: number = 255; private readonly idleOpacityDelay: number = 0.25; @@ -114,10 +114,8 @@ export class HeroViewComp extends CCComp { private initUINodes() { this.top_node = this.node.getChildByName("top"); this.topOpacity = this.top_node.getComponent(UIOpacity) || this.top_node.addComponent(UIOpacity); + this.topBasePos = this.top_node.position.clone(); const hpNode = this.top_node.getChildByName("hp"); - if (hpNode) { - this.hpBarBasePos = hpNode.position.clone(); - } if(this.model.fac==FacSet.HERO){ hpNode.getChildByName("Bar").getComponent(Sprite).color=new Color("#2ECC71") } @@ -224,17 +222,16 @@ export class HeroViewComp extends CCComp { } private playHpBarShake() { - const hpNode = this.top_node?.getChildByName("hp"); - if (!hpNode || !hpNode.isValid) return; - Tween.stopAllByTarget(hpNode); - hpNode.setPosition(this.hpBarBasePos); - tween(hpNode) + if (!this.top_node || !this.top_node.isValid) return; + Tween.stopAllByTarget(this.top_node); + this.top_node.setPosition(this.topBasePos); + tween(this.top_node) .by(0.04, { position: v3(-3, 0, 0) }) .by(0.04, { position: v3(6, 0, 0) }) .by(0.04, { position: v3(-5, 0, 0) }) .by(0.04, { position: v3(2, 0, 0) }) .call(() => { - hpNode.setPosition(this.hpBarBasePos); + this.top_node.setPosition(this.topBasePos); }) .start(); } @@ -601,6 +598,10 @@ export class HeroViewComp extends CCComp { // 清理残留的定时器和缓动 this.unscheduleAllCallbacks(); Tween.stopAllByTarget(this.node); + if (this.top_node && this.top_node.isValid) { + Tween.stopAllByTarget(this.top_node); + this.top_node.setPosition(this.topBasePos); + } // 清理碰撞器事件监听 const collider = this.getComponent(Collider2D);