* Power stuff - Add shared IsPowered - Add shared ResolveApc - Move PowerChangedEvent to shared for now - Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it. * big update * boing
28 lines
886 B
C#
28 lines
886 B
C#
using Content.Server.Power.Components;
|
|
using Content.Server.Power.EntitySystems;
|
|
using Content.Shared.Audio;
|
|
using Content.Shared.Mobs;
|
|
using Content.Shared.Power;
|
|
|
|
namespace Content.Server.Audio;
|
|
|
|
public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerChangedEvent>(HandlePowerChange);
|
|
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerNetBatterySupplyEvent>(HandlePowerSupply);
|
|
}
|
|
|
|
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, ref PowerNetBatterySupplyEvent args)
|
|
{
|
|
SetAmbience(uid, args.Supply);
|
|
}
|
|
|
|
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, ref PowerChangedEvent args)
|
|
{
|
|
SetAmbience(uid, args.Powered);
|
|
}
|
|
}
|