ImpactHit
A class in Root.Township, Alta.Impact.
Damage data for a physical hit (tool, particle and so on) on an ImpactDetector. Holds base damage, effectiveness and multipliers, and works out final health and cripple damage, including the server's damage setting.
- Listed in Items, inventory and logic
- Inherits or implements
DamageData - Derived types
ImpactHitWithTool - Documented in Impacts and hit detection
Constructors
| Member | What it is |
|---|---|
ImpactHit(float baseHealthDamage, float baseCrippleDamage, float multipliers, float effectiveness, ImpactDetector detector, ImpactType impactType, Vector3 point, Vector3 normal, Vector3 direction, Collider struckCollider, NetworkEntity wielder, PlayerController playerWielder) | Creates an ImpactHit from baseHealthDamage, baseCrippleDamage, multipliers, effectiveness, detector, impactType, point, normal, direction, struckCollider, wielder and playerWielder. |
protected ImpactHit(float baseHealthDamage, float baseCrippleDamage, float multipliers, float effectiveness, ImpactDetector detector, ImpactType impactType, NetworkEntity wielder, PlayerController playerWielder) | Creates an ImpactHit from baseHealthDamage, baseCrippleDamage, multipliers, effectiveness, detector, impactType, point, normal, direction, struckCollider, wielder and playerWielder. |
1 private and internal constructor
| Member | What it is |
|---|---|
private ImpactHit() | Creates an ImpactHit from baseHealthDamage, baseCrippleDamage, multipliers, effectiveness, detector, impactType, point, normal, direction, struckCollider, wielder and playerWielder. |
Fields
| Member | What it is |
|---|---|
static readonly ImpactHit DebugHit | Static shared hit marked as a debug hit, with no damage values. |
Properties
| Member | What it is |
|---|---|
float BaseCrippleDamage { get; private set; } | Cripple damage before effectiveness and multipliers. |
float BaseHealthDamage { get; private set; } | Health damage before effectiveness and multipliers. |
ContactPointStructure[] ContactStructure { get; set; } | Contact points of the collision, when it came from one. |
float CrippleDamage { get; } | Final cripple damage: base times effectiveness, server damage multiplier, Multipliers and CripplingMultiplier. 0 when the hit is not valid. |
float CripplingMultiplier { get; set; } | Extra multiplier for cripple damage only. |
static float DamageMultiplier { get; } | Static: the server config's DamageX setting on the server, 1 on clients. |
Vector3 Direction { get; protected set; } | Direction of travel of the hitting object. |
float Effectiveness { get; set; } | How well the hit landed. The hit only counts when this is above 0. |
float HealthDamage { get; } | Final health damage: base times effectiveness, server damage multiplier, Multipliers and HealthMultiplier. 0 when not valid. |
float HealthMultiplier { get; set; } | Extra multiplier for health damage only. |
ImpactDetector ImpactDetector { get; set; } | The detector that was hit. |
ImpactType ImpactType { get; private set; } | The damage type of the hit, which health objects use to pick their damage multiplier. |
bool IsDebugHit { get; } | True only for DebugHit. |
bool IsValid { get; } | True when Effectiveness is above 0. |
float Multipliers { get; set; } | Combined multiplier given when the hit is made, applied to both damage types. Damage popups show its share as bonus damage. |
virtual Vector3 Normal { get; private set; } | Surface normal at the hit point. |
PlayerController PlayerWielder { get; } | The player controller wielding the tool, if a player made the hit. |
virtual Vector3 Point { get; private set; } | World position of the hit. |
Vector3 RelativeVelocity { get; set; } | Relative velocity of the collision. |
Collider Struck { get; set; } | The collider that was hit. |
NetworkEntity Wielder { get; } | The entity wielding the tool (a player or creature), if any. |
Used in
Members of other types that take, return or hold a ImpactHit:
ForgedModel<TB, TA>.HandleHit, ChiselingTool.HitPiece, ChiselingTool.LastHit, ConfirmationCraftingPart.HasOverflow, GenericCraftingNail.IcClientSideImpact, GenericCraftingNail.ReceiveHit, GenericCraftingPiece.HasOverflow, INailable.HasOverflow, EmbeddableSurface.Hit, IImpactEffect.Trigger, ImpactDetector.OnImpactHit, ImpactDetectorSettings.PlayEffects, ImpactHitThresholdTrigger.OnHit, ImpactHitTrigger.CheckForValidHit, SparkImpactDetector.Spark, SparkSecondaryDetector.ClientSpark, SparkSecondaryDetector.ServerSpark, SparkSecondaryDetector.ValidateHit, Phantom.OnImpactReceived, DestroyableStaticObject.Hit, WoodcutTreeModel.HandleHit, BuildupPickup.CutChild, BuildupPickup.ValidateHit, FlintSpark.Trigger, Fuse.OnHit, HealthObject.DetectImpact, HealthObject.OnHealthChanged, HitSpawnData.Hit, HitSpawnData.HitSpawnData, ImpactDetectionLogic.WasHit, ImpactHandler.BeginInvoke, ImpactHandler.Invoke, MultiSpawner.Spawn, PlayerHealth.HandleLocalPlayerHit, PooledObjectDefinitionBase.SpawnAlignedHit, Rock.RegisterHit, SteelSong.CheckHitCount, SteelSong.CheckHitDamage, SteelSong.MaxHitCountSoundEffect.