From 60ad5ed3fb889e8a6cbc95f9b5258a9ac6f1dba2 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 5 Feb 2018 11:16:03 +0200 Subject: [PATCH] Reverted b26b6a74. Making stunned characters receive damage from limb impacts caused them to suffer excessive amounts of damage when falling or getting thrown around when the sub hits something (e.g. a moloch attacking a sub could easily kill crew members by bumping the sub and falling down the stairs was often a death sentence). In general I don't think it's a good idea to apply impact damage from limb impacts, because the limbs may occasionally move or rotate at very high velocities due to the animations. --- .../Source/Characters/Animation/Ragdoll.cs | 2 +- .../Source/Characters/Animation/Ragdoll.cs | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs index fa8066d54..5a1e78a7f 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs @@ -39,7 +39,7 @@ namespace Barotrauma } } - if (Character.Controlled == character) GameMain.GameScreen.Cam.Shake = strongestImpact; + if (Character.Controlled == character) GameMain.GameScreen.Cam.Shake = Math.Min(strongestImpact, 3.0f); } } diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs index a4a8fb54e..c45cceddc 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs @@ -498,23 +498,13 @@ namespace Barotrauma { if (character.DisableImpactDamageTimer > 0.0f) return; - Vector2 normal = contact.Manifold.LocalNormal; - - //Vector2 avgVelocity = Vector2.Zero; - //foreach (Limb limb in Limbs) - //{ - // avgVelocity += limb.LinearVelocity; - //} - + Vector2 normal = contact.Manifold.LocalNormal; Vector2 velocity = f1.Body.LinearVelocity; if (character.Submarine == null && f2.Body.UserData is Submarine) velocity -= ((Submarine)f2.Body.UserData).Velocity; float impact = Vector2.Dot(velocity, -normal); - - ImpactProjSpecific(impact,f1.Body); - - if ((f1.Body.UserData is Limb && character.Stun > 0f) || f1.Body == Collider.FarseerBody) + if (f1.Body == Collider.FarseerBody) { if (!character.IsRemotePlayer || GameMain.Server != null) { @@ -526,6 +516,8 @@ namespace Barotrauma } } } + + ImpactProjSpecific(impact, f1.Body); } public void SeverLimbJoint(LimbJoint limbJoint)