Class ImpactPayloadDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

Optional payload after a resolved health packet. Despawn and defense-only packets do not trigger it. One roll gates all operations.

public sealed class ImpactPayloadDef
Inheritance
ImpactPayloadDef
Inherited Members

Constructors

ImpactPayloadDef(DamageDef, AreaEffectDef, PathDisplacementDef, float, bool, MechanicTargetDef)

Creates extra blast, residual field and/or displacement data.

public ImpactPayloadDef(DamageDef secondaryDamage = null, AreaEffectDef area = null, PathDisplacementDef displacement = null, float chance = 1, bool triggerOnZeroDamage = false, MechanicTargetDef targets = null)

Parameters

secondaryDamage DamageDef
area AreaEffectDef
displacement PathDisplacementDef
chance float
triggerOnZeroDamage bool
targets MechanicTargetDef

Properties

Area

Residual region centered on the impact position, even when the victim died.

public AreaEffectDef Area { get; }

Property Value

AreaEffectDef

Chance

Probability per eligible resolved hit.

public float Chance { get; }

Property Value

float

Displacement

Path shift applied only if the victim is still alive.

public PathDisplacementDef Displacement { get; }

Property Value

PathDisplacementDef

SecondaryDamage

Additional independent impact centered on the victim's impact position, with the original source and credit.

public DamageDef SecondaryDamage { get; }

Property Value

DamageDef

Targets

Additional victim eligibility, checked at impact before damage is applied.

public MechanicTargetDef Targets { get; }

Property Value

MechanicTargetDef

Transfer

Optional exact path destination for a surviving victim, applied after relative displacement.

public PathDestinationDef Transfer { get; }

Property Value

PathDestinationDef

TransferKey

Optional mechanism identity for PathTransferred.Key when this hit relocates its victim.

public string TransferKey { get; }

Property Value

string

TriggerOnZeroDamage

Also permits zero-health-loss packets, useful for control-only impacts; immunity-rejected requests never trigger.

public bool TriggerOnZeroDamage { get; }

Property Value

bool

Methods

CreateTransfer(PathDestinationDef, float, bool, MechanicTargetDef)

Creates a relocation-only hit payload without dummy damage or displacement operations.

public static ImpactPayloadDef CreateTransfer(PathDestinationDef destination, float chance = 1, bool triggerOnZeroDamage = false, MechanicTargetDef targets = null)

Parameters

destination PathDestinationDef
chance float
triggerOnZeroDamage bool
targets MechanicTargetDef

Returns

ImpactPayloadDef

WithTransfer(PathDestinationDef)

Copies the payload and adds exact relocation.

public ImpactPayloadDef WithTransfer(PathDestinationDef destination)

Parameters

destination PathDestinationDef

Returns

ImpactPayloadDef

WithTransferKey(string)

Copies all payload operations and assigns the authored relocation identity. Requires an existing Transfer operation.

public ImpactPayloadDef WithTransferKey(string mechanismKey)

Parameters

mechanismKey string

Returns

ImpactPayloadDef

Examples

ImpactPayloadDef.CreateTransfer(destination).WithTransferKey("relocate");