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.

This commit is contained in:
Joonas Rikkonen
2018-02-05 11:16:03 +02:00
parent b4e5aad2ce
commit 60ad5ed3fb
2 changed files with 5 additions and 13 deletions

View File

@@ -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);
}
}

View File

@@ -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)