From 9443cb1d25d9bfb7ce724db306b905288dc15352 Mon Sep 17 00:00:00 2001 From: Slava0135 <40753025+Slava0135@users.noreply.github.com> Date: Sat, 5 Aug 2023 14:44:18 +0300 Subject: [PATCH] Add splash spill effect (#18536) --- Content.Server/Fluids/EntitySystems/PuddleSystem.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index fe549fc2e0..387997927c 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -29,6 +29,7 @@ using Robust.Shared.Timing; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; using Content.Shared.Maps; +using Content.Shared.Effects; namespace Content.Server.Fluids.EntitySystems; @@ -495,6 +496,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem if (solution.Volume == 0) return false; + var targets = new List(); // Get reactive entities nearby--if there are some, it'll spill a bit on them instead. foreach (var ent in _lookup.GetComponentsInRange(coordinates, 1.0f)) { @@ -511,10 +513,13 @@ public sealed partial class PuddleSystem : SharedPuddleSystem $"{ToPrettyString(user.Value):user} threw {ToPrettyString(uid):entity} which splashed a solution {SolutionContainerSystem.ToPrettyString(solution):solution} onto {ToPrettyString(owner):target}"); } + targets.Add(owner); _reactive.DoEntityReaction(owner, splitSolution, ReactionMethod.Touch); _popups.PopupEntity(Loc.GetString("spill-land-spilled-on-other", ("spillable", uid), ("target", Identity.Entity(owner, EntityManager))), owner, PopupType.SmallCaution); } + RaiseNetworkEvent(new ColorFlashEffectEvent(solution.GetColor(_prototypeManager), targets), Filter.Pvs(uid, entityManager: EntityManager)); + return TrySpillAt(coordinates, solution, out puddleUid, sound); }