Renamed the "file" attribute of hit sounds to "tag", replaced footstep sound paths in creature configs with tags.

This commit is contained in:
Joonas Rikkonen
2018-02-24 21:13:21 +02:00
parent eaafc022f2
commit 48757618f6
7 changed files with 24 additions and 19 deletions

View File

@@ -21,9 +21,9 @@ namespace Barotrauma
if (impact > 3.0f && limb.SoundTimer <= 0.0f)
{
limb.SoundTimer = Limb.SoundInterval;
if (!string.IsNullOrWhiteSpace(limb.HitSound))
if (!string.IsNullOrWhiteSpace(limb.HitSoundTag))
{
SoundPlayer.PlaySound(limb.HitSound, volume, impact * 100.0f, limb.WorldPosition);
SoundPlayer.PlaySound(limb.HitSoundTag, volume, impact * 100.0f, limb.WorldPosition);
}
foreach (WearableSprite wearable in limb.WearingItems)
{

View File

@@ -17,11 +17,11 @@ namespace Barotrauma
private set;
}
private string hitSound;
private string hitSoundTag;
public string HitSound
public string HitSoundTag
{
get { return hitSound; }
get { return hitSoundTag; }
}
partial void InitProjSpecific(XElement element)
@@ -34,7 +34,12 @@ namespace Barotrauma
LightSource = new LightSource(subElement);
break;
case "sound":
hitSound = subElement.GetAttributeString("file", "");
hitSoundTag = subElement.GetAttributeString("tag", "");
if (string.IsNullOrWhiteSpace(hitSoundTag))
{
//legacy support
hitSoundTag = subElement.GetAttributeString("file", "");
}
break;
}
}

View File

@@ -59,7 +59,7 @@
</limb>
<limb id = "5" width="5" height="40" type="RightFoot" flip="true" pullpos="0.0,15.0" refjoint="3" stepoffset="20.0,0.0">
<sprite texture="Content/Characters/Crawler/crawler.png" sourcerect="59,78,19,43" depth="0.03" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_metal"/>
</limb>
<limb id = "6" width="13" height="35" type="LeftLeg" flip="true">
@@ -67,7 +67,7 @@
</limb>
<limb id = "7" width="5" height="40" type="LeftFoot" flip="true" pullpos="0.0,15.0" refjoint="5" stepoffset="20.0,0.0">
<sprite texture="Content/Characters/Crawler/crawler.png" sourcerect="59,78,19,43" depth="0.03" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_metal"/>
</limb>
<limb id = "8" width="13" height="35" type="RightLeg" flip="true">
@@ -75,7 +75,7 @@
</limb>
<limb id = "9" width="5" height="40" type="RightFoot" flip="true" pullpos="0.0,15.0" refjoint="7" stepoffset="20.0,0.0">
<sprite texture="Content/Characters/Crawler/crawler.png" sourcerect="59,78,19,43" depth="0.03" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_metal"/>
</limb>
<joint limb1="0" limb1anchor="-5,-38" limb2="1" limb2anchor="-2,25" lowerlimit="-20" upperlimit="40" canbesevered="true"/>

View File

@@ -65,7 +65,7 @@
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="35,53,16,25" depth="0.14" origin="0.5,0.5"/>
<damagedsprite texture="Content/Characters/Human/damagedlegs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<sound file ="footstep_metal"/>
<sound tag="footstep_metal"/>
</limb>
<!-- right leg -->
@@ -80,7 +80,7 @@
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<damagedsprite texture="Content/Characters/Human/damagedlegs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<sound file ="footstep_metal"/>
<sound tag="footstep_metal"/>
</limb>
<!-- head to body -->

View File

@@ -73,7 +73,7 @@
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="35,53,16,25" depth="0.14" origin="0.5,0.5"/>
<damagedsprite texture="Content/Characters/Human/damagedlegs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<sound file ="footstep_metal"/>
<sound tag="footstep_metal"/>
</limb>
<!-- right leg -->
@@ -88,7 +88,7 @@
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<damagedsprite texture="Content/Characters/Human/damagedlegs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<sound file ="footstep_metal"/>
<sound tag="footstep_metal"/>
</limb>

View File

@@ -76,7 +76,7 @@
</limb>
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Husk/legs.png" sourcerect="35,53,16,25" depth="0.14" origin="0.5,0.5"/>
<sound file ="footstep_armor"/>
<sound tag="footstep_armor"/>
</limb>
<!-- right leg -->
@@ -88,7 +88,7 @@
</limb>
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
<sprite texture="Content/Characters/Husk/legs.png" sourcerect="35,53,16,25" origin="0.5,0.5"/>
<sound file ="footstep_armor"/>
<sound tag="footstep_armor"/>
</limb>
<!-- head to body -->

View File

@@ -61,14 +61,14 @@
</limb>
<limb id = "5" width="15" height="63" mass = "4" refjoint="3" flip="true">
<sprite texture="Content/Characters/Mantis/mantis.png" sourcerect="231,80,23,67" depth="0.011" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_armor"/>
</limb>
<!-- ""claw" -->
<limb id = "6" width="15" height="63" mass = "4" flip="true" pullpos="0.0,30.0" refjoint="0">
<sprite texture="Content/Characters/Mantis/mantis.png" sourcerect="228,1,28,76" depth="0.01" origin="0.5,0.5"/>
<attack range="200" damagerange="100" duration="0.25" damage="50" stun="0.1" bleedingdamage="5" structuredamage="20" damagetype="slash" targetforce="-100" severlimbsprobability="0.8"
torque="-20" force="10" applyforceonlimbs="0,1,6"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_armor"/>
</limb>
<limb id = "7" width="15" height="63" mass = "4" type="LeftLeg" flip="true">
@@ -76,7 +76,7 @@
</limb>
<limb id = "8" width="15" height="63" mass = "4" type="LeftFoot" flip="true" pullpos="0.0,30.0" refjoint="0" stepoffset="100.0,0.0">
<sprite texture="Content/Characters/Mantis/mantis.png" sourcerect="206,3,20,85" depth="0.014" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_armor"/>
</limb>
<limb id = "9" width="15" height="63" mass = "4" type="RightLeg" flip="true">
@@ -84,7 +84,7 @@
</limb>
<limb id = "10" width="15" height="102" mass = "4" type="RightFoot" flip="true" pullpos="0.0,50.0" refjoint="5" stepoffset="-150.0,0.0">
<sprite texture="Content/Characters/Mantis/mantis.png" sourcerect="111,0,32,112" depth="0.016" origin="0.5,0.5"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
<sound tag="footstep_armor"/>
</limb>
<joint limb1="0" limb1anchor="-5,-53" limb2="1" limb2anchor="0,20" lowerlimit="-20" upperlimit="20" canbesevered="true"/>