Require plants to be harvestable before sampling (#24851)

This commit is contained in:
Kevin Zheng
2024-02-13 14:05:28 -08:00
committed by GitHub
parent 78392e6d89
commit 52f74fa39d
2 changed files with 9 additions and 1 deletions

View File

@@ -262,13 +262,20 @@ public sealed class PlantHolderSystem : EntitySystem
return; 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; component.Seed.Unique = false;
var seed = _botany.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates, args.User); var seed = _botany.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates, args.User);
_randomHelper.RandomOffset(seed, 0.25f); _randomHelper.RandomOffset(seed, 0.25f);
var displayName = Loc.GetString(component.Seed.DisplayName); var displayName = Loc.GetString(component.Seed.DisplayName);
_popup.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message", _popup.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message",
("seedName", displayName)), args.User); ("seedName", displayName)), args.User);
component.Health -= (_random.Next(3, 5) * 10);
if (component.Seed != null && component.Seed.CanScream) if (component.Seed != null && component.Seed.CanScream)
{ {

View 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-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-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-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.