From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Tue, 16 Dec 2025 23:30:15 +0000 (-0800) Subject: Prevent Vestine and all other Botany chemicals from affecting all seeds. (#41883) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4aa7a963dc3dcebd4813f9d1e28b10c22f1402e6;p=space-station-14.git Prevent Vestine and all other Botany chemicals from affecting all seeds. (#41883) * EnsureUniqueSeed * mfw * aaaaaaaaaaaaa --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs index d5f331c157..3959ffc47f 100644 --- a/Content.Server/Botany/Systems/PlantHolderSystem.cs +++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs @@ -53,6 +53,7 @@ public sealed class PlantHolderSystem : EntitySystem public const float HydroponicsSpeedMultiplier = 1f; public const float HydroponicsConsumptionMultiplier = 2f; + public readonly FixedPoint2 PlantMetabolismRate = FixedPoint2.New(1); private static readonly ProtoId HoeTag = "Hoe"; private static readonly ProtoId PlantSampleTakerTag = "PlantSampleTaker"; @@ -885,13 +886,18 @@ public sealed class PlantHolderSystem : EntitySystem if (solution.Volume > 0 && component.MutationLevel < 25) { - foreach (var entry in component.SoilSolution.Value.Comp.Solution.Contents) + // Don't apply any effects to a non-unique seed ever! Remove this when botany code is sane... + EnsureUniqueSeed(uid, component); + foreach (var entry in solution.Contents) { + if (entry.Quantity < PlantMetabolismRate) + continue; + var reagentProto = _prototype.Index(entry.Reagent.Prototype); - _entityEffects.ApplyEffects(uid, reagentProto.PlantMetabolisms.ToArray(), entry.Quantity.Float()); + _entityEffects.ApplyEffects(uid, reagentProto.PlantMetabolisms.ToArray(), entry.Quantity); } - _solutionContainerSystem.RemoveEachReagent(component.SoilSolution.Value, FixedPoint2.New(1)); + _solutionContainerSystem.RemoveEachReagent(component.SoilSolution.Value, PlantMetabolismRate); } CheckLevelSanity(uid, component); diff --git a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantAdjustPotencyEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantAdjustPotencyEntityEffectSystem.cs index ebe5c83181..f63d49f209 100644 --- a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantAdjustPotencyEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantAdjustPotencyEntityEffectSystem.cs @@ -7,13 +7,11 @@ namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes; public sealed partial class PlantAdjustPotencyEntityEffectSystem : EntityEffectSystem { - [Dependency] private readonly PlantHolderSystem _plantHolder = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) { if (entity.Comp.Seed == null || entity.Comp.Dead) return; - _plantHolder.EnsureUniqueSeed(entity, entity.Comp); entity.Comp.Seed.Potency = Math.Max(entity.Comp.Seed.Potency + args.Effect.Amount, 1); } } diff --git a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDestroySeedsEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDestroySeedsEntityEffectSystem.cs index 1661c501be..5139c43c0f 100644 --- a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDestroySeedsEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDestroySeedsEntityEffectSystem.cs @@ -9,7 +9,6 @@ namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes; public sealed partial class PlantDestroySeedsEntityEffectSystem : EntityEffectSystem { - [Dependency] private readonly PlantHolderSystem _plantHolder = default!; [Dependency] private readonly PopupSystem _popup = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) @@ -20,7 +19,6 @@ public sealed partial class PlantDestroySeedsEntityEffectSystem : EntityEffectSy if (entity.Comp.Seed.Seedless) return; - _plantHolder.EnsureUniqueSeed(entity, entity.Comp); _popup.PopupEntity( Loc.GetString("botany-plant-seedsdestroyed"), entity, diff --git a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDiethylamineEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDiethylamineEntityEffectSystem.cs index f6aebde465..4da542df93 100644 --- a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDiethylamineEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantDiethylamineEntityEffectSystem.cs @@ -9,7 +9,6 @@ namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes; public sealed partial class PlantDiethylamineEntityEffectSystem : EntityEffectSystem { [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly PlantHolderSystem _plantHolder = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) { @@ -18,13 +17,11 @@ public sealed partial class PlantDiethylamineEntityEffectSystem : EntityEffectSy if (_random.Prob(0.1f)) { - _plantHolder.EnsureUniqueSeed(entity, entity); entity.Comp.Seed!.Lifespan++; } if (_random.Prob(0.1f)) { - _plantHolder.EnsureUniqueSeed(entity, entity); entity.Comp.Seed!.Endurance++; } } diff --git a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantRestoreSeedsEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantRestoreSeedsEntityEffectSystem.cs index 4d724be244..a120a1eccd 100644 --- a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantRestoreSeedsEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/PlantRestoreSeedsEntityEffectSystem.cs @@ -8,7 +8,6 @@ namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes; public sealed partial class PlantRestoreSeedsEntityEffectSystem : EntityEffectSystem { - [Dependency] private readonly PlantHolderSystem _plantHolder = default!; [Dependency] private readonly PopupSystem _popup = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) @@ -19,7 +18,6 @@ public sealed partial class PlantRestoreSeedsEntityEffectSystem : EntityEffectSy if (!entity.Comp.Seed.Seedless) return; - _plantHolder.EnsureUniqueSeed(entity, entity.Comp); _popup.PopupEntity(Loc.GetString("botany-plant-seedsrestored"), entity); entity.Comp.Seed.Seedless = false; } diff --git a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/RobustHarvestEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/RobustHarvestEntityEffectSystem.cs index 68ea3319ef..a957de82b4 100644 --- a/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/RobustHarvestEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/Botany/PlantAttributes/RobustHarvestEntityEffectSystem.cs @@ -14,7 +14,6 @@ namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes; public sealed partial class RobustHarvestEntityEffectSystem : EntityEffectSystem { [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly PlantHolderSystem _plantHolder = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) { @@ -23,7 +22,6 @@ public sealed partial class RobustHarvestEntityEffectSystem : EntityEffectSystem if (entity.Comp.Seed.Potency < args.Effect.PotencyLimit) { - _plantHolder.EnsureUniqueSeed(entity, entity.Comp); entity.Comp.Seed.Potency = Math.Min(entity.Comp.Seed.Potency + args.Effect.PotencyIncrease, args.Effect.PotencyLimit); if (entity.Comp.Seed.Potency > args.Effect.PotencySeedlessThreshold) @@ -34,7 +32,6 @@ public sealed partial class RobustHarvestEntityEffectSystem : EntityEffectSystem else if (entity.Comp.Seed.Yield > 1 && _random.Prob(0.1f)) { // Too much of a good thing reduces yield - _plantHolder.EnsureUniqueSeed(entity, entity.Comp); entity.Comp.Seed.Yield--; } } diff --git a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs index a995ef90f4..bc168521f8 100644 --- a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs +++ b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs @@ -211,7 +211,7 @@ namespace Content.Shared.Chemistry.Reaction _adminLogger.Add(LogType.ChemicalReaction, reaction.Impact, $"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(soln):metabolizer} at Pos:{(posFound ? $"{gridPos:coordinates}" : "[Grid or Map not Found]")}"); - _entityEffects.ApplyEffects(soln, reaction.Effects, unitReactions.Float()); + _entityEffects.ApplyEffects(soln, reaction.Effects, unitReactions); // Someday, some brave soul will thread through an optional actor // argument in from every call of OnReaction up, all just to pass diff --git a/Content.Shared/EntityEffects/SharedEntityEffectsSystem.cs b/Content.Shared/EntityEffects/SharedEntityEffectsSystem.cs index 8270f8bf7c..2da23a2502 100644 --- a/Content.Shared/EntityEffects/SharedEntityEffectsSystem.cs +++ b/Content.Shared/EntityEffects/SharedEntityEffectsSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Administration.Logs; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Reaction; using Content.Shared.EntityConditions; +using Content.Shared.FixedPoint; using Content.Shared.Random.Helpers; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -58,6 +59,12 @@ public sealed partial class SharedEntityEffectsSystem : EntitySystem, IEntityEff } } + /// + public void ApplyEffects(EntityUid target, EntityEffect[] effects, FixedPoint2 scale, EntityUid? user = null) + { + ApplyEffects(target, effects, scale.Float()); + } + /// /// Applies a list of entity effects to a target entity. ///