Make the sentient plant mutation non-copyable to other plantholders (#29133)

make the sentient plant mutation not propagate by clipping, using the seed extractor or cryoxadone
This commit is contained in:
slarticodefast
2024-08-11 19:23:14 +10:00
committed by Spatison
parent 2895e89e16
commit d24b6bf894
3 changed files with 32 additions and 9 deletions

View File

@@ -45,12 +45,19 @@ public sealed class SeedExtractorSystem : EntitySystem
var amount = (int) _random.NextFloat(seedExtractor.BaseMinSeeds, seedExtractor.BaseMaxSeeds + 1) * seedExtractor.SeedAmountMultiplier;
var coords = Transform(uid).Coordinates;
var packetSeed = seed;
if (packetSeed.Sentient)
{
if (!packetSeed.Unique) // clone if necessary before modifying the seed
packetSeed = packetSeed.Clone();
packetSeed.Sentient = false; // remove Sentient to avoid ghost role spam
}
if (amount > 1)
seed.Unique = false;
packetSeed.Unique = false;
for (var i = 0; i < amount; i++)
{
_botanySystem.SpawnSeedPacket(seed, coords, args.User);
_botanySystem.SpawnSeedPacket(packetSeed, coords, args.User);
}
}