CatStation/Content.Server/Ghost/GhostBooEvent.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

38 lines
1.2 KiB
C#

using Content.Shared.Ghost.Components;
namespace Content.Server.Ghost;
/// <summary>
/// A targeted event raised to cause spooky events (e.g. flickering lights).
/// </summary>
/// <remarks>
/// Most frequently used by ghosts to haunt an area, hence the name.
/// </remarks>
[ByRefEvent]
public struct GhostBooEvent(GhostBooIntensity allowedIntensity)
{
/// <summary>
/// The maximum level of intensity that the caller will allow.
/// </summary>
public readonly GhostBooIntensity AllowedIntensity = allowedIntensity;
/// <summary>
/// The type of action that was performed, if any.
/// Should only be set by handling entities if something happened.
/// </summary>
public GhostBooIntensity ResponseIntensity { get; private set; } = GhostBooIntensity.None;
/// <summary>
/// Whether or not the event has been handled already.
/// </summary>
public bool Handled { get; private set; }
/// <summary>
/// Sets both the handled status of this event and the intensity of its response.
/// </summary>
public void SetResponseIntensity(GhostBooIntensity intensity)
{
Handled = true;
ResponseIntensity = intensity;
}
}