diff --git a/Content.Server/Fluids/Components/PuddleComponent.cs b/Content.Server/Fluids/Components/PuddleComponent.cs index d9cf371e5e..5e91c23238 100644 --- a/Content.Server/Fluids/Components/PuddleComponent.cs +++ b/Content.Server/Fluids/Components/PuddleComponent.cs @@ -7,7 +7,6 @@ using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reagent; using Content.Shared.Directions; -using Content.Shared.Examine; using Content.Shared.Maps; using Content.Shared.Physics; using Content.Shared.Slippery; @@ -16,14 +15,12 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.Fluids.Components @@ -32,7 +29,7 @@ namespace Content.Server.Fluids.Components /// Puddle on a floor /// [RegisterComponent] - public class PuddleComponent : Component, IExamine, IMapInit + public class PuddleComponent : Component, IMapInit { // Current design: Something calls the SpillHelper.Spill, that will either // A) Add to an existing puddle at the location (normalised to tile-center) or @@ -120,8 +117,6 @@ namespace Content.Server.Fluids.Components [DataField("state")] private string _spriteState = "puddle"; - private bool Slippery => Owner.TryGetComponent(out SlipperyComponent? slippery) && slippery.Slippery; - private Solution? PuddleSolution => EntitySystem.Get().EnsureSolution(Owner, DefaultSolutionName); protected override void Initialize() @@ -152,14 +147,6 @@ namespace Content.Server.Fluids.Components _spriteComponent.Rotation = Angle.FromDegrees(robustRandom.Next(0, 359)); } - void IExamine.Examine(FormattedMessage message, bool inDetailsRange) - { - if (Slippery) - { - message.AddText(Loc.GetString("puddle-component-examine-is-slipper-text")); - } - } - /// /// Whether adding this solution to this puddle would overflow. /// diff --git a/Content.Server/Fluids/PuddleSystem.cs b/Content.Server/Fluids/PuddleSystem.cs index e4ae3aee5a..e10569a533 100644 --- a/Content.Server/Fluids/PuddleSystem.cs +++ b/Content.Server/Fluids/PuddleSystem.cs @@ -1,7 +1,10 @@ using Content.Server.Fluids.Components; +using Content.Shared.Examine; +using Content.Shared.Slippery; using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Localization; using Robust.Shared.Map; namespace Content.Server.Fluids @@ -15,6 +18,8 @@ namespace Content.Server.Fluids { base.Initialize(); _mapManager.TileChanged += HandleTileChanged; + + SubscribeLocalEvent(HandlePuddleExamined); } public override void Shutdown() @@ -23,6 +28,14 @@ namespace Content.Server.Fluids _mapManager.TileChanged -= HandleTileChanged; } + private void HandlePuddleExamined(EntityUid uid, PuddleComponent component, ExaminedEvent args) + { + if (ComponentManager.TryGetComponent(uid, out var slippery) && slippery.Slippery) + { + args.Message.AddText(Loc.GetString("puddle-component-examine-is-slipper-text")); + } + } + //TODO: Replace all this with an Unanchored event that deletes the puddle private void HandleTileChanged(object? sender, TileChangedEventArgs eventArgs) {