Removed DamageSoundType and replaced it with a string "tag" instead to allow mod creators to create custom damage sounds
Fixed damagemodifier sounds being completely ignored due to a variable misname Added structure damage possibility for melee weapons so you can break down windows with a crowbar in spectacular fashion (it's clearly a very inferior method to plasma cutters though) Clown hitsounds are in now which is awesome. Beat up some clowns!
This commit is contained in:
@@ -88,9 +88,8 @@
|
||||
<sprite texture="clownpants.png" limb="LeftFoot" sound="footstep_clown" sourcerect="65,41,15,39" origin="0.5,0.35" depth="0.15" hidelimb="true"/>
|
||||
|
||||
<!-- HENK -->
|
||||
<!-- DamageSound isn't played, not even for diving suits/ballistic helmet/armor. Needs looking into.
|
||||
<damagemodifier damagetype="Blunt" armorsector="0.0,360.0" damagemultiplier="1.2" damagesound="LimbClown"/>
|
||||
<damagemodifier damagetype="Slash" armorsector="0.0,360.0" damagemultiplier="1.2" damagesound="LimbClown"/> -->
|
||||
<damagemodifier damagetype="Slash" armorsector="0.0,360.0" damagemultiplier="1.2" damagesound="LimbClown"/>
|
||||
</Wearable>
|
||||
</Item>
|
||||
</Items>
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
<MeleeWeapon slots="Any,RightHand,LeftHand"
|
||||
aimpos="50,0" handle1="-5,0" holdangle="30" reload="1.0">
|
||||
<Attack damage="5" stun="0.2" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
|
||||
<Attack damage="5" structuredamage="5" stun="0.2" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
|
||||
</MeleeWeapon>
|
||||
</Item>
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
<MeleeWeapon slots="RightHand+LeftHand,Any"
|
||||
controlpose="true" aimpos="50,0" handle1="-5,0" handle2="-3,5" holdangle="30" reload="1.7">
|
||||
<Attack damage="20" stun="0.6" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
|
||||
<Attack damage="20" structuredamage="10" stun="0.6" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
|
||||
</MeleeWeapon>
|
||||
</Item>
|
||||
|
||||
|
||||
@@ -1000,7 +1000,7 @@ namespace Barotrauma
|
||||
{
|
||||
target.AddDamage(CauseOfDeath.Bloodloss, 1.0f, character);
|
||||
#if CLIENT
|
||||
SoundPlayer.PlayDamageSound(DamageSoundType.LimbBlunt, 25.0f, targetTorso.body);
|
||||
SoundPlayer.PlayDamageSound("LimbBlunt", 25.0f, targetTorso.body);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace Barotrauma
|
||||
|
||||
|
||||
#if CLIENT
|
||||
[Serialize(DamageSoundType.None, false)]
|
||||
public DamageSoundType DamageSoundType
|
||||
[Serialize("", false)]
|
||||
public string DamageSound
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
|
||||
@@ -372,13 +372,13 @@ namespace Barotrauma
|
||||
#if CLIENT
|
||||
if (playSound)
|
||||
{
|
||||
DamageSoundType damageSoundType = (damageType == DamageType.Blunt) ? DamageSoundType.LimbBlunt : DamageSoundType.LimbSlash;
|
||||
string damageSoundType = (damageType == DamageType.Blunt) ? "LimbBlunt" : "LimbSlash";
|
||||
|
||||
foreach (DamageModifier damageModifier in appliedDamageModifiers)
|
||||
{
|
||||
if (damageModifier.DamageSoundType != DamageSoundType.None)
|
||||
if (!string.IsNullOrWhiteSpace(damageModifier.DamageSound))
|
||||
{
|
||||
damageSoundType = damageModifier.DamageSoundType;
|
||||
damageSoundType = damageModifier.DamageSound;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace Barotrauma.Items.Components
|
||||
if (Math.Sign(diff) != dir)
|
||||
{
|
||||
#if CLIENT
|
||||
SoundPlayer.PlayDamageSound(DamageSoundType.LimbBlunt, 1.0f, body);
|
||||
SoundPlayer.PlayDamageSound("LimbBlunt", 1.0f, body);
|
||||
#endif
|
||||
|
||||
if (isHorizontal)
|
||||
|
||||
@@ -215,6 +215,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
Character targetCharacter = null;
|
||||
Limb targetLimb = null;
|
||||
Structure targetStructure = null;
|
||||
|
||||
if (f2.Body.UserData is Limb)
|
||||
{
|
||||
@@ -224,8 +225,12 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else if (f2.Body.UserData is Character)
|
||||
{
|
||||
|
||||
targetCharacter = (Character)f2.Body.UserData;
|
||||
targetLimb = targetCharacter.AnimController.GetLimb(LimbType.Torso); //Otherwise armor can be bypassed in strange ways
|
||||
}
|
||||
else if (f2.Body.UserData is Structure)
|
||||
{
|
||||
targetStructure = (Structure)f2.Body.UserData;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -236,14 +241,22 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (attack != null)
|
||||
{
|
||||
if (targetLimb == null)
|
||||
if (targetLimb != null)
|
||||
{
|
||||
attack.DoDamageToLimb(user, targetLimb, item.WorldPosition, 1.0f);
|
||||
}
|
||||
else
|
||||
else if (targetCharacter != null)
|
||||
{
|
||||
attack.DoDamage(user, targetCharacter, item.WorldPosition, 1.0f);
|
||||
}
|
||||
else if (targetStructure != null)
|
||||
{
|
||||
attack.DoDamage(user, targetStructure, item.WorldPosition, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
RestoreCollision();
|
||||
@@ -251,7 +264,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (GameMain.Client != null) return true;
|
||||
|
||||
if (GameMain.Server != null)
|
||||
if (GameMain.Server != null && targetCharacter != null) //TODO: Log structure hits
|
||||
{
|
||||
GameMain.Server.CreateEntityEvent(item, new object[] { Networking.NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnUse, targetCharacter.ID });
|
||||
|
||||
@@ -263,8 +276,9 @@ namespace Barotrauma.Items.Components
|
||||
logStr += " on " + targetCharacter.LogName + ".";
|
||||
Networking.GameServer.Log(logStr, Networking.ServerLog.MessageType.Attack);
|
||||
}
|
||||
|
||||
ApplyStatusEffects(ActionType.OnUse, 1.0f, targetLimb.character);
|
||||
|
||||
if (targetCharacter != null) //TODO: Allow OnUse to happen on structures too maybe??
|
||||
ApplyStatusEffects(ActionType.OnUse, 1.0f, targetCharacter != null ? targetCharacter : null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ namespace Barotrauma
|
||||
float impact = Vector2.Dot(f2.Body.LinearVelocity, -normal)*f2.Body.Mass*0.1f;
|
||||
|
||||
#if CLIENT
|
||||
SoundPlayer.PlayDamageSound(DamageSoundType.StructureBlunt, impact,
|
||||
SoundPlayer.PlayDamageSound("StructureBlunt", impact,
|
||||
new Vector2(
|
||||
sections[section].rect.X + sections[section].rect.Width / 2,
|
||||
sections[section].rect.Y - sections[section].rect.Height / 2), tags: Tags);
|
||||
@@ -663,7 +663,7 @@ namespace Barotrauma
|
||||
|
||||
if (playSound)// && !SectionBodyDisabled(i))
|
||||
{
|
||||
DamageSoundType damageSoundType = (attack.DamageType == DamageType.Blunt) ? DamageSoundType.StructureBlunt : DamageSoundType.StructureSlash;
|
||||
string damageSoundType = (attack.DamageType == DamageType.Blunt) ? "StructureBlunt" : "StructureSlash";
|
||||
SoundPlayer.PlayDamageSound(damageSoundType, damageAmount, worldPosition, tags: Tags);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -665,7 +665,7 @@ namespace Barotrauma
|
||||
if (maxDamageStructure != null)
|
||||
{
|
||||
SoundPlayer.PlayDamageSound(
|
||||
DamageSoundType.StructureBlunt,
|
||||
"StructureBlunt",
|
||||
impact * 10.0f,
|
||||
ConvertUnits.ToDisplayUnits(lastContactPoint),
|
||||
MathHelper.Clamp(maxDamage * 4.0f, 1000.0f, 4000.0f),
|
||||
|
||||
Reference in New Issue
Block a user