From 24aff3baa3ccc6d592c4a32d30b7f296a77589f8 Mon Sep 17 00:00:00 2001 From: panFD Date: Sat, 10 Oct 2026 00:27:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(hero):=20=E7=A7=BB=E9=99=A4=20Boss=20?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=8F=8F=E8=BE=B9=E7=9B=B8=E5=85=B3=E6=9C=AA?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理了 Boss 阶段描边功能的相关代码,包括移除了 resetPhaseOutline 和 setPhaseOutline 方法,删除了相关材质定义,将 onPhaseEnter 方法置空待后续迭代实现。 --- assets/script/game/common/config/heroSet.ts | 2 +- assets/script/game/hero/BossPhaseSystem.ts | 18 ++---------- assets/script/game/hero/HeroViewComp.ts | 11 -------- assets/script/game/hero/Mon.ts | 4 --- .../hit-flash-white/scripts/FlashSprite.ts | 28 ------------------- 5 files changed, 3 insertions(+), 60 deletions(-) diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index dc8f658e..995ba3d2 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -1,4 +1,4 @@ -import { v3 } from "cc" +import { v3 } from "cc" import { BoxSet, FacSet, FightSet } from "./GameSet" import { SkillOverrides, TGroup, SkillSet, FieldSkillSet, SkillConfig, SkillKind, FieldSkillConfig, FieldSkillType, mergeSkillParams, BuffTarget } from "./SkillSet" import { BuffList, BuffConfig, ModOp } from "./BuffSet" diff --git a/assets/script/game/hero/BossPhaseSystem.ts b/assets/script/game/hero/BossPhaseSystem.ts index dfbcd25d..53d3dea0 100644 --- a/assets/script/game/hero/BossPhaseSystem.ts +++ b/assets/script/game/hero/BossPhaseSystem.ts @@ -18,9 +18,7 @@ import { BossPhaseSet, PhaseSwitchDef } from "../common/config/BossPhaseSet"; import { SkillSet } from "../common/config/SkillSet"; import { mLogger } from "../common/Logger"; import { HeroAttrsComp } from "./HeroAttrsComp"; -import { HeroViewComp } from "./HeroViewComp"; import { BossPhaseComp } from "./BossPhaseComp"; -import { FlashSprite } from "./hit-flash-white/scripts/FlashSprite"; /** 阶段模块调试日志开关 */ const DEBUG = true; @@ -126,18 +124,6 @@ export class BossPhaseSystem extends ecs.ComblockSystem implements ecs.ISystemUp /** TODO: 阶段退场表现(震屏/变暗等),后续迭代实现 */ private onPhaseExit(e: ecs.Entity): void { } - /** 阶段入场表现:切换阶段描边(P2 绿 / P3 红);怒吼/无敌帧/横幅等后续迭代 */ - private onPhaseEnter(e: ecs.Entity): void { - const view = e.get(HeroViewComp); - if (!view || !view.node || !view.node.isValid) return; - const phase = e.get(BossPhaseComp)!; - // FlashSprite 可能在根节点或子节点(anm)上,逐级查找 - let flash = view.node.getComponent(FlashSprite); - if (!flash) { - flash = view.node.getComponentInChildren(FlashSprite); - } - if (flash) { - flash.setPhaseOutline(phase.index); - } - } + /** TODO: 阶段入场表现(怒吼/无敌帧/技能横幅等),后续迭代实现 */ + private onPhaseEnter(e: ecs.Entity): void { } } diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index ee369af2..ad23fd2c 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -576,17 +576,6 @@ export class HeroViewComp extends CCComp { // } } - /** 复位阶段描边为默认(Boss 池化复用必经路径,防红/绿描边残留到下一个复用者) */ - public resetPhaseOutline() { - let flash = this.node.getComponent(FlashSprite); - if (!flash) { - flash = this.node.getComponentInChildren(FlashSprite); - } - if (flash) { - flash.setPhaseOutline(0); - } - } - } diff --git a/assets/script/game/hero/Mon.ts b/assets/script/game/hero/Mon.ts index 2fb204fa..3d901d0a 100644 --- a/assets/script/game/hero/Mon.ts +++ b/assets/script/game/hero/Mon.ts @@ -290,10 +290,6 @@ export class Monster extends ecs.Entity { // 注册视图组件并重置对象池复用状态 this.add(view); view.init(); - // 阶段 Boss:init 按 lv 设的等级描边与阶段描边冲突,复位为 P1 无描边(P2/P3 由 BossPhaseSystem 再上色) - if (this.has(BossPhaseComp)) { - view.resetPhaseOutline(); - } view.as.idle(); // 广播怪物加载事件,供刷怪与战斗系统联动 oops.message.dispatchEvent("monster_load", this) diff --git a/assets/script/game/hero/hit-flash-white/scripts/FlashSprite.ts b/assets/script/game/hero/hit-flash-white/scripts/FlashSprite.ts index fe689e79..45645a09 100644 --- a/assets/script/game/hero/hit-flash-white/scripts/FlashSprite.ts +++ b/assets/script/game/hero/hit-flash-white/scripts/FlashSprite.ts @@ -19,9 +19,6 @@ export class FlashSprite extends Component { @property({ type: Material, tooltip: '黄色描边材质(5级)' }) outlineMatYellow: Material | null = null; - @property({ type: Material, tooltip: '红色描边材质(Boss阶段3)' }) - outlineMatRed: Material | null = null; - orginalFlashMaterial: Material | null = null; defaultMaterial: Material | null = null; // 缓存最原始的无描边材质 sprite: Sprite | null = null; @@ -67,31 +64,6 @@ export class FlashSprite extends Component { } } - /** - * 设置 Boss 阶段描边(与等级描边互斥,阶段优先) - * @param phase 阶段索引 0=P1(无描边/恢复默认) 1=P2(绿) 2=P3(红) - */ - public setPhaseOutline(phase: number) { - if (!this.sprite) { - this.sprite = this.node.getComponent(Sprite); - } - - let targetMat: Material | null = null; - if (phase === 1) { - targetMat = this.outlineMatGreen; - } else if (phase >= 2) { - targetMat = this.outlineMatRed; - } else { - // P1 / 复位:恢复最原始的无描边材质 - targetMat = this.defaultMaterial; - } - - if (targetMat && this.sprite) { - this.orginalFlashMaterial = targetMat; - this.sprite.setSharedMaterial(targetMat, 0); - } - } - public clickFlash() { if (!this.sprite || !this.hitFlashMaterial) return;