Files
pixelheros/assets/script/game/skill/SDataCom.ts
walkpan 0f56591376 refactor(skill): 重构技能数据结构并支持技能等级
- 将 HeroAttrsComp 中的技能数组和独立 CD 映射重构为统一的 HSkillInfo 对象记录
- 在 SDataCom 中新增 skill_lv 字段,并在 Skill 加载时传入技能等级
- 更新 Hero 和 Monster 初始化逻辑以适配新的技能数据结构
- 修改 SCastSystem 以传递技能等级并影响技能效果
- 更新 heroSet 配置,将 skills 字段类型改为 Record<number, HSkillInfo>
2026-03-22 16:25:46 +08:00

33 lines
967 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { BoxSet } from "../common/config/GameSet";
/** 业务层对象 */
//技能数据
@ecs.register('SDataCom')
export class SDataCom extends ecs.Comp {
/** 业务层组件移除时,重置所有数据为默认值 */
Attrs:any=null
casterEid: number = -1; // 施法者实体ID用于安全校验
group:BoxSet=BoxSet.HERO
fac: number = 0; // 0:hero 1:monster
s_uuid:number=0
skill_lv:number=1
ext_dmg:number=0 //额外伤害
dmg_ratio:number=1 //伤害比例
hit_count:number=0 //击中数量
max_hit_count:number=0 //最大可命中次数
reset() {
this.Attrs=null
this.group=BoxSet.HERO
this.fac=0
this.s_uuid=0
this.skill_lv=1
this.casterEid = -1;
this.hit_count=0
this.max_hit_count=0
this.ext_dmg=0
this.dmg_ratio=1
}
}