From eff4154ba3a789a95049ce5baecf3537267ea28b Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 18 Mar 2026 10:37:25 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E6=B1=A0=E6=9C=80=E5=A4=A7=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BC=A4=E5=AE=B3=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将技能对象池最大容量从64提升至128,以支持更多并发技能实例。 将技能6008的结束类型从动画结束改为碰撞检测,提高准确性。 移除伤害计算中不必要的施法者属性获取和击杀计数更新,简化日志输出。 --- assets/script/game/common/config/SkillSet.ts | 2 +- assets/script/game/hero/HeroAtkSystem.ts | 10 ++-------- assets/script/game/skill/Skill.ts | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 665c1fe0..c43594e1 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -236,7 +236,7 @@ export const SkillSet: Record = { 6008: { uuid:6008,name:"光箭",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single, ap:100,hit_count:6,hitcd:0.2,speed:720,with:0, - ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.animationEnd, + ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害", }, 6009: { diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index 65cefe02..9892ef17 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -106,8 +106,6 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd if (!TAttrsComp || TAttrsComp.is_dead || TAttrsComp.is_reviving) return reDate; const casterEid = damageEvent.casterEid; - const caster = ecs.getEntityByEid(casterEid); - const CAttrsComp = caster?.get(HeroAttrsComp); // 获取技能配置 const skillConf = SkillSet[damageEvent.s_uuid]; @@ -151,8 +149,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // targetView.back(); // } - const casterName = CAttrsComp?.hero_name || "未知"; - mLogger.log(this.debugMode, 'HeroAtkSystem', ` 英雄${TAttrsComp.hero_name} (uuid: ${TAttrsComp.hero_uuid}) 受到 ${casterName}(eid: ${casterEid})的 伤害 ${damage},${isCrit?"暴击":"普通"}攻击,技能ID ${damageEvent.s_uuid}`); + mLogger.log(this.debugMode, 'HeroAtkSystem', ` 英雄${TAttrsComp.hero_name} (uuid: ${TAttrsComp.hero_uuid}) 受到 eid:${casterEid} 的 伤害 ${damage},${isCrit?"暴击":"普通"}攻击,技能ID ${damageEvent.s_uuid}`); // 击退判定 // 使用施法者的击退概率属性(damageEvent.Attrs 快照) - 被攻击者的控制抗性 @@ -180,9 +177,6 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd return reDate; } - // 增加被击杀计数 - if (caster) CAttrsComp.killed_count++; - this.doDead(target); // ✅ 触发死亡视图表现 if (targetView) { @@ -444,4 +438,4 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd } -} \ No newline at end of file +} diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index 103c2af4..b6c58bdd 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -19,7 +19,7 @@ export class Skill extends ecs.Entity { private debugMode: boolean = false; /** 多键对象池:Map */ static pools: Map = new Map(); - static readonly MAX_POOL_SIZE: number = 64; + static readonly MAX_POOL_SIZE: number = 128; static getFromPool(path: string): Node | null { if (this.pools.has(path)) {