(6c6831abf) Some new sounds, fixed damage sounds not being played if no damage modifiers are applied

This commit is contained in:
Joonas Rikkonen
2019-04-15 13:42:08 +03:00
parent 3e0d4f5122
commit 918fac9e5e
6 changed files with 50 additions and 3 deletions
@@ -393,7 +393,7 @@ namespace Barotrauma
} }
} }
partial void SeverLimbJointProjSpecific(LimbJoint limbJoint) partial void SeverLimbJointProjSpecific(LimbJoint limbJoint, bool playSound = true)
{ {
foreach (Limb limb in new Limb[] { limbJoint.LimbA, limbJoint.LimbB }) foreach (Limb limb in new Limb[] { limbJoint.LimbA, limbJoint.LimbB })
{ {
@@ -411,6 +411,11 @@ namespace Barotrauma
character.CurrentHull?.AddDecal(character.BloodDecalName, limb.WorldPosition, MathHelper.Clamp(limb.Mass, 0.5f, 2.0f)); 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) public virtual void Draw(SpriteBatch spriteBatch, Camera cam)
@@ -598,6 +598,7 @@ namespace Barotrauma
var limbHealth = limbHealths.OrderByDescending(l => l.TotalDamage).FirstOrDefault(); var limbHealth = limbHealths.OrderByDescending(l => l.TotalDamage).FirstOrDefault();
selectedLimbIndex = limbHealths.IndexOf(limbHealth); selectedLimbIndex = limbHealths.IndexOf(limbHealth);
} }
} }
LimbHealth selectedLimb = selectedLimbIndex < 0 ? highlightedLimb : limbHealths[selectedLimbIndex]; LimbHealth selectedLimb = selectedLimbIndex < 0 ? highlightedLimb : limbHealths[selectedLimbIndex];
if (selectedLimb != currentDisplayedLimb || forceAfflictionContainerUpdate) if (selectedLimb != currentDisplayedLimb || forceAfflictionContainerUpdate)
@@ -296,6 +296,7 @@ namespace Barotrauma
break; break;
} }
} }
SoundPlayer.PlayDamageSound(damageSoundType, Math.Max(damage, bleedingDamage), WorldPosition);
} }
// Always spawn damage particles // Always spawn damage particles
@@ -1949,6 +1949,27 @@
<None Include="$(MSBuildThisFileDirectory)Content\Items\Weapons\ElectricalDischarger.ogg"> <None Include="$(MSBuildThisFileDirectory)Content\Items\Weapons\ElectricalDischarger.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore1.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore2.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore3.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore4.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore5.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore6.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Damage\Gore7.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Impact\MetalImpactHeavy1.ogg"> <None Include="$(MSBuildThisFileDirectory)Content\Sounds\Impact\MetalImpactHeavy1.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
@@ -692,7 +692,7 @@ namespace Barotrauma
ImpactProjSpecific(impact, f1.Body); ImpactProjSpecific(impact, f1.Body);
} }
public void SeverLimbJoint(LimbJoint limbJoint) public void SeverLimbJoint(LimbJoint limbJoint, bool playSound = true)
{ {
if (!limbJoint.CanBeSevered || limbJoint.IsSevered) if (!limbJoint.CanBeSevered || limbJoint.IsSevered)
{ {
@@ -721,7 +721,7 @@ namespace Barotrauma
} }
} }
partial void SeverLimbJointProjSpecific(LimbJoint limbJoint); partial void SeverLimbJointProjSpecific(LimbJoint limbJoint, bool playSound = true);
private void GetConnectedLimbs(List<Limb> connectedLimbs, List<LimbJoint> checkedJoints, Limb limb) private void GetConnectedLimbs(List<Limb> connectedLimbs, List<LimbJoint> checkedJoints, Limb limb)
{ {
@@ -413,6 +413,25 @@ namespace Barotrauma
} }
} }
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public override Rectangle Rect public override Rectangle Rect
{ {
get get