Table of Contents

Class PreDamageContext.PreDamageInfoStepBuilder

Namespace
ElectricDrill.AstraHealth.Damage
Assembly
com.electricdrill.astra-health.Runtime.dll

Concrete step builder implementing the fluent interfaces. After all required fields are set, optional fields (dealer, critical, multiplier, instigator, ignore) can be configured before calling Build().

public sealed class PreDamageContext.PreDamageInfoStepBuilder : PreDamageContext.DamageInfoAmount, PreDamageContext.DamageInfoType, PreDamageContext.DamageInfoSource, PreDamageContext.DamageInfoTarget
Inheritance
object
PreDamageContext.PreDamageInfoStepBuilder
Implements

Methods

Build()

Build the PreDamageContext instance with the previously configured values.

public PreDamageContext Build()

Returns

PreDamageContext

WithAmount(long)

Set the damage amount.

public PreDamageContext.DamageInfoType WithAmount(long amount)

Parameters

amount long

Returns

PreDamageContext.DamageInfoType

WithCriticalMultiplier(double)

Set the critical damage multiplier. Values <= 0 will be normalized to 1.0 by the constructor.

public PreDamageContext.PreDamageInfoStepBuilder WithCriticalMultiplier(double multiplier)

Parameters

multiplier double

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithIgnore(bool)

Set the initial Ignore flag for the built context. Defaults to false. Listeners may still mutate the flag after dispatch.

public PreDamageContext.PreDamageInfoStepBuilder WithIgnore(bool ignore)

Parameters

ignore bool

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithInstigator(IEffectInstigator)

Set the specific cause of this damage — for example an ability definition, a modifier definition or instance, or a passive. Use this to allow downstream listeners to identify the exact origin beyond entity (WithPerformer(EntityCore)) and category (WithSource(DamageSourceSO)).

public PreDamageContext.PreDamageInfoStepBuilder WithInstigator(IEffectInstigator instigator)

Parameters

instigator IEffectInstigator

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithIsCritical(bool)

Mark this damage as critical or not.

public PreDamageContext.PreDamageInfoStepBuilder WithIsCritical(bool isCritical)

Parameters

isCritical bool

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithIsReactable(bool)

Set the reactability flag for the built context. Pass false when building a context for a secondary effect (counter-damage, passive modifier) so that reactive systems do not respond to it and infinite chains are prevented. Defaults to true.

public PreDamageContext.PreDamageInfoStepBuilder WithIsReactable(bool isReactable)

Parameters

isReactable bool

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithPerformer(EntityCore)

Set the performer entity (the entity causing the damage). Optional — pass null or omit entirely when no specific entity performed the damage (e.g. environmental, traps, system-initiated).

public PreDamageContext.PreDamageInfoStepBuilder WithPerformer(EntityCore performer)

Parameters

performer EntityCore

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithSource(DamageSourceSO)

Set the damage source category.

public PreDamageContext.DamageInfoTarget WithSource(DamageSourceSO damageSource)

Parameters

damageSource DamageSourceSO

Returns

PreDamageContext.DamageInfoTarget

WithTarget(EntityCore)

Set the target entity that will receive the damage.

public PreDamageContext.PreDamageInfoStepBuilder WithTarget(EntityCore target)

Parameters

target EntityCore

Returns

PreDamageContext.PreDamageInfoStepBuilder

WithType(DamageTypeSO)

Set the damage type.

public PreDamageContext.DamageInfoSource WithType(DamageTypeSO type)

Parameters

type DamageTypeSO

Returns

PreDamageContext.DamageInfoSource