Skip to content

Commit

Permalink
temp disable damage sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Oct 19, 2024
1 parent 2a3315f commit 6f9da7a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Content.Server/Mech/Systems/MechSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,12 @@ private void OnMechExit(EntityUid uid, MechComponent component, MechExitEvent ar

private void OnDamageChanged(EntityUid uid, MechComponent component, DamageChangedEvent args)
{
/*
if (TryComp<DamageableComponent>(uid, out var damage))
{
PlayCritSound(uid, component, damage);
}
*/
if (args.DamageIncreased &&
args.DamageDelta != null &&
component.PilotSlot.ContainedEntity != null)
Expand All @@ -295,12 +297,12 @@ private void PlayCritSound(EntityUid uid, MechComponent component, DamageableCom
var damagePercentage = (total / critThreshold) * 100;
if (component.PilotSlot.ContainedEntity != null)
{
if (damagePercentage <= 50)
_audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert50), component.PilotSlot.ContainedEntity.Value);
if (damagePercentage <= 75)
_audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert25), component.PilotSlot.ContainedEntity.Value);
if (damagePercentage <= 95)
if (damagePercentage >= 95)
_audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert5), component.PilotSlot.ContainedEntity.Value);
else if (damagePercentage >= 75)
_audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert25), component.PilotSlot.ContainedEntity.Value);
else if (damagePercentage >= 50)
_audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert50), component.PilotSlot.ContainedEntity.Value);
Dirty(uid ,component);
}
}
Expand Down

0 comments on commit 6f9da7a

Please sign in to comment.