Puddles & spreader refactor (#15191)

This commit is contained in:
metalgearsloth
2023-04-10 15:37:03 +10:00
committed by GitHub
parent 3178ab83f6
commit 317a4013eb
141 changed files with 3046 additions and 3201 deletions

View File

@@ -9,6 +9,7 @@ using Content.Server.Popups;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Components;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Database;
using Content.Shared.DoAfter;
@@ -44,7 +45,7 @@ namespace Content.Server.Nutrition.EntitySystems
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly SpillableSystem _spillableSystem = default!;
[Dependency] private readonly PuddleSystem _puddleSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
@@ -85,7 +86,7 @@ namespace Content.Server.Nutrition.EntitySystems
args.Message.AddMarkup($"\n{Loc.GetString("drink-component-on-examine-details-text", ("colorName", color), ("text", openedText))}");
if (!IsEmpty(uid, component))
{
if (TryComp<ExaminableSolutionComponent>(component.Owner, out var comp))
if (TryComp<ExaminableSolutionComponent>(uid, out var comp))
{
//provide exact measurement for beakers
args.Message.AddMarkup($" - {Loc.GetString("drink-component-on-examine-exact-volume", ("amount", _solutionContainerSystem.DrainAvailable(uid)))}");
@@ -160,7 +161,7 @@ namespace Content.Server.Nutrition.EntitySystems
UpdateAppearance(component);
var solution = _solutionContainerSystem.Drain(uid, interactions, interactions.Volume);
_spillableSystem.SpillAt(uid, solution, "PuddleSmear");
_puddleSystem.TrySpillAt(uid, solution, out _);
_audio.PlayPvs(_audio.GetSound(component.BurstSound), uid, AudioParams.Default.WithVolume(-4));
}
@@ -314,7 +315,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (HasComp<RefillableSolutionComponent>(args.Args.Target.Value))
{
_spillableSystem.SpillAt(args.Args.User, drained, "PuddleSmear");
_puddleSystem.TrySpillAt(args.Args.User, drained, out _);
args.Handled = true;
return;
}
@@ -334,7 +335,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (forceDrink)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough-other"), args.Args.Target.Value, args.Args.User);
_spillableSystem.SpillAt(args.Args.Target.Value, drained, "PuddleSmear");
_puddleSystem.TrySpillAt(args.Args.Target.Value, drained, out _);
}
else
_solutionContainerSystem.TryAddSolution(uid, solution, drained);