Skip to main content

DamageMultiplierCollider

A class in Root.Township, Alta.Impact.

Collider modifier asset that scales health and cripple damage for hits on the colliders it's assigned to, such as a weak or armoured spot. Can scale differently per impact type.

Constructors​

MemberWhat it is
DamageMultiplierCollider()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

5 private and internal fields
MemberWhat it is
private bool affectsCrippleDamageWhether cripple damage is scaled.
private bool affectsHealthDamageWhether health damage is scaled.
private AttackTypeMultiplier[] attackTypeMultipliersExtra multipliers per impact type, applied on top of the health and cripple multipliers.
private float crippleMultiplierFactor for cripple damage. Default 0.5.
private float healthMultiplierFactor for health damage. Default 0.5.

Methods​

MemberWhat it is
override bool IsDamaging(ImpactDetectorColliderModifier modifier, ImpactTool tool, ContactPointStructure point)Always true, so hits on these colliders still count as damaging.
override void ModifyHit(ImpactDetectorColliderModifier modifier, ImpactHitWithTool hit, ContactPointStructure point)Multiplies the hit's health and cripple multipliers by the set multipliers times the impact type multiplier.
protected float GetMultiplier(ImpactType impactType)Returns the extra multiplier for the hit's impact type from attackTypeMultipliers, or 1 if the type isn't listed.