From 9059185efee505109e7d7d58e956685530713968 Mon Sep 17 00:00:00 2001 From: Kara Date: Fri, 12 May 2023 18:32:57 -0700 Subject: [PATCH] Puddle drinking (#16373) --- Content.Server/Nutrition/Components/DrinkComponent.cs | 1 + Content.Server/Nutrition/EntitySystems/DrinkSystem.cs | 4 ++-- Resources/Prototypes/Entities/Effects/puddle.yml | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Content.Server/Nutrition/Components/DrinkComponent.cs b/Content.Server/Nutrition/Components/DrinkComponent.cs index 7bc1913fe2..664e648474 100644 --- a/Content.Server/Nutrition/Components/DrinkComponent.cs +++ b/Content.Server/Nutrition/Components/DrinkComponent.cs @@ -21,6 +21,7 @@ namespace Content.Server.Nutrition.Components internal bool DefaultToOpened; [ViewVariables(VVAccess.ReadWrite)] + [DataField("transferAmount")] public FixedPoint2 TransferAmount { get; [UsedImplicitly] private set; } = FixedPoint2.New(5); [ViewVariables(VVAccess.ReadWrite)] diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index 71fb0a2fcf..d045926170 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -155,7 +155,7 @@ namespace Content.Server.Nutrition.EntitySystems if (component.Pressurized && !component.Opened && _random.Prob(0.25f) && - _solutionContainerSystem.TryGetDrainableSolution(uid, out var interactions)) + _solutionContainerSystem.TryGetSolution(uid, component.SolutionName, out var interactions)) { component.Opened = true; UpdateAppearance(component); @@ -229,7 +229,7 @@ namespace Content.Server.Nutrition.EntitySystems return true; } - if (!_solutionContainerSystem.TryGetDrainableSolution(item, out var drinkSolution) || + if (!_solutionContainerSystem.TryGetSolution(item, drink.SolutionName, out var drinkSolution) || drinkSolution.Volume <= 0) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", diff --git a/Resources/Prototypes/Entities/Effects/puddle.yml b/Resources/Prototypes/Entities/Effects/puddle.yml index cecfb2f941..ebdbdbf046 100644 --- a/Resources/Prototypes/Entities/Effects/puddle.yml +++ b/Resources/Prototypes/Entities/Effects/puddle.yml @@ -116,3 +116,8 @@ puddle: !type:SpreaderNode nodeGroupID: Spreader + - type: Drink + isOpen: true + delay: 3 + transferAmount: 1 + solution: puddle -- 2.51.2