From f7db4da1138b57aa26bad856d660e0e2b37c7176 Mon Sep 17 00:00:00 2001 From: walkpan Date: Thu, 21 May 2026 20:13:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=80=AA=E7=89=A9?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E3=80=81=E6=9C=9D=E5=90=91=E5=92=8C=E9=A3=98?= =?UTF-8?q?=E5=AD=97=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修正技能节点缩放逻辑,确保镜像显示正确 2. 修复怪物反向移动时的朝向错误 3. 调整伤害飘字的Y轴偏移,优化显示位置 4. 更新怪物配置的技能ID,修正技能绑定错误 --- assets/script/game/common/config/heroSet.ts | 20 ++++++++++---------- assets/script/game/skill/SMoveSystem.ts | 10 ++++++++-- assets/script/game/skill/Skill.ts | 2 +- assets/script/game/skill/TooltipCom.ts | 15 +++++++++------ 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 41c0b6f0..9db57c54 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -193,35 +193,35 @@ export const HeroInfo: Record = { // 基础怪物 6001:{uuid:6001,name:"兽人初阶战士",path:"m1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:360,ap:12,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:0.65,ccd:0}},info:""}, 6002:{uuid:6002,name:"兽人高阶战士",path:"m2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:360,ap:12,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:0.65,ccd:0}},info:""}, 6003:{uuid:6003,name:"兽人初阶射手",path:"m3", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:1050,ap:30,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0}},info:""}, + skills:{6008:{uuid:6008,lv:1,cd:2,ccd:0}},info:""}, 6004:{uuid:6004,name:"兽人高阶射手",path:"m4", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,hp:720,ap:45,speed:100, - skills:{6010:{uuid:6010,lv:1,cd:1.5,ccd:0}},info:""}, + skills:{6008:{uuid:6008,lv:1,cd:1.5,ccd:0}},info:""}, 6005:{uuid:6005,name:"兽人刺客",path:"m5", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,hp:720,ap:20,speed:100, skills:{6103:{uuid:6103,lv:1,cd:1.5,ccd:0}},info:""}, 6006:{uuid:6006,name:"骷髅高阶战士",path:"m6", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0}},info:""}, 6007:{uuid:6007,name:"兽人蓝色法师",path:"m7", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""}, + skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0}},info:""}, 6008:{uuid:6008,name:"兽人红色法师",path:"m8", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""}, + skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0}},info:""}, // BOSS怪物 6101:{uuid:6101,name:"兽人首领-双刀战士-蓝边",path:"mb1", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100, skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""}, 6102:{uuid:6102,name:"兽人首领-斧头战士-绿边",path:"mb2", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""}, 6103:{uuid:6103,name:"兽人首领-魔法师-紫边",path:"mb3", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100, skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""}, 6104:{uuid:6104,name:"兽人首领-射手-黄边",path:"mb4", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""}, 6105:{uuid:6105,name:"亡灵首领-法师-红边",path:"mb5", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100, skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""}, 6106:{uuid:6106,name:"亡灵首领-骑马战士-红边",path:"mb6", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100, - skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""}, + skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""}, }; diff --git a/assets/script/game/skill/SMoveSystem.ts b/assets/script/game/skill/SMoveSystem.ts index f2546955..b917b9c0 100644 --- a/assets/script/game/skill/SMoveSystem.ts +++ b/assets/script/game/skill/SMoveSystem.ts @@ -103,7 +103,10 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const dirForAngle = new Vec3(); Vec3.subtract(dirForAngle, adjustedTargetPos, adjustedStartPos); if (dirForAngle.length() > 0.01) { - const angle = Math.atan2(dirForAngle.y, dirForAngle.x) * (180 / Math.PI); + let angle = Math.atan2(dirForAngle.y, dirForAngle.x) * (180 / Math.PI); + if (moveComp.scale < 0) { + angle += 180; + } node.angle = angle; } break; @@ -209,7 +212,10 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate Vec3.subtract(direction, nextPos, moveComp.currentPos); if (direction.length() > 0.01) { - const angle = Math.atan2(direction.y, direction.x) * (180 / Math.PI); + let angle = Math.atan2(direction.y, direction.x) * (180 / Math.PI); + if (moveComp.scale < 0) { + angle += 180; + } node.angle = angle; } } diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index a4e23f93..1a599f86 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -142,7 +142,7 @@ export class Skill extends ecs.Entity { node.active = true; // 设置节点属性 let face=caster.node.scale.x < 0 ? -1 : 1 - node.setScale(v3(node.scale.x*face,node.scale.y,1)) + node.setScale(v3(Math.abs(node.scale.x)*face,node.scale.y,1)) // 初始视图 const SView = node.getComponent(SkillView); if (!SView) { diff --git a/assets/script/game/skill/TooltipCom.ts b/assets/script/game/skill/TooltipCom.ts index e1949c76..a4bddd76 100644 --- a/assets/script/game/skill/TooltipCom.ts +++ b/assets/script/game/skill/TooltipCom.ts @@ -71,8 +71,8 @@ export class TooltipCom extends CCComp { // 设置极高的渲染层级,防止被怪物遮挡 const topSiblingIndex = 9999; - // 临时变量,存储当前Y坐标,方便统一处理 - let currentY = this.node.position.y; + // 临时变量,存储当前Y坐标,方便统一处理。增加60的Y轴基础偏移,防止伤害飘字等遮挡血条 + let currentY = this.node.position.y + 30; switch (this.stype) { case TooltipTypes.life: // 普通伤害 @@ -82,11 +82,13 @@ export class TooltipCom extends CCComp { scaleMax = 1.5; break; case TooltipTypes.health: // 治疗 + this.node.setPosition(v3(this.node.position.x + offsetX, currentY)); this.node.setSiblingIndex(topSiblingIndex); this.setupLabel("add_life", "hp", this.value); isHeal = true; break; case TooltipTypes.addmp: // 回蓝 + this.node.setPosition(v3(this.node.position.x + offsetX, currentY)); this.node.setSiblingIndex(topSiblingIndex); this.setupLabel("add_mp", "mp", this.value); isHeal = true; @@ -107,25 +109,26 @@ export class TooltipCom extends CCComp { break; case TooltipTypes.uskill: this.setupLabel("uskill", "name", this.value); - this.node.setPosition(v3(this.node.position.x, this.node.position.y + 30)); + this.node.setPosition(v3(this.node.position.x, currentY + 30)); this.node.setSiblingIndex(topSiblingIndex); break; case TooltipTypes.lvup: this.node.getChildByName("lvup").active = true; - this.node.setPosition(v3(this.node.position.x, this.node.position.y - 30)); + this.node.setPosition(v3(this.node.position.x, currentY - 30)); this.node.setSiblingIndex(topSiblingIndex); break; case TooltipTypes.apup: this.setupLabel("apup", "num", "+" + this.value); - this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60)); + this.node.setPosition(v3(this.node.position.x, currentY - 60)); this.node.setSiblingIndex(topSiblingIndex); break; case TooltipTypes.hpup: this.setupLabel("hpup", "num", "+" + this.value); - this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60)); + this.node.setPosition(v3(this.node.position.x, currentY - 60)); this.node.setSiblingIndex(topSiblingIndex); break; case TooltipTypes.shield: + this.node.setPosition(v3(this.node.position.x + offsetX, currentY)); this.node.setSiblingIndex(topSiblingIndex); this.setupLabel("add_life", "hp", this.value); break;