Lights now go CLUNK when turned on.
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
|
using System;
|
||||||
using SS14.Server.GameObjects;
|
using SS14.Server.GameObjects;
|
||||||
|
using SS14.Server.GameObjects.EntitySystems;
|
||||||
|
using SS14.Shared.Audio;
|
||||||
using SS14.Shared.Enums;
|
using SS14.Shared.Enums;
|
||||||
using SS14.Shared.GameObjects;
|
using SS14.Shared.GameObjects;
|
||||||
|
using SS14.Shared.Interfaces.GameObjects;
|
||||||
|
using SS14.Shared.Interfaces.Timing;
|
||||||
|
using SS14.Shared.IoC;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Power
|
namespace Content.Server.GameObjects.Components.Power
|
||||||
{
|
{
|
||||||
@@ -8,6 +14,10 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
{
|
{
|
||||||
public override string Name => "PoweredLight";
|
public override string Name => "PoweredLight";
|
||||||
|
|
||||||
|
private static readonly TimeSpan _thunkDelay = TimeSpan.FromSeconds(2);
|
||||||
|
|
||||||
|
private TimeSpan _lastThunk;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -21,6 +31,12 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "on");
|
sprite.LayerSetState(0, "on");
|
||||||
light.State = LightState.On;
|
light.State = LightState.On;
|
||||||
|
var time = IoCManager.Resolve<IGameTiming>().CurTime;
|
||||||
|
if (time > _lastThunk + _thunkDelay)
|
||||||
|
{
|
||||||
|
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AudioSystem>()
|
||||||
|
.Play("/Audio/machines/light_tube_on.ogg", Owner, AudioParams.Default.WithVolume(-10f));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user