diff --git a/Content.Server/StationEvents/Components/ImmovableRodRuleComponent.cs b/Content.Server/StationEvents/Components/ImmovableRodRuleComponent.cs index 95c3265207..7b35dd9a14 100644 --- a/Content.Server/StationEvents/Components/ImmovableRodRuleComponent.cs +++ b/Content.Server/StationEvents/Components/ImmovableRodRuleComponent.cs @@ -1,4 +1,5 @@ using Content.Server.StationEvents.Events; +using Content.Shared.Storage; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -7,6 +8,8 @@ namespace Content.Server.StationEvents.Components; [RegisterComponent, Access(typeof(ImmovableRodRule))] public sealed partial class ImmovableRodRuleComponent : Component { - [DataField("rodPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string RodPrototype = "ImmovableRodKeepTilesStill"; + /// List of possible rods and spawn probabilities. + /// + [DataField] + public List RodPrototypes = new(); } diff --git a/Content.Server/StationEvents/Events/ImmovableRodRule.cs b/Content.Server/StationEvents/Events/ImmovableRodRule.cs index a61c6b69e1..1b8fb6be1f 100644 --- a/Content.Server/StationEvents/Events/ImmovableRodRule.cs +++ b/Content.Server/StationEvents/Events/ImmovableRodRule.cs @@ -3,9 +3,11 @@ using Content.Server.GameTicking.Rules.Components; using Content.Server.ImmovableRod; using Content.Server.StationEvents.Components; using Content.Server.Weapons.Ranged.Systems; -using Robust.Shared.Spawners; +using Content.Shared.Storage; using Robust.Shared.Prototypes; +using Robust.Shared.Random; using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent; +using System.Linq; namespace Content.Server.StationEvents.Events; @@ -19,7 +21,10 @@ public sealed class ImmovableRodRule : StationEventSystem(component.RodPrototype); + var protoName = EntitySpawnCollection.GetSpawns(component.RodPrototypes).First(); + + var proto = _prototypeManager.Index(protoName); + if (proto.TryGetComponent(out var rod) && proto.TryGetComponent(out var despawn)) { TryFindRandomTile(out _, out _, out _, out var targetCoords); @@ -27,12 +32,12 @@ public sealed class ImmovableRodRule : StationEventSystem