Struct DamageContext
- Namespace
- TDMaker.Core
- Assembly
- TDMaker.Core.dll
A modifiable raw damage request, before defense and incoming multipliers.
public struct DamageContext
- Inherited Members
Constructors
DamageContext(int, int, float, DamageDef, int, float)
Creates a raw damage request; Amount is already scaled by its caller.
public DamageContext(int sourceId, int targetId, float amount, DamageDef definition, int experienceRecipientId = 0, float outputScale = 1)
Parameters
sourceIdinttargetIdintamountfloatdefinitionDamageDefexperienceRecipientIdintoutputScalefloat
Properties
Amount
Raw damage amount; hooks may change it to a finite nonnegative value.
public float Amount { readonly get; set; }
Property Value
Cancelled
Whether a pre-queue hook cancels the request.
public bool Cancelled { readonly get; set; }
Property Value
Definition
Immutable damage behavior.
public readonly DamageDef Definition { get; }
Property Value
ExperienceRecipientId
Explicit hero experience recipient, or zero.
public readonly int ExperienceRecipientId { get; }
Property Value
Origin
Original mechanism classification, retained through native secondary impacts.
public readonly DamageOrigin Origin { get; }
Property Value
OutputScale
Outgoing scale inherited by attached effects.
public readonly float OutputScale { get; }
Property Value
RequestId
Unique admitted queue-attempt identifier, assigned before pre-damage hooks; cancellation can leave gaps.
public readonly long RequestId { get; }
Property Value
RootRequestId
First request in this native secondary/reflection causal lineage.
public readonly long RootRequestId { get; }
Property Value
RootSourceId
Source of the lineage root, even if that entity no longer exists.
public readonly int RootSourceId { get; }
Property Value
SourceId
Originating entity, or zero.
public readonly int SourceId { get; }
Property Value
TargetId
Recipient entity.
public readonly int TargetId { get; }
Property Value
Methods
WithOrigin(DamageOrigin)
Marks an extension-created packet before RequestDamage. Pre-damage hooks cannot replace admitted provenance.
public DamageContext WithOrigin(DamageOrigin origin)
Parameters
originDamageOrigin