diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index 158b0e4c..381c65bf 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -348,7 +348,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpda // 触发复活动画 if (targetView && reviveSkillConf) { targetView.playReady(reviveSkillConf.readyAnm); - targetView.skill_name('', reviveSkillConf.uuid, SkillTriggerType.Revive); + targetView.skill_name('', reviveSkillConf.uuid); // 延迟 0.5 秒后恢复状态,让特效有时间播放,同时也能体现“正在复活”的过程 targetView.scheduleOnce(() => { if (targetView.node && targetView.node.isValid) { diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index f5e2eb56..d5f1725f 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -216,10 +216,10 @@ export class HeroViewComp extends CCComp { Tooltip.load(pos, type, value, s_uuid, this.node); } /** 技能提示 */ - public skill_name(value: string = "", s_uuid: number = 1001, triggerType: string = "", y: number = 50) { + public skill_name(value: string = "", s_uuid: number = 1001, y: number = 50) { let pos = v3(0, 60); pos.y = pos.y + y; - Tooltip.load(pos, TooltipTypes.skill, value, s_uuid, this.node, 1, this.model?.fac ?? FacSet.MON, triggerType); + Tooltip.load(pos, TooltipTypes.skill, value, s_uuid, this.node, 1, this.model?.fac ?? FacSet.MON); } /** 血量提示(伤害数字) */ private hp_tip(type: number = 1, value: string = "", s_uuid: number = 1001, y: number = 0, debuffIcon: string = "") { @@ -234,7 +234,7 @@ export class HeroViewComp extends CCComp { // 起点设为怪物中心偏下位置,使其在血条下方 let ny = this.node.position.y + halfHeight - 15; let pos = v3(x, ny, 0); - Tooltip.load(pos, type, value, s_uuid, this.node.parent, 1, this.model?.fac ?? FacSet.MON, "", debuffIcon); + Tooltip.load(pos, type, value, s_uuid, this.node.parent, 1, this.model?.fac ?? FacSet.MON, debuffIcon); } /** 护盾减免提示 */ diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 6ca8c260..b8bc6682 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -324,7 +324,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (castTimes > 1) { val = "*" + castTimes.toString } - heroView.skill_name(val, s_uuid, triggerType) + heroView.skill_name(val, s_uuid) for (let i = 0; i < castTimes; i++) { if (!heroView.node || !heroView.node.isValid) return; // 多发/召唤按间隔错峰执行:i=0 立即,其余延迟 i*SUMMON_INTERVAL diff --git a/assets/script/game/skill/Tooltip.ts b/assets/script/game/skill/Tooltip.ts index 3a01fddd..365a731d 100644 --- a/assets/script/game/skill/Tooltip.ts +++ b/assets/script/game/skill/Tooltip.ts @@ -60,7 +60,7 @@ export class Tooltip extends ecs.Entity { this.remove(TooltipCom); super.destroy(); } - static load(pos: Vec3 = Vec3.ZERO,type:number=1,vaule:string="",s_uuid:number=1001,parent:any=null,cd:number=1,fac:number=FacSet.MON,triggerType:string="",debuffIcon:string="") { + static load(pos: Vec3 = Vec3.ZERO,type:number=1,vaule:string="",s_uuid:number=1001,parent:any=null,cd:number=1,fac:number=FacSet.MON,debuffIcon:string="") { let node: Node; if (Tooltip.pool.size() > 0) { node = Tooltip.pool.get()!; @@ -75,7 +75,7 @@ export class Tooltip extends ecs.Entity { node.active = true; var sv = node.getComponent(TooltipCom)!; - sv.init(type, vaule, s_uuid, fac, triggerType, debuffIcon); + sv.init(type, vaule, s_uuid, fac, debuffIcon); // this.add(sv); // 不要添加到单例实体上,否则会覆盖或导致单例被销毁 } diff --git a/assets/script/game/skill/TooltipCom.ts b/assets/script/game/skill/TooltipCom.ts index 3a03f957..c896e4bf 100644 --- a/assets/script/game/skill/TooltipCom.ts +++ b/assets/script/game/skill/TooltipCom.ts @@ -3,7 +3,6 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { SkillSet } from "../common/config/SkillSet"; import { FacSet, TooltipTypes } from "../common/config/GameSet"; -import { SkillTriggerType } from "../common/config/heroSet"; import { Tooltip } from "./Tooltip"; const { ccclass, property } = _decorator; @@ -12,23 +11,10 @@ const { ccclass, property } = _decorator; @ccclass('TooltipCom') @ecs.register('TooltipView', false) export class TooltipCom extends CCComp { - @property(Node) - atking_bg: Node = null; - @property(Node) - atked_bg: Node = null; - @property(Node) - fstart_bg: Node = null; - @property(Node) - dead_bg: Node = null; - @property(Node) - revive_bg: Node = null; - stype: number = 1; // 1:减少生命值,2:增加生命值,3:技能图标 value: string = ""; s_uuid: number = 1001; fac: number = FacSet.MON; - /** 当前技能喊话对应的触发类型(空字符串表示普通主动技能) */ - triggerType: string = ""; /** DoT 飘字需激活的 debuff 图标节点名(loss_life/hp/debuff 下的子节点,如 FireDamage);空串=普通伤害 */ debuffIcon: string = ""; @@ -45,12 +31,11 @@ export class TooltipCom extends CCComp { } /** 初始化并播放动画 */ - init(type: number, value: string, uuid: number, fac: number = FacSet.MON, triggerType: string = "", debuffIcon: string = "") { + init(type: number, value: string, uuid: number, fac: number = FacSet.MON, debuffIcon: string = "") { this.stype = type; this.value = value; this.s_uuid = uuid; this.fac = fac; - this.triggerType = triggerType; this.debuffIcon = debuffIcon; // 初始化或获取 UIOpacity 组件 @@ -126,8 +111,6 @@ export class TooltipCom extends CCComp { // 技能喊话基于 load 传入位置再抬高 50,避免遮挡角色 this.node.setPosition(v3(this.node.position.x, this.node.position.y + 50)); this.node.setSiblingIndex(topSiblingIndex); - // 根据触发类型激活对应的背景标识(追击/反击/起手/生息/亡语/复活) - this.setupTriggerBg(this.triggerType); break; case TooltipTypes.uskill: this.setupLabel("uskill", "name", this.value); @@ -189,32 +172,6 @@ export class TooltipCom extends CCComp { } } - /** - * 根据技能触发类型激活对应的背景标识节点 - * 仅 TooltipTypes.skill 走此分支,其他飘字类型不受影响 - * 对象池复用场景下先统一关闭所有 _bg,避免上一次的状态残留 - */ - private setupTriggerBg(triggerType: string) { - // 先关闭所有触发类型背景,防止节点池复用时残留 - this.atking_bg && (this.atking_bg.active = false); - this.atked_bg && (this.atked_bg.active = false); - this.fstart_bg && (this.fstart_bg.active = false); - this.dead_bg && (this.dead_bg.active = false); - this.revive_bg && (this.revive_bg.active = false); - - if (!triggerType) return; - - const bgMap: Record = { - [SkillTriggerType.Atking]: this.atking_bg, - [SkillTriggerType.Atked]: this.atked_bg, - [SkillTriggerType.FStart]: this.fstart_bg, - [SkillTriggerType.Dead]: this.dead_bg, - [SkillTriggerType.Revive]: this.revive_bg, - }; - const bg = bgMap[triggerType]; - if (bg) bg.active = true; - } - playAnimation(scaleMax: number, isCrit: boolean, isHeal: boolean, sx: number = 1) { // 随机 X 轴偏移 (防止重叠) const randomX = (Math.random() - 0.5) * 60;