Class ImpactPayloadDef
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
secondaryDamageDamageDefareaAreaEffectDefdisplacementPathDisplacementDefchancefloattriggerOnZeroDamagebooltargetsMechanicTargetDef
Properties
Area
Residual region centered on the impact position, even when the victim died.
public AreaEffectDef Area { get; }
Property Value
Chance
Probability per eligible resolved hit.
public float Chance { get; }
Property Value
Displacement
Path shift applied only if the victim is still alive.
public PathDisplacementDef Displacement { get; }
Property Value
SecondaryDamage
Additional independent impact centered on the victim's impact position, with the original source and credit.
public DamageDef SecondaryDamage { get; }
Property Value
Targets
Additional victim eligibility, checked at impact before damage is applied.
public MechanicTargetDef Targets { get; }
Property Value
Transfer
Optional exact path destination for a surviving victim, applied after relative displacement.
public PathDestinationDef Transfer { get; }
Property Value
TransferKey
Optional mechanism identity for PathTransferred.Key when this hit relocates its victim.
public string TransferKey { get; }
Property Value
TriggerOnZeroDamage
Also permits zero-health-loss packets, useful for control-only impacts; immunity-rejected requests never trigger.
public bool TriggerOnZeroDamage { get; }
Property Value
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
destinationPathDestinationDefchancefloattriggerOnZeroDamagebooltargetsMechanicTargetDef
Returns
WithTransfer(PathDestinationDef)
Copies the payload and adds exact relocation.
public ImpactPayloadDef WithTransfer(PathDestinationDef destination)
Parameters
destinationPathDestinationDef
Returns
WithTransferKey(string)
Copies all payload operations and assigns the authored relocation identity. Requires an existing Transfer operation.
public ImpactPayloadDef WithTransferKey(string mechanismKey)
Parameters
mechanismKeystring
Returns
Examples
ImpactPayloadDef.CreateTransfer(destination).WithTransferKey("relocate");