Change plant clipping mechanics (#25326)

Make seeds from clipped plants inherit the decreased health from parents.
Also require one growth stage before clipping.
This commit is contained in:
Flesh
2024-02-17 06:02:12 +01:00
committed by GitHub
parent 95c9500630
commit dab2c48849
4 changed files with 34 additions and 9 deletions

View File

@@ -104,11 +104,12 @@ public sealed partial class BotanySystem : EntitySystem
/// <summary>
/// Spawns a new seed packet on the floor at a position, then tries to put it in the user's hands if possible.
/// </summary>
public EntityUid SpawnSeedPacket(SeedData proto, EntityCoordinates coords, EntityUid user)
public EntityUid SpawnSeedPacket(SeedData proto, EntityCoordinates coords, EntityUid user, float? healthOverride = null)
{
var seed = Spawn(proto.PacketPrototype, coords);
var seedComp = EnsureComp<SeedComponent>(seed);
seedComp.Seed = proto;
seedComp.HealthOverride = healthOverride;
var name = Loc.GetString(proto.Name);
var noun = Loc.GetString(proto.Noun);