Skip to main content

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.

Constructors​

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

Fields​

9 private and internal fields
MemberWhat it is
private List<ImpactChannel> channelsBacking field for Channels, the impact channels this impactor hits on.
private float crippleDamageModifierBacking field for CrippleDamageModifier. Defaults to 1.
private float directionPowerBacking field for DirectionPower; effectiveness is the direction dot product raised to this power.
private float edgeLengthBacking field for EdgeLength. Defaults to -1.
private float healthDamageModifierBacking field for HealthDamageModifier. Defaults to 1.
private float lerpValueBacking field for LerpValue. Defaults to 0.05.
private float maximumFollowBacking field for MaximumFollow. Defaults to 1.35.
private float minimumFollowBacking field for MinimumFollow. Defaults to 0.35.
private ImpactType typeBacking field for Type, the ImpactType of this impactor.

Properties​

MemberWhat 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​

MemberWhat 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: