ImpactorValues
A class in Root.Township, Alta.Impact.
Asset of numbers for an Impactor (the part of a tool that deals hits): impact type, damage modifiers, edge length, and how swing distance and direction affect effectiveness.
- Listed in Items, inventory and logic
- Inherits or implements
ScriptableObject - Documented in Impacts and hit detection
Constructors
| Member | What it is |
|---|---|
ImpactorValues() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private List<ImpactChannel> channels | Backing field for Channels, the impact channels this impactor hits on. |
private float crippleDamageModifier | Backing field for CrippleDamageModifier. Defaults to 1. |
private float directionPower | Backing field for DirectionPower; effectiveness is the direction dot product raised to this power. |
private float edgeLength | Backing field for EdgeLength. Defaults to -1. |
private float healthDamageModifier | Backing field for HealthDamageModifier. Defaults to 1. |
private float lerpValue | Backing field for LerpValue. Defaults to 0.05. |
private float maximumFollow | Backing field for MaximumFollow. Defaults to 1.35. |
private float minimumFollow | Backing field for MinimumFollow. Defaults to 0.35. |
private ImpactType type | Backing field for Type, the ImpactType of this impactor. |
Properties
| Member | What it is |
|---|---|
List<ImpactChannel> Channels { get; } | The impact channels set on this asset. |
float CrippleDamageModifier { get; } | Multiplier on cripple damage. |
float DirectionPower { get; } | Effectiveness is the swing direction's dot with the impactor's forward to this power. 0 or less ignores direction. |
float EdgeLength { get; } | Length of the edge along local up. Above 0 the hit point along the edge is used, otherwise a single point. |
float HealthDamageModifier { get; } | Multiplier on health damage. |
float LerpValue { get; } | Not read anywhere else in this build. |
float MaximumFollow { get; } | Swing distance at which the distance multiplier reaches 1. |
float MinimumFollow { get; } | Shortest swing distance that counts. A shorter swing gives no effective hit. |
ImpactType Type { get; } | The ImpactType of hits from this impactor. |
Methods
| Member | What it is |
|---|---|
override bool Equals(object obj) | Compares every value, but the channel list by reference, so a GetCopy result never equals the original. |
ImpactorValues GetCopy() | A new in-memory copy with its own channel list. |
override int GetHashCode() | Hash of all values and channels. Logs an error for a missing channel. |
Used in
Members of other types that take, return or hold a ImpactorValues: