CatStation/Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Whatstone 7c7544e014
Add the ability for ghosts to extinguish candles. (#44810)
* SpookyExtinguish, oooooo

* comments, intensity

* Use allowedIntensity in GhostSystem

* commento-stuffed

* GhostComponent: return to BooCount for sanity

* unindento

* fix ghost component, dependency order (holy shit)

* More cleanup than feature at this point

* Add partial to PoweredLightSystem

* event field order, ghost system comments

* Separate spooky, consistency w.r.t. DoGhostEvent

* BooActionEvent handler to GhostSystem.Boo, fix ext

* featuring kenny blankenship and vic romano

* fix maximum value

* Fix BooIntensity comment

* remove whitespace

* comments, RevenantSystem: set handled

* "for a typical ghost"

* Address PR suggestions

* Use Handled, SpookyLight: BooIntensity->Intensity

* Use Handled in BooActionEvent handler, update name

* remove query

* address beck-thompson's requested changes + Handled

* ResponseIntensity setter, private Handled setter

* Check Handled, not !Handled

* there is a third

* the hell was this using placement

* Obsolete Extinguish, Try with Entity<T>

* why wasn't this using TimeOffsetSerializer

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
2026-08-04 05:15:17 +00:00

21 lines
689 B
C#

using Content.Shared.Light.Components;
using Content.Shared.Light.EntitySystems;
namespace Content.Server.Light.EntitySystems;
/// <inheritdoc/>
public sealed partial class PoweredLightSystem : SharedPoweredLightSystem
{
[SubscribeLocalEvent]
private void OnMapInit(Entity<PoweredLightComponent> ent, ref MapInitEvent args)
{
// TODO: Use ContainerFill dog
if (ent.Comp.HasLampOnSpawn != null)
{
var entity = Spawn(ent.Comp.HasLampOnSpawn, Transform(ent).Coordinates);
ContainerSystem.Insert(entity, ent.Comp.LightBulbContainer);
}
// need this to update visualizers
UpdateLight(ent, ent.Comp);
}
}