Files
pixelheros/assets/script/game/skill/SDataCom.ts
walkpan 31321a1a45 feat(技能系统): 添加施法者实体ID字段用于安全校验
在SDataCom组件中添加casterEid字段,并在Skill和SkillView中使用该字段替代原有的链式访问,提高代码安全性和可读性
2026-01-06 14:20:45 +08:00

32 lines
948 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";
import { HeroViewComp } from "../hero/HeroViewComp";
/** 业务层对象 */
//技能数据
@ecs.register('SDataCom')
export class SDataCom extends ecs.Comp {
/** 业务层组件移除时,重置所有数据为默认值 */
Attrs:any=null
caster:HeroViewComp=null
casterEid: number = -1; // 施法者实体ID用于安全校验
group:BoxSet=BoxSet.HERO
fac: number = 0; // 0:hero 1:monster
s_uuid:number=0
ext_dmg:number=0 //额外伤害
dmg_ratio:number=1 //伤害比例
hit_count:number=0 //击中数量
reset() {
this.Attrs=null
this.group=BoxSet.HERO
this.fac=0
this.s_uuid=0
this.caster=null
this.casterEid = -1;
this.hit_count=0
this.ext_dmg=0
this.dmg_ratio=1
}
}