Files
pixelheros/assets/script/game/hero/BuffComp.ts
panFD e8c6a7ca6a feat: 实现DoT灼烧技能与debuff图标系统
本次提交完成了以下核心改动:
1.  调整fb-1~fb-6技能预制件的攻击偏移坐标,优化技能弹道位置
2.  新增DoT伤害机制,支持周期伤害/治疗的独立结算
3.  为Buff系统添加施法者属性快照,让DoT暴击、控制判定更准确
4.  新增顶栏debuff图标显示功能,支持灼烧等负面状态可视化
5.  为破晓先知等英雄替换为新的灼烧火球技能6104
6.  修复fb-2预制件的配置字段顺序与多余属性问题
2026-08-15 14:36:38 +08:00

54 lines
1.9 KiB
TypeScript
Raw Permalink 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";
/**
* 单个活跃 buff 实例(一层)。
* 每个 ActiveBuff 独立计时,叠层时会产生多个实例。
*/
export class ActiveBuff {
/** 对应 BuffList 中的配置 id */
config_id: number;
/** 剩余持续时间(秒) */
remaining: number;
/** 施法者实体 uuid用于伤害归属 */
source_uuid: number;
/** 施法者攻击力快照(用于 DoT/HoT 的 ap 缩放) */
source_ap_snapshot: number;
/**
* 施法者完整属性快照DoT tick 判定暴击/冰冻/击晕用)。
* 结构同 DamageEvent.Attrs仅 DoT 类 buff 需要,普通 modifier buff 为 undefined。
*/
source_attrs_snapshot?: any;
/** 周期效果累计时间(秒) */
tick_acc: number = 0;
/** 修饰数值覆写(来自药水卡 buff_value优先于 BuffList 配置值undefined 表示用配置值 */
value_override?: number;
constructor(cfg_id: number, dur: number, src_uuid: number, src_ap: number, value_override?: number, src_attrs?: any) {
this.config_id = cfg_id;
this.remaining = dur;
this.source_uuid = src_uuid;
this.source_ap_snapshot = src_ap;
this.value_override = value_override;
this.source_attrs_snapshot = src_attrs;
}
}
/**
* Buff 组件 — 存储实体身上所有活跃的 buff/debuff。
*
* 数据结构:按 buff_id 分组,每组是若干层(每层独立计时)。
* 使用 ecs.Comp仅承载数据计时与结算逻辑由 BuffSystem 负责。
*/
@ecs.register('Buff')
export class BuffComp extends ecs.Comp {
/** 按 buff_id 分组,每组是若干层(每层独立计时) */
buffs: Map<number, ActiveBuff[]> = new Map();
/** buff 列表变更标记(预留 UI 消费) */
dirty_buffs: boolean = false;
reset() {
this.buffs.clear();
this.dirty_buffs = false;
}
}