Crematorium now makes a noise on start and during cremation (#4459)

This commit is contained in:
Swept
2021-08-11 19:29:57 -07:00
committed by GitHub
parent 637053e843
commit 0efcbf4061
2 changed files with 7 additions and 1 deletions

View File

@@ -35,13 +35,15 @@ namespace Content.Server.Morgue.Components
{
public override string Name => "CrematoriumEntityStorage";
[DataField("cremateStartSound")] private SoundSpecifier _cremateStartSound = new SoundPathSpecifier("/Audio/Items/lighter1.ogg");
[DataField("crematingSound")] private SoundSpecifier _crematingSound = new SoundPathSpecifier("/Audio/Effects/burning.ogg");
[DataField("cremateFinishSound")] private SoundSpecifier _cremateFinishSound = new SoundPathSpecifier("/Audio/Machines/ding.ogg");
[ViewVariables]
public bool Cooking { get; private set; }
[ViewVariables(VVAccess.ReadWrite)]
private int _burnMilis = 3000;
private int _burnMilis = 5000;
private CancellationTokenSource? _cremateCancelToken;
@@ -83,6 +85,8 @@ namespace Content.Server.Morgue.Components
if (Cooking) return;
if (Open) return;
SoundSystem.Play(Filter.Pvs(Owner), _cremateStartSound.GetSound(), Owner);
Cremate();
}
@@ -94,6 +98,8 @@ namespace Content.Server.Morgue.Components
Appearance?.SetData(CrematoriumVisuals.Burning, true);
Cooking = true;
SoundSystem.Play(Filter.Pvs(Owner), _crematingSound.GetSound(), Owner);
_cremateCancelToken?.Cancel();
_cremateCancelToken = new CancellationTokenSource();