Destruction & impact sound rework pass 1 (#24282)
* Various sounds ported * Replace wall_bonk.ogg * Metal/metalglass break sound pass * Replace metalbreak.ogg * Replace woodhit * Replcae tap.ogg n some smack uses * Fix lint * Replace bang.ogg and some instances of hit_kick.ogg * couple more * fix wood sound * i may be stupid * le attributing * bro what * standardize more destruction sounds * fix melee hit sound cutting off * window threshold sounds and remove `destroySound` it literally doesnt exist
This commit is contained in:
@@ -740,22 +740,27 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
{
|
||||
var playedSound = false;
|
||||
|
||||
if (Deleted(target))
|
||||
return;
|
||||
|
||||
// hitting can obv destroy an entity so we play at coords and not following them
|
||||
var coords = Transform(target).Coordinates;
|
||||
// Play sound based off of highest damage type.
|
||||
if (TryComp<MeleeSoundComponent>(target, out var damageSoundComp))
|
||||
{
|
||||
if (type == null && damageSoundComp.NoDamageSound != null)
|
||||
{
|
||||
Audio.PlayPredicted(damageSoundComp.NoDamageSound, target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(damageSoundComp.NoDamageSound, coords, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
playedSound = true;
|
||||
}
|
||||
else if (type != null && damageSoundComp.SoundTypes?.TryGetValue(type, out var damageSoundType) == true)
|
||||
{
|
||||
Audio.PlayPredicted(damageSoundType, target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(damageSoundType, coords, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
playedSound = true;
|
||||
}
|
||||
else if (type != null && damageSoundComp.SoundGroups?.TryGetValue(type, out var damageSoundGroup) == true)
|
||||
{
|
||||
Audio.PlayPredicted(damageSoundGroup, target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(damageSoundGroup, coords, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
playedSound = true;
|
||||
}
|
||||
}
|
||||
@@ -765,12 +770,12 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
{
|
||||
if (hitSoundOverride != null)
|
||||
{
|
||||
Audio.PlayPredicted(hitSoundOverride, target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(hitSoundOverride, coords, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
playedSound = true;
|
||||
}
|
||||
else if (hitSound != null)
|
||||
{
|
||||
Audio.PlayPredicted(hitSound, target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(hitSound, coords, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
playedSound = true;
|
||||
}
|
||||
}
|
||||
@@ -789,10 +794,10 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
break;
|
||||
// No damage, fallback to tappies
|
||||
case null:
|
||||
Audio.PlayPredicted(new SoundPathSpecifier("/Audio/Weapons/tap.ogg"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(new SoundCollectionSpecifier("WeakHit"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
break;
|
||||
case "Brute":
|
||||
Audio.PlayPredicted(new SoundPathSpecifier("/Audio/Weapons/smash.ogg"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
Audio.PlayPredicted(new SoundCollectionSpecifier("MetalThud"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user