Moved stun from AnimController to the character class, server notifies clients when the stun ends, husk infection included in character status messages

This commit is contained in:
Regalis
2017-04-07 19:56:25 +03:00
parent af80a44970
commit f863eb331d
10 changed files with 46 additions and 46 deletions

View File

@@ -49,7 +49,7 @@ namespace Barotrauma
{
if (Frozen) return;
if (character.IsDead || character.IsUnconscious || stunTimer > 0.0f)
if (character.IsDead || character.IsUnconscious || character.Stun > 0.0f)
{
Collider.FarseerBody.FixedRotation = false;
@@ -63,12 +63,7 @@ namespace Barotrauma
Collider.LinearVelocity = (MainLimb.SimPosition - Collider.SimPosition) * 60.0f;
Collider.SmoothRotate(MainLimb.Rotation);
}
if (stunTimer > 0)
{
stunTimer -= deltaTime;
}
return;
}
@@ -89,7 +84,7 @@ namespace Barotrauma
if (strongestImpact > 0.0f)
{
stunTimer = MathHelper.Clamp(strongestImpact * 0.5f, stunTimer, 5.0f);
character.Stun = MathHelper.Clamp(strongestImpact * 0.5f, character.Stun, 5.0f);
strongestImpact = 0.0f;
}