Ambience enhancements. (#7073)

This commit is contained in:
Moony
2022-03-12 16:20:31 -06:00
committed by GitHub
parent 6d2c5868a3
commit f5c92caef4
29 changed files with 290 additions and 68 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared.Audio;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Maps;
@@ -16,6 +17,7 @@ namespace Content.Shared.SubFloor
[Dependency] protected readonly IMapManager MapManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly TrayScannerSystem _trayScannerSystem = default!;
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
public override void Initialize()
{
@@ -181,6 +183,10 @@ namespace Content.Shared.SubFloor
appearance.SetData(SubFloorVisuals.Covered, hideComp.IsUnderCover);
appearance.SetData(SubFloorVisuals.ScannerRevealed, hideComp.RevealedBy.Count != 0);
if (hideComp.BlockAmbience && hideComp.IsUnderCover)
_ambientSoundSystem.SetAmbience(uid, false);
else if (hideComp.BlockAmbience && !hideComp.IsUnderCover)
_ambientSoundSystem.SetAmbience(uid, true);
}
}