perf: 增加技能对象池最大容量并优化伤害日志
将技能对象池最大容量从64提升至128,以支持更多并发技能实例。 将技能6008的结束类型从动画结束改为碰撞检测,提高准确性。 移除伤害计算中不必要的施法者属性获取和击杀计数更新,简化日志输出。
This commit is contained in:
@@ -236,7 +236,7 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
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: {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export class Skill extends ecs.Entity {
|
||||
private debugMode: boolean = false;
|
||||
/** 多键对象池:Map<prefabPath, NodePool> */
|
||||
static pools: Map<string, NodePool> = 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)) {
|
||||
|
||||
Reference in New Issue
Block a user