TemporalDamage.h
Source/MassBattle/Public/Fragments/TemporalDamage.h
概述 Overview
持续伤害(DoT)debuff 的数据 fragment FTemporalDmgDebuff——debuff 实体的载荷,记录施害者 / 目标、总伤害、伤害间隔、分段时间等。由 UMassBattleDebuffSubsystem 在生成时写入,MassBattleDebuffMonoProcessor 每帧推进分段伤害;快照注册表模板 Key 为 "Debuff_TemporalDmg"。
Data fragment for the temporal-damage (DoT) debuff FTemporalDmgDebuff — the payload of a debuff entity, recording instigator/target, total damage, damage interval and segments. Written at spawn by UMassBattleDebuffSubsystem; MassBattleDebuffMonoProcessor advances the segmented damage each frame. The snapshot-registry template key is "Debuff_TemporalDmg".
FTemporalDmgDebuff USTRUCT
持续伤害 debuff fragment(FA_MassBattleBaseFragment 派生)。全部字段为运行时状态(非 UPROPERTY 配置,无 Editor 暴露):生成时由 UMassBattleDebuffSubsystem::SpawnDebuffEntityWithUID 写入 UniqueID 与 TemporalDmgTarget 等,debuff 处理器按 TemporalDmgInterval 逐段结算 TotalTemporalDmg 直至 TemporalDmgTimeout 到期。
Temporal damage debuff fragment (derived from FA_MassBattleBaseFragment). All fields are runtime state (no UPROPERTY config, not editor-exposed): at spawn UMassBattleDebuffSubsystem::SpawnDebuffEntityWithUID writes UniqueID, TemporalDmgTarget etc., and the debuff processor settles TotalTemporalDmg in segments every TemporalDmgInterval until TemporalDmgTimeout expires.
成员变量 Members
| 名称 Name | 类型 Type | 默认值 | 说明 Description |
|---|---|---|---|
TemporalDmgInstigator | FEntityHandle | — | 持续伤害的施害者(instigator)实体句柄,用于伤害归属。Handle of the instigator entity, used for damage attribution. |
TemporalDmgTarget | FEntityHandle | — | 承受持续伤害的目标实体句柄。Handle of the target entity taking the damage. |
TemporalDmgTimeout | float | 0.5f | 总持续时长(秒),到期后 debuff 移除。Total duration in seconds; the debuff is removed on expiry. |
TemporalDmgInterval | float | 0.5f | 伤害间隔(秒)——每段伤害之间的时间。Damage interval in seconds — time between damage segments. |
RemainingTemporalDmg | float | 0.f | 剩余待结算伤害总量。Remaining damage to be settled. |
TotalTemporalDmg | float | 0.f | 总伤害量(全部分段之和)。Total damage (sum of all segments). |
CurrentSegment | int32 | 0 | 当前伤害段数(已结算段数)。Current damage segment (segments settled so far). |
TemporalDmgSegment | int32 | 4 | 总伤害段数。Total damage segments. |
DmgType | EDmgType | Normal | 伤害类型(见 Fragments/Damage.h)。Damage type (see Fragments/Damage.h). |
bJustSpawned | bool | true | 是否刚生成(首帧特殊处理,如立即结算第一段)。Whether the debuff was just spawned (first-frame special handling, e.g. immediate first segment). |
UniqueID | int32 | -1 | debuff 实体的全局唯一 ID(-1 = 未分配),网络同步 / hash 的身份依据。Global unique ID of the debuff entity (-1 = unassigned); identity for network sync / hash. |
补充说明 Notes
文件末尾的 FTemporalDamagingTag 为注释掉的预留 Tag 定义,当前未启用。
The commented-out FTemporalDamagingTag at the end of the file is a reserved tag definition, currently disabled.
管线角色 Pipeline Role
FTemporalDmgDebuff 在 MassBattle 管线中的位置:生成请求由伤害应用并行段收集(经 FTemporalDmgDebuffSpawnRequest),UMassBattleDebuffSubsystem::ProcessDebuffSpawnQueues 串行排空并构建实体;MassBattleDebuffMonoProcessor 每帧推进分段伤害;MassBattleNetworkProcessor 从 debuff 查询注册 UID 入网;快照恢复走 "Debuff_TemporalDmg" 骨架模板。
Position of FTemporalDmgDebuff in the MassBattle pipeline: spawn requests are gathered in parallel from damage application (via FTemporalDmgDebuffSpawnRequest), drained serially by UMassBattleDebuffSubsystem::ProcessDebuffSpawnQueues; MassBattleDebuffMonoProcessor advances the segmented damage each frame; MassBattleNetworkProcessor registers UIDs into the network from its debuff query; snapshot restore uses the "Debuff_TemporalDmg" skeleton template.