diff --git a/Barotrauma/BarotraumaClient/ClientCode.projitems b/Barotrauma/BarotraumaClient/ClientCode.projitems
index 991ce2d39..1b79fd2eb 100644
--- a/Barotrauma/BarotraumaClient/ClientCode.projitems
+++ b/Barotrauma/BarotraumaClient/ClientCode.projitems
@@ -43,12 +43,8 @@
-
-
+
-
-
-
@@ -188,7 +184,6 @@
-
diff --git a/Barotrauma/BarotraumaClient/Icon.bmp b/Barotrauma/BarotraumaClient/Icon.bmp
index 0a6d53e80..dedeee273 100644
Binary files a/Barotrauma/BarotraumaClient/Icon.bmp and b/Barotrauma/BarotraumaClient/Icon.bmp differ
diff --git a/Barotrauma/BarotraumaClient/Launch_Barotrauma b/Barotrauma/BarotraumaClient/Launch_Barotrauma
index 4e95158fd..8792fad24 100644
--- a/Barotrauma/BarotraumaClient/Launch_Barotrauma
+++ b/Barotrauma/BarotraumaClient/Launch_Barotrauma
@@ -1,3 +1,3 @@
#!/bin/sh
-./Barotrauma
+exec mono "./Barotrauma.exe" MONO_LOG_LEVEL=debug "$@"
diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj
index 56b243537..f0fa4331e 100644
--- a/Barotrauma/BarotraumaClient/LinuxClient.csproj
+++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj
@@ -56,30 +56,13 @@
true
0
-
- true
- ..\bin\x86\ReleaseLinux\
- TRACE;LINUX;CLIENT
- true
- pdbonly
- x86
- MinimumRecommendedRules.ruleset
- true
-
-
- true
- ..\bin\x86\DebugLinux\
- TRACE;DEBUG;LINUX;CLIENT
- 0
- full
- x86
- MinimumRecommendedRules.ruleset
- true
-
+
+ ..\..\Libraries\NuGet\Concentus.1.1.7\lib\portable-net45+win+wpa81+wp80\Concentus.dll
+
..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.1.1.12\lib\net45\GameAnalytics.Mono.dll
@@ -149,10 +132,6 @@
-
- {0e7fee6a-15e5-4a4e-943c-80276003478c}
- Concentus
-
{3af0347c-5a9b-4421-868c-8ee3dbfaebc6}
Facepunch.Steamworks
@@ -207,73 +186,13 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
@@ -298,12 +217,7 @@
Other similar extension points exist, see Microsoft.Common.targets.
- -->
-
-
-
-
-
+ -->
\ No newline at end of file
diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj
index 797f42a80..29dd488d3 100644
--- a/Barotrauma/BarotraumaClient/MacClient.csproj
+++ b/Barotrauma/BarotraumaClient/MacClient.csproj
@@ -55,30 +55,13 @@
true
0
-
- true
- ..\bin\x86\ReleaseMac\
- TRACE;OSX;CLIENT
- true
- pdbonly
- x86
- MinimumRecommendedRules.ruleset
- true
-
-
- true
- ..\bin\x86\DebugMac\
- TRACE;DEBUG;OSX;CLIENT
- 0
- full
- x86
- MinimumRecommendedRules.ruleset
- true
-
+
+ ..\..\Libraries\NuGet\Concentus.1.1.7\lib\portable-net45+win+wpa81+wp80\Concentus.dll
+
..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.1.1.12\lib\net45\GameAnalytics.Mono.dll
@@ -148,10 +131,6 @@
-
- {0e7fee6a-15e5-4a4e-943c-80276003478c}
- Concentus
-
{3af0347c-5a9b-4421-868c-8ee3dbfaebc6}
Facepunch.Steamworks
@@ -209,62 +188,7 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
@@ -284,12 +208,7 @@
Other similar extension points exist, see Microsoft.Common.targets.
- -->
-
-
-
-
-
+ -->
\ No newline at end of file
diff --git a/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs b/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs
index 5e2918897..b67af8559 100644
--- a/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs
+++ b/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.8.10.0")]
-[assembly: AssemblyFileVersion("0.8.10.0")]
+[assembly: AssemblyVersion("0.8.9.10")]
+[assembly: AssemblyFileVersion("0.8.9.10")]
diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs
index 2e11c7af2..69530ef26 100644
--- a/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs
+++ b/Barotrauma/BarotraumaClient/Source/Characters/Animation/Ragdoll.cs
@@ -98,7 +98,7 @@ namespace Barotrauma
if (distSqrd > 10.0f || !character.AllowInput)
{
Collider.TargetRotation = newRotation;
- SetPosition(newPosition, lerp: distSqrd < 5.0f, ignorePlatforms: false);
+ SetPosition(newPosition, lerp: distSqrd < 5.0f);
}
else
{
@@ -238,16 +238,20 @@ namespace Barotrauma
}
float errorMagnitude = positionError.Length();
- if (errorMagnitude > 0.5f)
- {
- character.MemLocalState.Clear();
- SetPosition(serverPos.Position, lerp: true, ignorePlatforms: false);
- }
- else if (errorMagnitude > 0.01f)
+ if (errorMagnitude > 0.01f)
{
Collider.TargetPosition = Collider.SimPosition + positionError;
Collider.TargetRotation = Collider.Rotation + rotationError;
Collider.MoveToTargetPosition(lerp: true);
+ if (errorMagnitude > 0.5f)
+ {
+ character.MemLocalState.Clear();
+ foreach (Limb limb in Limbs)
+ {
+ limb.body.TargetPosition = limb.body.SimPosition + positionError;
+ limb.body.MoveToTargetPosition(lerp: true);
+ }
+ }
}
}
@@ -260,17 +264,57 @@ namespace Barotrauma
partial void ImpactProjSpecific(float impact, Body body)
{
- float volume = MathHelper.Clamp(impact - 3.0f, 0.5f, 1.0f);
+ float volume = Math.Min(impact - 3.0f, 1.0f);
- if (body.UserData is Limb limb && character.Stun <= 0f)
+ partial void UpdateNetPlayerPositionProjSpecific(float deltaTime, float lowestSubPos)
+ {
+ if (character != GameMain.Client.Character || !character.AllowInput)
{
- if (impact > 3.0f) { PlayImpactSound(limb); }
- }
- else if (body.UserData is Limb || body == Collider.FarseerBody)
- {
- if (!character.IsRemotePlayer && impact > ImpactTolerance)
+ Limb limb = (Limb)body.UserData;
+ if (impact > 3.0f && limb.LastImpactSoundTime < Timing.TotalTime - Limb.SoundInterval)
{
- SoundPlayer.PlayDamageSound("LimbBlunt", strongestImpact, Collider);
+ limb.LastImpactSoundTime = (float)Timing.TotalTime;
+ if (!string.IsNullOrWhiteSpace(limb.HitSoundTag))
+ {
+ SoundPlayer.PlaySound(limb.HitSoundTag, volume, impact * 100.0f, limb.WorldPosition, character.CurrentHull);
+ }
+
+ //unconscious/dead characters can't correct their position using AnimController movement
+ // -> we need to correct it manually
+ if (!character.AllowInput)
+ {
+ float mainLimbDistSqrd = Vector2.DistanceSquared(MainLimb.PullJointWorldAnchorA, Collider.SimPosition);
+ float mainLimbErrorTolerance = 0.1f;
+ //if the main limb is roughly at the correct position and the collider isn't moving (much at least),
+ //don't attempt to correct the position.
+ if (mainLimbDistSqrd > mainLimbErrorTolerance || Collider.LinearVelocity.LengthSquared() > 0.05f)
+ {
+ SoundPlayer.PlaySound(wearable.Sound, volume, impact * 100.0f, limb.WorldPosition, character.CurrentHull);
+ }
+ }
+ }
+ character.MemLocalState.Clear();
+ }
+ else
+ {
+ if (!character.IsRemotePlayer)
+ {
+ if (character.Submarine == null)
+ {
+ //transform in-sub coordinates to outside coordinates
+ if (character.MemLocalState[i].Position.Y > lowestSubPos)
+ {
+ character.MemLocalState[i].TransformInToOutside();
+ }
+ }
+ else if (currentHull?.Submarine != null)
+ {
+ //transform outside coordinates to in-sub coordinates
+ if (character.MemLocalState[i].Position.Y < lowestSubPos)
+ {
+ character.MemLocalState[i].TransformOutToInside(currentHull.Submarine);
+ }
+ }
}
}
if (Character.Controlled == character)
@@ -279,29 +323,6 @@ namespace Barotrauma
}
}
- public void PlayImpactSound(Limb limb)
- {
- limb.LastImpactSoundTime = (float)Timing.TotalTime;
- if (!string.IsNullOrWhiteSpace(limb.HitSoundTag))
- {
- bool inWater = limb.inWater;
- if (character.CurrentHull != null &&
- character.CurrentHull.Surface > character.CurrentHull.Rect.Y - character.CurrentHull.Rect.Height &&
- limb.SimPosition.Y < ConvertUnits.ToSimUnits(character.CurrentHull.Rect.Y - character.CurrentHull.Rect.Height) + limb.body.GetMaxExtent())
- {
- inWater = true;
- }
- SoundPlayer.PlaySound(inWater ? "footstep_water" : limb.HitSoundTag, limb.WorldPosition, hullGuess: character.CurrentHull);
- }
- foreach (WearableSprite wearable in limb.WearingItems)
- {
- if (limb.type == wearable.Limb && !string.IsNullOrWhiteSpace(wearable.Sound))
- {
- SoundPlayer.PlaySound(wearable.Sound, limb.WorldPosition, hullGuess: character.CurrentHull);
- }
- }
- }
-
partial void Splash(Limb limb, Hull limbHull)
{
//create a splash particle
@@ -364,8 +385,6 @@ namespace Barotrauma
partial void UpdateProjSpecific(float deltaTime)
{
- if (!character.Enabled || SimplePhysicsEnabled) { return; }
-
LimbJoints.ForEach(j => j.UpdateDeformations(deltaTime));
foreach (var deformation in SpriteDeformations)
{
@@ -396,7 +415,7 @@ namespace Barotrauma
}
}
- partial void SeverLimbJointProjSpecific(LimbJoint limbJoint, bool playSound = true)
+ partial void SeverLimbJointProjSpecific(LimbJoint limbJoint)
{
foreach (Limb limb in new Limb[] { limbJoint.LimbA, limbJoint.LimbB })
{
@@ -414,11 +433,6 @@ namespace Barotrauma
character.CurrentHull?.AddDecal(character.BloodDecalName, limb.WorldPosition, MathHelper.Clamp(limb.Mass, 0.5f, 2.0f));
}
}
-
- if (playSound)
- {
- SoundPlayer.PlayDamageSound("Gore", 1.0f, limbJoint.LimbA.body);
- }
}
public virtual void Draw(SpriteBatch spriteBatch, Camera cam)
@@ -436,15 +450,14 @@ namespace Barotrauma
return;
}
- Color? color = null;
- if (character.ExternalHighlight)
- {
- color = Color.Lerp(Color.White, Color.OrangeRed, (float)Math.Sin(Timing.TotalTime * 3.5f));
- }
+ //foreach (Limb limb in Limbs)
+ //{
+ // limb.Draw(spriteBatch, cam);
+ //}
for (int i = 0; i < limbs.Length; i++)
{
- inversedLimbDrawOrder[i].Draw(spriteBatch, cam, color);
+ inversedLimbDrawOrder[i].Draw(spriteBatch, cam);
}
LimbJoints.ForEach(j => j.Draw(spriteBatch));
}
diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Attack.cs b/Barotrauma/BarotraumaClient/Source/Characters/Attack.cs
index 3b3626b65..7d293d643 100644
--- a/Barotrauma/BarotraumaClient/Source/Characters/Attack.cs
+++ b/Barotrauma/BarotraumaClient/Source/Characters/Attack.cs
@@ -50,7 +50,7 @@ namespace Barotrauma
if (sound != null)
{
- SoundPlayer.PlaySound(sound.Sound, worldPosition, sound.Volume, sound.Range);
+ SoundPlayer.PlaySound(sound.Sound, sound.Volume, sound.Range, worldPosition);
}
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
index 4c029c726..e4668eccd 100644
--- a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
+++ b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
@@ -46,7 +46,8 @@ namespace Barotrauma
if (controlled == value) return;
controlled = value;
if (controlled != null) controlled.Enabled = true;
- CharacterHealth.OpenHealthWindow = null;
+ CharacterHealth.OpenHealthWindow = null;
+
}
}
@@ -110,33 +111,6 @@ namespace Barotrauma
get { return gibEmitters; }
}
- public class ObjectiveEntity
- {
- public Entity Entity;
- public Sprite Sprite;
- public Color Color;
-
- public ObjectiveEntity(Entity entity, Sprite sprite, Color? color = null)
- {
- Entity = entity;
- Sprite = sprite;
- if (color.HasValue)
- {
- Color = color.Value;
- }
- else
- {
- Color = Color.White;
- }
- }
- }
-
- private List activeObjectiveEntities = new List();
- public IEnumerable ActiveObjectiveEntities
- {
- get { return activeObjectiveEntities; }
- }
-
partial void InitProjSpecific(XDocument doc)
{
soundInterval = doc.Root.GetAttributeFloat("soundinterval", 10.0f);
@@ -164,6 +138,7 @@ namespace Barotrauma
break;
}
}
+ }
hudProgressBars = new Dictionary