]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Require plants to be harvestable before sampling (#24851)
authorKevin Zheng <kevinz5000@gmail.com>
Tue, 13 Feb 2024 22:05:28 +0000 (14:05 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 22:05:28 +0000 (17:05 -0500)
Content.Server/Botany/Systems/PlantHolderSystem.cs
Resources/Locale/en-US/botany/components/plant-holder-component.ftl

index 6bf0b9692ced63da4e017b4f0c1077a29109b3ae..601dca36856e6fa14c34c1a75bc44d3a05ba67a4 100644 (file)
@@ -262,13 +262,20 @@ public sealed class PlantHolderSystem : EntitySystem
                 return;
             }
 
+            component.Health -= (_random.Next(3, 5) * 10);
+
+            if (!component.Harvest)
+            {
+                _popup.PopupCursor(Loc.GetString("plant-holder-component-early-sample"), args.User);
+                return;
+            }
+
             component.Seed.Unique = false;
             var seed = _botany.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates, args.User);
             _randomHelper.RandomOffset(seed, 0.25f);
             var displayName = Loc.GetString(component.Seed.DisplayName);
             _popup.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message",
                 ("seedName", displayName)), args.User);
-            component.Health -= (_random.Next(3, 5) * 10);
 
             if (component.Seed != null && component.Seed.CanScream)
             {
index 1e7dbe689ccdf37531d698a54ccebbea8318d1db..01d713ab34e435e9a6e43a4ede9c23c70470ab21 100644 (file)
@@ -32,3 +32,4 @@ plant-holder-component-light-improper-warning = The [color=yellow]improper light
 plant-holder-component-heat-improper-warning = The [color=orange]improper temperature level alert[/color] is blinking.
 plant-holder-component-pressure-improper-warning = The [color=lightblue]improper environment pressure alert[/color] is blinking.
 plant-holder-component-gas-missing-warning = The [color=cyan]improper gas environment alert[/color] is blinking.
+plant-holder-component-early-sample = It is not ready to sample, but you cut a bit of the plant anyway.