技能内存优化

This commit is contained in:
2025-08-08 22:20:26 +08:00
parent 570812de88
commit bf241345bf
13 changed files with 3224 additions and 2930 deletions

View File

@@ -86,37 +86,33 @@ export class Skill extends ecs.Entity {
return;
}
// 获取计算后的属性数据
let ap_data = this.get_ap(caster,dmg,uuid)
SComp.ap = ap_data.ap
SComp.caster_crit = ap_data.crit
SComp.caster_crit_d = ap_data.crit_d
SComp.puncture = ap_data.puncture
SComp.puncture_damage = ap_data.puncture_damage
SComp.buV = config.buV
SComp.buC = config.buC
SComp.buR = config.buR
SComp.burn_count = ap_data.burn_count
SComp.burn_value = ap_data.burn_value
SComp.stun_time = ap_data.stun_time
SComp.stun_ratto = ap_data.stun_ratto
SComp.frost_time = ap_data.frost_time
SComp.frost_ratto = ap_data.frost_ratto
// 设置技能组件属性
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
Object.assign(SComp, {
// 核心标识
s_uuid: uuid,
dis:config.dis,
AType: config.AType,
speed: config.speed,
atk_count: 0,
hit_num:config.hit_num, //目前设定 根据技能不一样,几十
// 位置和施法者信息
startPos: startPos,
targetPos: targetPos,
caster: caster,
prefabName: config.sp_name,
group: caster.box_group,
fac: caster.fac,
scale: caster.scale,
animName: config.animName,
// 计算后的战斗数据
ap: ap_data.ap,
caster_crit: ap_data.crit,
caster_crit_d: ap_data.crit_d,
puncture: ap_data.puncture,
puncture_damage: ap_data.puncture_damage,
burn_count: ap_data.burn_count,
burn_value: ap_data.burn_value,
stun_time: ap_data.stun_time,
stun_ratto: ap_data.stun_ratto,
frost_time: ap_data.frost_time,
frost_ratto: ap_data.frost_ratto,
});
this.add(SComp);