Renamed the "file" attribute of hit sounds to "tag", replaced footstep sound paths in creature configs with tags.
This commit is contained in:
@@ -21,9 +21,9 @@ namespace Barotrauma
|
|||||||
if (impact > 3.0f && limb.SoundTimer <= 0.0f)
|
if (impact > 3.0f && limb.SoundTimer <= 0.0f)
|
||||||
{
|
{
|
||||||
limb.SoundTimer = Limb.SoundInterval;
|
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)
|
foreach (WearableSprite wearable in limb.WearingItems)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ namespace Barotrauma
|
|||||||
private set;
|
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)
|
partial void InitProjSpecific(XElement element)
|
||||||
@@ -34,7 +34,12 @@ namespace Barotrauma
|
|||||||
LightSource = new LightSource(subElement);
|
LightSource = new LightSource(subElement);
|
||||||
break;
|
break;
|
||||||
case "sound":
|
case "sound":
|
||||||
hitSound = subElement.GetAttributeString("file", "");
|
hitSoundTag = subElement.GetAttributeString("tag", "");
|
||||||
|
if (string.IsNullOrWhiteSpace(hitSoundTag))
|
||||||
|
{
|
||||||
|
//legacy support
|
||||||
|
hitSoundTag = subElement.GetAttributeString("file", "");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "5" width="5" height="40" type="RightFoot" flip="true" pullpos="0.0,15.0" refjoint="3" stepoffset="20.0,0.0">
|
<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"/>
|
<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>
|
||||||
|
|
||||||
<limb id = "6" width="13" height="35" type="LeftLeg" flip="true">
|
<limb id = "6" width="13" height="35" type="LeftLeg" flip="true">
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "7" width="5" height="40" type="LeftFoot" flip="true" pullpos="0.0,15.0" refjoint="5" stepoffset="20.0,0.0">
|
<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"/>
|
<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>
|
||||||
|
|
||||||
<limb id = "8" width="13" height="35" type="RightLeg" flip="true">
|
<limb id = "8" width="13" height="35" type="RightLeg" flip="true">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "9" width="5" height="40" type="RightFoot" flip="true" pullpos="0.0,15.0" refjoint="7" stepoffset="20.0,0.0">
|
<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"/>
|
<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>
|
||||||
|
|
||||||
<joint limb1="0" limb1anchor="-5,-38" limb2="1" limb2anchor="-2,25" lowerlimit="-20" upperlimit="40" canbesevered="true"/>
|
<joint limb1="0" limb1anchor="-5,-38" limb2="1" limb2anchor="-2,25" lowerlimit="-20" upperlimit="40" canbesevered="true"/>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<!-- right leg -->
|
<!-- right leg -->
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<!-- head to body -->
|
<!-- head to body -->
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<!-- right leg -->
|
<!-- right leg -->
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "8" radius="5" height="13" mass = "2" type ="LeftFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<!-- right leg -->
|
<!-- right leg -->
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "11" radius="5" height="13" mass = "2" type ="RightFoot" flip="true" pullpos="-5.0,0.0">
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<!-- head to body -->
|
<!-- head to body -->
|
||||||
|
|||||||
@@ -61,14 +61,14 @@
|
|||||||
</limb>
|
</limb>
|
||||||
<limb id = "5" width="15" height="63" mass = "4" refjoint="3" flip="true">
|
<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"/>
|
<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>
|
</limb>
|
||||||
<!-- ""claw" -->
|
<!-- ""claw" -->
|
||||||
<limb id = "6" width="15" height="63" mass = "4" flip="true" pullpos="0.0,30.0" refjoint="0">
|
<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"/>
|
<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"
|
<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"/>
|
torque="-20" force="10" applyforceonlimbs="0,1,6"/>
|
||||||
<sound file ="Content/Sounds/stepMetal.ogg"/>
|
<sound tag="footstep_armor"/>
|
||||||
</limb>
|
</limb>
|
||||||
|
|
||||||
<limb id = "7" width="15" height="63" mass = "4" type="LeftLeg" flip="true">
|
<limb id = "7" width="15" height="63" mass = "4" type="LeftLeg" flip="true">
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</limb>
|
</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">
|
<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"/>
|
<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>
|
||||||
|
|
||||||
<limb id = "9" width="15" height="63" mass = "4" type="RightLeg" flip="true">
|
<limb id = "9" width="15" height="63" mass = "4" type="RightLeg" flip="true">
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
</limb>
|
</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">
|
<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"/>
|
<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>
|
</limb>
|
||||||
|
|
||||||
<joint limb1="0" limb1anchor="-5,-53" limb2="1" limb2anchor="0,20" lowerlimit="-20" upperlimit="20" canbesevered="true"/>
|
<joint limb1="0" limb1anchor="-5,-53" limb2="1" limb2anchor="0,20" lowerlimit="-20" upperlimit="20" canbesevered="true"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user