Skip to content

Class: DamageInstance ​

csharp
public abstract class DamageInstance : AbilityInstance, ILogicUpdate, ICleanup, ICustomDestroyRoutine

Fields ​

NameDeclarationDescription
applyElementalpublic bool applyElemental
attackEffectpublic float attackEffect
attackEffectType`[ShowIf("@attackEffect > 0.001f", true)]
public AttackEffectType attackEffectType`
cancelIfCasterDeadpublic bool cancelIfCasterDead
closeEnemyDistanceThresholdpublic float closeEnemyDistanceThreshold
closeEnemyMultiplierpublic float closeEnemyMultiplier
cooldownTime`[ShowIf("_isCooldownCheck", true)]
public float cooldownTime`
destroyWhenDonepublic bool destroyWhenDone
dmgFactorpublic ScalingValue dmgFactor
doKnockbackpublic bool doKnockback
duplicateCheckpublic DamageInstance.DuplicateCheckType duplicateCheck
elemental`[ShowIf("applyElemental", true)]
public ElementalType elemental`
elementalChance`[ShowIf("applyElemental", true)]
public float elementalChance`
forceMergeNumberspublic bool forceMergeNumbers
heroDamageMultiplierpublic float heroDamageMultiplier
hitEffect`[Title("Effects", null, TitleAlignments.Left, true, true)]
public GameObject hitEffect`
hittablepublic AbilityTargetValidator hittable
isDamageOverTimepublic bool isDamageOverTime
knockbackSettings`[ShowIf("doKnockback", true)]
[InlineProperty]
[HideLabel]
public Knockback knockbackSettings`
knockupAmount`[Title("Extras", null, TitleAlignments.Left, true, true)]
public float knockupAmount`
mainEffect`[LabelText("Main Effect (Obsolete, Use Start Effect)")]
[HideIf("@mainEffect == null", true)]
public GameObject mainEffect`
monsterDamageMultiplierpublic float monsterDamageMultiplier
multiplyDamageByMaxHppublic bool multiplyDamageByMaxHp
onHitpublic SafeAction<Entity> onHit
originpublic DamageInstance.OriginType origin
procCoefficientpublic float procCoefficient
range`[Title("General", null, TitleAlignments.Left, true, true)]
public DewCollider range`
strengthMultiplierpublic float strengthMultiplierAffects damage amount, knockup amount and proc coefficient.
type`[Title("Damage", null, TitleAlignments.Left, true, true)]
public DamageData.SourceType type`
useDirectionOfCast`[ShowIf("doKnockback", true)]
public bool useDirectionOfCast`

Methods ​

AddToDuplicateTracker(Entity) ​

csharp
protected void AddToDuplicateTracker(Entity ent)

Parameters:

NameTypeDescription
entEntity

CheckShouldBeDestroyed() ​

csharp
protected bool CheckShouldBeDestroyed()

Returns: bool

DoCollisionChecks() ​

Can be called multiple times. Duplicates will be excluded.

csharp
protected void DoCollisionChecks()

IsDuplicate(Entity) ​

csharp
protected bool IsDuplicate(Entity ent)

Parameters:

NameTypeDescription
entEntity

Returns: bool

OnBeforeDispatchDamage(ref DamageData, Entity) ​

Called on server to process damage before applying it.

csharp
protected virtual void OnBeforeDispatchDamage(ref DamageData dmg, Entity target)

Parameters:

NameTypeDescription
dmgDamageData
targetEntity

OnCollisionCheck() ​

csharp
protected virtual void OnCollisionCheck()

OnCreate() ​

csharp
protected override void OnCreate()

OnDestroyActor() ​

csharp
protected override void OnDestroyActor()

OnHit(Entity) ​

Called on server when this instance hits an entity.

csharp
protected virtual void OnHit(Entity entity)

Parameters:

NameTypeDescription
entityEntity

OnValidateTarget(Entity) ​

Called on server to validate hits on entity. Return false here to ignore certain hit on an entity.

csharp
protected virtual bool OnValidateTarget(Entity entity)

Parameters:

NameTypeDescription
entityEntity

Returns: bool

ShouldUseDefaultAbilityTargetValidator() ​

csharp
protected virtual bool ShouldUseDefaultAbilityTargetValidator()

Returns: bool

Maintained by the Shape of Dreams Modding Community