Files
pixelheros/assets/script/game/skill/SDataCom.ts
pan be17d18ff3 feat(skill-system): 新增计时debuff机制,支持技能命中敌方附加减益效果
本次提交完整实现了技能对敌附加debuff的完整流程:
1.  新增TimedDebuffSnapshot数据结构,用于透传debuff配置
2.  在SkillConfig和SkillOverrides中新增debuff相关配置项
3.  实现HeroAtkSystem中debuff的判定与施加逻辑
4.  完善后台配置、前端编辑器的debuff配置支持
5.  调整了buff目标判定逻辑,修复了原有默认目标的语义混淆问题
6.  优化了BuffSystem的调试日志,新增了debuff分类标识
7.  批量更新了现有英雄技能的debuff配置示例
2026-09-08 16:37:13 +08:00

42 lines
1.6 KiB
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 { SkillOverrides } from "../common/config/SkillSet";
import { TimedDebuffSnapshot } from "../hero/DamageQueueComp";
/** 业务层对象 */
//技能数据
@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=0
ext_dmg:number=0 //额外伤害
dmg_ratio:number=1 //伤害比例
hit_count:number=0 //击中数量
max_hit_count:number=0 //最大可命中次数
/** 命中后概率触发额外技能(由 Skill.load 从合并后配置快照;DamageEvent 透传给 HeroAtkSystem 判定;
* overrides 字段透传给被触发技能,用于自定义伤害/数值) */
proc_skill?: { s_uuid: number; chance?: number; overrides?: SkillOverrides };
/** 命中后对敌 debuff(由 Skill.load 从合并后配置快照;DamageEvent 透传给 HeroAtkSystem 结算) */
timed_debuff?: TimedDebuffSnapshot;
reset() {
this.Attrs=null
this.group=BoxSet.HERO
this.fac=0
this.s_uuid=0
this.skill_lv=0
this.casterEid = -1;
this.hit_count=0
this.max_hit_count=0
this.ext_dmg=0
this.dmg_ratio=1
this.proc_skill=undefined
this.timed_debuff=undefined
}
}