Minor botany tweaks (#18832)

* Make the water consumption actually influenced by the seed's water consumption value

* Tweak default water and nutrient consumption

* Composting plants works now

* Tweak seeds YML, add ez nutrient bottle to Nutrimax

* Increase default nutrient consumption a bit
This commit is contained in:
Doru991
2023-08-08 03:29:59 +03:00
committed by GitHub
parent 8187e00072
commit 67e2f3799f
5 changed files with 61 additions and 30 deletions

View File

@@ -42,7 +42,7 @@ namespace Content.Server.Botany.Systems
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
public const float HydroponicsSpeedMultiplier = 1f;
public const float HydroponicsConsumptionMultiplier = 4f;
public const float HydroponicsConsumptionMultiplier = 2f;
public override void Initialize()
{
@@ -288,11 +288,17 @@ namespace Content.Server.Botany.Systems
if (_solutionSystem.TryGetSolution(args.Used, produce.SolutionName, out var solution2))
{
// This deliberately discards overfill.
_solutionSystem.TryAddSolution(args.Used, solution2,
_solutionSystem.SplitSolution(args.Used, solution2, solution2.Volume));
if (_solutionSystem.TryGetSolution(uid, component.SoilSolutionName, out var solution1))
{
// We try to fit as much of the composted plant's contained solution into the hydroponics tray as we can,
// since the plant will be consumed anyway.
ForceUpdateByExternalCause(uid, component);
var fillAmount = FixedPoint2.Min(solution2.Volume, solution1.AvailableVolume);
_solutionSystem.TryAddSolution(uid, solution1,
_solutionSystem.SplitSolution(args.Used, solution2, fillAmount));
ForceUpdateByExternalCause(uid, component);
}
}
EntityManager.QueueDeleteEntity(args.Used);
@@ -412,7 +418,7 @@ namespace Content.Server.Botany.Systems
if (component.Seed.WaterConsumption > 0 && component.WaterLevel > 0 && _random.Prob(0.75f))
{
component.WaterLevel -= MathF.Max(0f,
component.Seed.NutrientConsumption * HydroponicsConsumptionMultiplier * HydroponicsSpeedMultiplier);
component.Seed.WaterConsumption * HydroponicsConsumptionMultiplier * HydroponicsSpeedMultiplier);
if (component.DrawWarnings)
component.UpdateSpriteAfterUpdate = true;
}