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.
- Listed in Items, inventory and logic
- Inherits or implements
ColliderModifierSettings - Attributes
CreateAssetMenu - Documented in Impacts and hit detection
Constructors
| Member | What it is |
|---|---|
DamageMultiplierCollider() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private bool affectsCrippleDamage | Whether cripple damage is scaled. |
private bool affectsHealthDamage | Whether health damage is scaled. |
private AttackTypeMultiplier[] attackTypeMultipliers | Extra multipliers per impact type, applied on top of the health and cripple multipliers. |
private float crippleMultiplier | Factor for cripple damage. Default 0.5. |
private float healthMultiplier | Factor for health damage. Default 0.5. |
Methods
| Member | What 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. |