]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
move gamerule components to shared (#28572)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Tue, 4 Jun 2024 11:53:24 +0000 (11:53 +0000)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2024 11:53:24 +0000 (21:53 +1000)
* move MinMax to shared

* cleanup MinMax

* move other ticking components to shared just because

* remove unused prototype file

* update everything to use shared components

* test

* test 2

* test 3

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
61 files changed:
Content.IntegrationTests/Tests/Destructible/DestructibleDestructionTest.cs
Content.IntegrationTests/Tests/GameRules/FailAndStartPresetTest.cs
Content.IntegrationTests/Tests/GameRules/RuleMaxTimeRestartTest.cs
Content.Server/Administration/ServerApi.cs
Content.Server/Antag/AntagSelectionSystem.cs
Content.Server/Antag/Components/AntagSelectionComponent.cs
Content.Server/Antag/MobReplacementRuleSystem.cs
Content.Server/Destructible/Thresholds/Behaviors/SpawnEntitiesBehavior.cs
Content.Server/Destructible/Thresholds/MinMax.cs [deleted file]
Content.Server/GameTicking/GameTicker.GameRule.cs
Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs
Content.Server/GameTicking/Rules/GameRulePrototype.cs [deleted file]
Content.Server/GameTicking/Rules/GameRuleSystem.Utility.cs
Content.Server/GameTicking/Rules/GameRuleSystem.cs
Content.Server/GameTicking/Rules/InactivityTimeRestartRuleSystem.cs
Content.Server/GameTicking/Rules/KillCalloutRuleSystem.cs
Content.Server/GameTicking/Rules/LoadMapRuleSystem.cs
Content.Server/GameTicking/Rules/MaxTimeRestartRuleSystem.cs
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Content.Server/GameTicking/Rules/RespawnRuleSystem.cs
Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Content.Server/GameTicking/Rules/RoundstartStationVariationRuleSystem.cs
Content.Server/GameTicking/Rules/SandboxRuleSystem.cs
Content.Server/GameTicking/Rules/SecretRuleSystem.cs
Content.Server/GameTicking/Rules/SubGamemodesSystem.cs
Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Content.Server/Objectives/ObjectivesSystem.cs
Content.Server/Power/EntitySystems/PowerMonitoringConsoleSystem.cs
Content.Server/Spawners/EntitySystems/ConditionalSpawnerSystem.cs
Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs
Content.Server/StationEvents/Events/AlertLevelInterceptionRule.cs
Content.Server/StationEvents/Events/AnomalySpawnRule.cs
Content.Server/StationEvents/Events/BluespaceArtifactRule.cs
Content.Server/StationEvents/Events/BluespaceLockerRule.cs
Content.Server/StationEvents/Events/BreakerFlipRule.cs
Content.Server/StationEvents/Events/BureaucraticErrorRule.cs
Content.Server/StationEvents/Events/CargoGiftsRule.cs
Content.Server/StationEvents/Events/ClericalErrorRule.cs
Content.Server/StationEvents/Events/FalseAlarmRule.cs
Content.Server/StationEvents/Events/GasLeakRule.cs
Content.Server/StationEvents/Events/ImmovableRodRule.cs
Content.Server/StationEvents/Events/IonStormRule.cs
Content.Server/StationEvents/Events/KudzuGrowthRule.cs
Content.Server/StationEvents/Events/MassHallucinationsRule.cs
Content.Server/StationEvents/Events/MeteorSwarmRule.cs
Content.Server/StationEvents/Events/NinjaSpawnRule.cs
Content.Server/StationEvents/Events/PowerGridCheckRule.cs
Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs
Content.Server/StationEvents/Events/RandomSentienceRule.cs
Content.Server/StationEvents/Events/RandomSpawnRule.cs
Content.Server/StationEvents/Events/SolarFlareRule.cs
Content.Server/StationEvents/Events/StationEventSystem.cs
Content.Server/StationEvents/Events/VentClogRule.cs
Content.Server/StationEvents/Events/VentCrittersRule.cs
Content.Server/StationEvents/RampingStationEventSchedulerSystem.cs
Content.Shared/Destructible/Thresholds/MinMax.cs [new file with mode: 0644]
Content.Shared/GameTicking/Components/ActiveGameRuleComponent.cs [moved from Content.Server/GameTicking/Components/ActiveGameRuleComponent.cs with 67% similarity]
Content.Shared/GameTicking/Components/DelayedStartRuleComponent.cs [moved from Content.Server/GameTicking/Components/DelayedStartRuleComponent.cs with 91% similarity]
Content.Shared/GameTicking/Components/EndedGameRuleComponent.cs [moved from Content.Server/GameTicking/Components/EndedGameRuleComponent.cs with 61% similarity]
Content.Shared/GameTicking/Components/GameRuleComponent.cs [moved from Content.Server/GameTicking/Components/GameRuleComponent.cs with 94% similarity]

index e14a8264678da0e11a1ff2489ad7c2ce4db96107..a50238d8f50d720b4fc6dd1df4b201fae21669c3 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Destructible.Thresholds;
 using Content.Server.Destructible.Thresholds.Behaviors;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
+using Content.Shared.Destructible.Thresholds;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Prototypes;
 using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;
index 1fed226beee5ae08e83696c3c9db58a0e300f60c..09a27c1baea82675cd5eaa51695ffa31c14507b9 100644 (file)
@@ -1,9 +1,9 @@
 #nullable enable
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Presets;
 using Content.Shared.CCVar;
 using Content.Shared.GameTicking;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.GameObjects;
 
 namespace Content.IntegrationTests.Tests.GameRules;
index 20a157e33e83cd2264c29fcd7114bae2f046169b..4708bd10c08a86b08d3ee3127e58222e53486705 100644 (file)
@@ -1,9 +1,9 @@
 using Content.Server.GameTicking;
 using Content.Server.GameTicking.Commands;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Shared.CCVar;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Configuration;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Timing;
index 04fd38598fb2906ca4fbc0e2e06ddeb2347f7c37..d0f23db637b4d892a830e880b5e91bef59dce20a 100644 (file)
@@ -8,13 +8,13 @@ using System.Text.Json.Nodes;
 using System.Threading.Tasks;
 using Content.Server.Administration.Systems;
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Presets;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Maps;
 using Content.Server.RoundEnd;
 using Content.Shared.Administration.Managers;
 using Content.Shared.CCVar;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Prototypes;
 using Robust.Server.ServerStatus;
 using Robust.Shared.Asynchronous;
index 710bb8f3d765c38a8d64b3c0b96b1deb4c844467..52ccb1bd708d312a63ddaf7fdb00d61c35cb7d35 100644 (file)
@@ -2,7 +2,6 @@ using System.Linq;
 using Content.Server.Antag.Components;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.Ghost.Roles;
 using Content.Server.Ghost.Roles.Components;
@@ -15,6 +14,7 @@ using Content.Server.Shuttles.Components;
 using Content.Server.Station.Systems;
 using Content.Shared.Antag;
 using Content.Shared.GameTicking;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Ghost;
 using Content.Shared.Humanoid;
 using Content.Shared.Players;
index f70c27d12f28e5cbbfed88262bad94b9a4415b09..1ab16e8aec8744354811a787cdd7bf2eba792ac3 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Administration.Systems;
-using Content.Server.Destructible.Thresholds;
 using Content.Shared.Antag;
+using Content.Shared.Destructible.Thresholds;
 using Content.Shared.Roles;
 using Content.Shared.Storage;
 using Content.Shared.Whitelist;
index 18837b5a7c873eae085b5b3b351584226199cf41..eeff765d8bb7c8cc472894e4abeb098c51272cbd 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Antag.Mimic;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.GameTicking.Rules.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.VendingMachines;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
index 057b6df9df21b53a658d04cd07922db5d3110618..4ec6fa9e908e56a2b2ee73d0c6ee35079293b35b 100644 (file)
@@ -1,12 +1,12 @@
 using System.Numerics;
 using Content.Server.Forensics;
 using Content.Server.Stack;
+using Content.Shared.Destructible.Thresholds;
 using Content.Shared.Prototypes;
 using Content.Shared.Stacks;
 using Robust.Server.GameObjects;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
 
 namespace Content.Server.Destructible.Thresholds.Behaviors
 {
@@ -17,8 +17,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
         /// <summary>
         ///     Entities spawned on reaching this threshold, from a min to a max.
         /// </summary>
-        [DataField("spawn", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<MinMax, EntityPrototype>))]
-        public Dictionary<string, MinMax> Spawn { get; set; } = new();
+        [DataField]
+        public Dictionary<EntProtoId, MinMax> Spawn = new();
 
         [DataField("offset")]
         public float Offset { get; set; } = 0.5f;
diff --git a/Content.Server/Destructible/Thresholds/MinMax.cs b/Content.Server/Destructible/Thresholds/MinMax.cs
deleted file mode 100644 (file)
index c448641..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using Robust.Shared.Random;
-
-namespace Content.Server.Destructible.Thresholds
-{
-    [Serializable]
-    [DataDefinition]
-    public partial struct MinMax
-    {
-        [DataField("min")]
-        public int Min;
-
-        [DataField("max")]
-        public int Max;
-
-        public MinMax(int min, int max)
-        {
-            Min = min;
-            Max = max;
-        }
-
-        public int Next(IRobustRandom random)
-        {
-            return random.Next(Min, Max + 1);
-        }
-    }
-}
index a6d0a4baf0a98607ce9611300ee00b4ca06cc57b..2a33d01bd09e2c2778c11e71836acfa53c63484f 100644 (file)
@@ -1,9 +1,9 @@
 using System.Linq;
 using Content.Server.Administration;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Shared.Administration;
 using Content.Shared.Database;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Prototypes;
 using JetBrains.Annotations;
 using Robust.Shared.Console;
index 9e3203d170bc2115a06aaf6dbbf3dba1c322a424..557e44f0952857e194eb1628d8e96eea0ac9d446 100644 (file)
@@ -1,12 +1,12 @@
 using System.Linq;
 using Content.Server.Administration.Commands;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.KillTracking;
 using Content.Server.Mind;
 using Content.Server.Points;
 using Content.Server.RoundEnd;
 using Content.Server.Station.Systems;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Points;
 using Content.Shared.Storage;
 using Robust.Server.GameObjects;
diff --git a/Content.Server/GameTicking/Rules/GameRulePrototype.cs b/Content.Server/GameTicking/Rules/GameRulePrototype.cs
deleted file mode 100644 (file)
index 47f9918..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-namespace Content.Server.GameTicking.Rules;
-
-/*
-[Prototype("gameRule")]
-public sealed partial class GameRulePrototype : IPrototype
-{
-    [IdDataField]
-    public string ID { get; private set; } = default!;
-
-    [DataField("config", required: true)]
-    public GameRuleConfiguration Configuration { get; private set; } = default!;
-}
-*/
index 9ac7a6edbb909bd58ea1e6643ef5f98c40659662..5a5eb720cfb7088ea4b490bc9bbb9892c057005e 100644 (file)
@@ -1,8 +1,8 @@
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Station.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Random.Helpers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Collections;
index 05374aa1396b5c42e74f0472d2e57e6ca0ae79a7..730748ce6b9ec64f84a39ef29abb40e34131f8bb 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Atmos.EntitySystems;
 using Content.Server.Chat.Managers;
-using Content.Server.GameTicking.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Server.GameObjects;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index 01fa387595cc1781cb9c0cf5d32e823a66072c22..e56537c438115b9da00e8831f93f0f7ec20606e2 100644 (file)
@@ -1,7 +1,7 @@
 using System.Threading;
 using Content.Server.Chat.Managers;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Server.Player;
 using Robust.Shared.Player;
 using Timer = Robust.Shared.Timing.Timer;
index 3da55e30c9e58bd675feb0dc4f45414f2e25eb63..8f706fd2ad36e937d5cf219543dcb0c6144f7fd4 100644 (file)
@@ -1,8 +1,8 @@
 using Content.Server.Chat.Managers;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.KillTracking;
 using Content.Shared.Chat;
+using Content.Shared.GameTicking.Components;
 using Robust.Server.Player;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 1c09d6e86e107e401339eb3fe3016b9ec19a361c..3594242bcdee5514d5e20449a3d060957a90a116 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.GridPreloader;
+using Content.Shared.GameTicking.Components;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
 using Robust.Shared.Map;
index cae99fee9fc3c8b03e48da0e54b49e6486487849..db9df8a5b009edfa6b3ba74d38b5b4388271e177 100644 (file)
@@ -1,7 +1,7 @@
 using System.Threading;
 using Content.Server.Chat.Managers;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
+using Content.Shared.GameTicking.Components;
 using Timer = Robust.Shared.Timing.Timer;
 
 namespace Content.Server.GameTicking.Rules;
index 6688bfd980c6ac35dad7fe5076a16d03394e8147..5c3459ef81b58b9f7844f6ab0a7e9c0ddf42c40d 100644 (file)
@@ -11,6 +11,7 @@ using Content.Server.Shuttles.Systems;
 using Content.Server.Station.Components;
 using Content.Server.Store.Components;
 using Content.Server.Store.Systems;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.NPC.Components;
@@ -24,7 +25,6 @@ using Robust.Shared.Map;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Shared.Store.Components;
 
 namespace Content.Server.GameTicking.Rules;
index 3f8d31f622ff391e3fd20e7e7c36d0e999398a92..38102f1a2e9b2ff31e9001e0d11eebecbbcf96a9 100644 (file)
@@ -1,9 +1,9 @@
 using Content.Server.Chat.Managers;
 using Content.Server.Database.Migrations.Postgres;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Station.Systems;
 using Content.Shared.Chat;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Mind;
 using Content.Shared.Mobs;
index 58ced9629503ee17005c735cb957d130a51b58ba..c5f88ab6cf1e29a36f84b390c4ad4ac803e23779 100644 (file)
@@ -12,6 +12,7 @@ using Content.Server.RoundEnd;
 using Content.Server.Shuttles.Systems;
 using Content.Server.Station.Systems;
 using Content.Shared.Database;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Humanoid;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Mind;
@@ -27,7 +28,6 @@ using Content.Shared.Stunnable;
 using Content.Shared.Zombies;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
-using Content.Server.GameTicking.Components;
 using Content.Shared.Cuffs.Components;
 
 namespace Content.Server.GameTicking.Rules;
index f09ed3ebc3cd9be1e0a83eb3a59bc92ffa40630f..570889155b328cc8d185ffdbeb6420ce17175cf3 100644 (file)
@@ -1,9 +1,9 @@
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Shuttles.Systems;
 using Content.Server.Station.Components;
 using Content.Server.Station.Events;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Storage;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index c60670a3ad7ab0de7cd149a2bf11eb4091b31129..23e9ee5a7d2153e7a588ca56c446c3e325d45776 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Sandbox;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.GameTicking.Rules;
 
index d25262b797af82690811618498c5a9a4fdf1267c..320f9d197aac65d756a2786caf97bfa691a624af 100644 (file)
@@ -1,10 +1,10 @@
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using Content.Server.Administration.Logs;
-using Content.Server.GameTicking.Components;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking.Presets;
 using Content.Server.GameTicking.Rules.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Random;
 using Content.Shared.CCVar;
 using Content.Shared.Database;
index 4486ee40fbbd2a7a67e13f4ba67dddd77298bf83..4fe3827ce5ce27439ea76bc0553e9a0b402eba55 100644 (file)
@@ -1,5 +1,5 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Storage;
 
 namespace Content.Server.GameTicking.Rules;
index 29de85a42e50e03ad2aa65e2fa365527e3ab8f21..17442da8577010d2b70c9f82abdef27852c37cb6 100644 (file)
@@ -5,6 +5,7 @@ using Content.Server.Objectives;
 using Content.Server.PDA.Ringer;
 using Content.Server.Roles;
 using Content.Server.Traitor.Uplink;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Mind;
 using Content.Shared.NPC.Systems;
 using Content.Shared.Objectives.Components;
@@ -15,7 +16,6 @@ using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using System.Linq;
 using System.Text;
-using Content.Server.GameTicking.Components;
 
 namespace Content.Server.GameTicking.Rules;
 
index 97e5fd3fc468ba60891a03ad07f999a13bc00641..95d1f791ef2943d031853a089932913e684d4f01 100644 (file)
@@ -6,6 +6,7 @@ using Content.Server.RoundEnd;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.Zombies;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Humanoid;
 using Content.Shared.Mind;
 using Content.Shared.Mobs;
@@ -15,7 +16,6 @@ using Content.Shared.Zombies;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using System.Globalization;
-using Content.Server.GameTicking.Components;
 
 namespace Content.Server.GameTicking.Rules;
 
index f8ecc22828e527842fb957b83a6e11dd35e38b19..18077b413ad5ecd5bc8aac18b16f331867614db3 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.GameTicking;
 using Content.Server.Shuttles.Systems;
 using Content.Shared.Cuffs.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Mind;
 using Content.Shared.Objectives.Components;
 using Content.Shared.Objectives.Systems;
@@ -9,7 +10,6 @@ using Content.Shared.Random.Helpers;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using System.Text;
 using Robust.Server.Player;
 
index 42c84b7f43b613958432c1fcb9265661c0e6f585..35b17dc9584984d1f5063c25d6433bedebcc553f 100644 (file)
@@ -6,6 +6,7 @@ using Content.Server.Power.Nodes;
 using Content.Server.Power.NodeGroups;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Pinpointer;
 using Content.Shared.Power;
 using JetBrains.Annotations;
@@ -13,7 +14,6 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Utility;
 using System.Linq;
-using Content.Server.GameTicking.Components;
 
 namespace Content.Server.Power.EntitySystems;
 
index 75f861879890969b7678a3422d10759a21c45b11..f57481b05b630104339d4a0e4c59c08d3903d4f3 100644 (file)
@@ -1,8 +1,8 @@
 using System.Numerics;
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Spawners.Components;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 using Robust.Shared.Random;
 
index 7e32f546bed1b45fa734a9fee1b9e995523650f4..501d9033b9c0e1a9400002249e34eac120e834f7 100644 (file)
@@ -1,11 +1,11 @@
 using System.Linq;
 using Content.Server.Administration;
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
 using Content.Shared.Administration;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 using Robust.Shared.Random;
 using Robust.Shared.Toolshed;
index a78a542d3b31e2500dc0078f3928034567eea956..916d7d16883fc327e60092d50611115f65c9a736 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.AlertLevel;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
@@ -20,4 +20,4 @@ public sealed class AlertLevelInterceptionRule : StationEventSystem<AlertLevelIn
 
         _alertLevelSystem.SetLevel(chosenStation.Value, component.AlertLevel, true, true, true);
     }
-}
\ No newline at end of file
+}
index cf66a7c052e482195f265b9ca05dab58158e67e6..06da91e256933a130becd226eb2163d957411967 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Anomaly;
-using Content.Server.GameTicking.Components;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index aaa0f0cffc325bbdc1464cdf0e658117617f1ff6..fc4f180adbdd477320ae197be90d63febf7f6a5e 100644 (file)
@@ -1,5 +1,5 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Random;
 
 namespace Content.Server.StationEvents.Events;
index eef9850e739dee48f6618bc217b7f403ca326a40..b19485bc31ee6d09d6e9343f6a1371214a26b959 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Resist;
 using Content.Server.Station.Components;
@@ -6,6 +5,7 @@ using Content.Server.StationEvents.Components;
 using Content.Server.Storage.Components;
 using Content.Server.Storage.EntitySystems;
 using Content.Shared.Access.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Coordinates;
 
 namespace Content.Server.StationEvents.Events;
index ef282593897434cc140775f0378849383df412cf..0cfe87051d5eb0f575886540fbecaa556356ab3a 100644 (file)
@@ -1,8 +1,8 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.Power.Components;
 using Content.Server.Power.EntitySystems;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 
 namespace Content.Server.StationEvents.Events;
index ccfb8aee58e24615d39d4963361fba6d64515814..b49049a10d43e815348e91b4b87a53b294465253 100644 (file)
@@ -1,9 +1,9 @@
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 using Robust.Shared.Random;
 
index 4cddf4674b303a852146d36358e26458fe1632c8..ff2d1ca63117c3564ad01d6b958fe66967c3444f 100644 (file)
@@ -2,9 +2,9 @@ using System.Linq;
 using Content.Server.Cargo.Components;
 using Content.Server.Cargo.Systems;
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.StationEvents.Events;
index 854ee685b33d575f8172be8689de2316da37a0cd..e52c2c05aafef478c8d130bd5eeb13f0a3e678bb 100644 (file)
@@ -1,9 +1,9 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.StationRecords;
 using Content.Server.StationRecords.Systems;
 using Content.Shared.StationRecords;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Random;
 
 namespace Content.Server.StationEvents.Events;
index 115b6d905eaebc36d1037eae0fe6b988ae69f765..e1c642a85d7af3132d191b6bee85ca010c413c71 100644 (file)
@@ -1,6 +1,6 @@
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 using Robust.Shared.Random;
 
index c17f17a8279dd63abd320643eb0a6aa121ff29e1..9e1f70474c1ba1e801b0b171ae7cd9f26ae7f97f 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Atmos.EntitySystems;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Audio;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index aa193f2f4cbc9e332b67004679815a9e0cc259d1..17a92e1b3de36f850f1ce9a388c7a1d82aa61835 100644 (file)
@@ -1,9 +1,9 @@
 using System.Numerics;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.ImmovableRod;
 using Content.Server.StationEvents.Components;
 using Content.Server.Weapons.Ranged.Systems;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Storage;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 8361cc6048a3ce1371b6652cea68f9c902ed3c86..926ecc2db921290cd6909c7bbc8e6a92500a26e9 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.GameTicking.Components;
 using System.Linq;
 using Content.Server.Silicons.Laws;
 using Content.Server.Station.Components;
@@ -7,6 +6,7 @@ using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
 using Content.Shared.Dataset;
 using Content.Shared.FixedPoint;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Silicons.Laws;
index 5b56e03846f98391f076eb483de9ba549eead824..42c57ffcaae5b003f69c278ad95e843b8ffd1a93 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index d6f609bee1d1dc81e31a64d13149cbe2a2609023..bfb7699e9d6efb1a395bad02209bd8d3ddccaf99 100644 (file)
@@ -1,7 +1,7 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.Traits.Assorted;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Mind.Components;
 using Content.Shared.Traits.Assorted;
 
index 455011259dca6c6d6f72d4a0381600194afb9f67..b97cde86a02ee6811a5beaf07ac0a7d3ce90cf46 100644 (file)
@@ -1,7 +1,7 @@
 using System.Numerics;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
index d9d68a386cf54877ac674eefb272de53a4aad4a7..9cbc193ce61fd35353e0b0cf5092cece378a263e 100644 (file)
@@ -1,8 +1,8 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Ninja.Systems;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 
index d547fc9446193f3f472603f91cd55ef37573c1be..e00369a321c9ffc0f7a19ef7cbbefaaadca61eca 100644 (file)
@@ -1,10 +1,10 @@
 using System.Threading;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Power.Components;
 using Content.Server.Power.EntitySystems;
 using Content.Server.Station.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
index 87d50fc8b2a4818150d052c644a35c347f404ca1..a9f2793818051ed35070b450e2a8fd56ec3f998e 100644 (file)
@@ -1,8 +1,8 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.Storage.Components;
 using Content.Server.Storage.EntitySystems;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
 
index 06bb470602ba2802b8e8c5f0207f950165984dc4..3869f227bd4dd7fdf6e0155313b65786738a2b2e 100644 (file)
@@ -1,8 +1,8 @@
 using System.Linq;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Ghost.Roles.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index 77744d44e4652fe9fe565e2a66fe3ae6b3b549b4..e904c24ba6038a75d42d81b3ea54de089396b1b8 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index 0370b4ee61d08182500ea7f9634c1ce1f1e8d4db..19f6e393d20149f039f471c4b1f72843ce1df88b 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Radio;
 using Robust.Shared.Random;
@@ -8,6 +7,7 @@ using Content.Server.StationEvents.Components;
 using Content.Shared.Radio.Components;
 using Content.Shared.Doors.Components;
 using Content.Shared.Doors.Systems;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index 06dfdd5276bef8fada5d66c9f4205bfa1e3e62b2..c4c51afd2a1f0238ab7f5ae9a340872ba3912c9c 100644 (file)
@@ -1,10 +1,10 @@
 using Content.Server.Administration.Logs;
 using Content.Server.Chat.Systems;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.Station.Systems;
 using Content.Server.StationEvents.Components;
 using Content.Shared.Database;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index 867f41dcccfad00cdf74bee3e067f538fe18f168..043ea0375aaa6e52b6e504b7b46fc7a2d3e8f491 100644 (file)
@@ -6,9 +6,9 @@ using JetBrains.Annotations;
 using Robust.Shared.Random;
 using System.Linq;
 using Content.Server.Fluids.EntitySystems;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
+using Content.Shared.GameTicking.Components;
 
 namespace Content.Server.StationEvents.Events;
 
index c2605039bce24b341300776e5457259b90a327f2..fba9cfa6a60effba81b94818741059557e65e7f6 100644 (file)
@@ -1,7 +1,7 @@
-using Content.Server.GameTicking.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Station.Components;
+using Content.Shared.GameTicking.Components;
 using Content.Shared.Storage;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
index 6c1ad4f4891118c01c8f7964445430464e44b00a..f65105de0669c8305a1c72af67c79cbf36c8d0f3 100644 (file)
@@ -1,10 +1,10 @@
 using Content.Server.GameTicking;
-using Content.Server.GameTicking.Components;
 using Content.Server.GameTicking.Rules;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.StationEvents.Components;
 using Content.Server.StationEvents.Events;
 using Content.Shared.CCVar;
+using Content.Shared.GameTicking.Components;
 using Robust.Shared.Configuration;
 using Robust.Shared.Random;
 
diff --git a/Content.Shared/Destructible/Thresholds/MinMax.cs b/Content.Shared/Destructible/Thresholds/MinMax.cs
new file mode 100644 (file)
index 0000000..e086a0f
--- /dev/null
@@ -0,0 +1,24 @@
+using Robust.Shared.Random;
+
+namespace Content.Shared.Destructible.Thresholds;
+
+[DataDefinition, Serializable]
+public partial struct MinMax
+{
+    [DataField]
+    public int Min;
+
+    [DataField]
+    public int Max;
+
+    public MinMax(int min, int max)
+    {
+        Min = min;
+        Max = max;
+    }
+
+    public int Next(IRobustRandom random)
+    {
+        return random.Next(Min, Max + 1);
+    }
+}
similarity index 67%
rename from Content.Server/GameTicking/Components/ActiveGameRuleComponent.cs
rename to Content.Shared/GameTicking/Components/ActiveGameRuleComponent.cs
index b9e6fa5d4b8b06489fd48adccfd29e4e3a06937f..51bdd1c0371da7ccc3a1cd1bd90876f490488dc9 100644 (file)
@@ -1,10 +1,8 @@
-namespace Content.Server.GameTicking.Components;
+namespace Content.Shared.GameTicking.Components;
 
 /// <summary>
 ///     Added to game rules before <see cref="GameRuleStartedEvent"/> and removed before <see cref="GameRuleEndedEvent"/>.
 ///     Mutually exclusive with <seealso cref="EndedGameRuleComponent"/>.
 /// </summary>
 [RegisterComponent]
-public sealed partial class ActiveGameRuleComponent : Component
-{
-}
+public sealed partial class ActiveGameRuleComponent : Component;
similarity index 91%
rename from Content.Server/GameTicking/Components/DelayedStartRuleComponent.cs
rename to Content.Shared/GameTicking/Components/DelayedStartRuleComponent.cs
index de4be83627de18f0a3a5aab7e03db9ec5db9d87f..9275da29b01c9cbbddb21b29d20c4b9d8f6470e5 100644 (file)
@@ -1,6 +1,6 @@
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
-namespace Content.Server.GameTicking.Components;
+namespace Content.Shared.GameTicking.Components;
 
 /// <summary>
 /// Generic component used to track a gamerule that's start has been delayed.
similarity index 61%
rename from Content.Server/GameTicking/Components/EndedGameRuleComponent.cs
rename to Content.Shared/GameTicking/Components/EndedGameRuleComponent.cs
index 3234bfff3a0e2277bb5e9e2e93449cd7d7efb935..5e209ed78a2e2a8f695b983e7e4b32370e817729 100644 (file)
@@ -1,10 +1,8 @@
-namespace Content.Server.GameTicking.Components;
+namespace Content.Shared.GameTicking.Components;
 
 /// <summary>
 ///     Added to game rules before <see cref="GameRuleEndedEvent"/>.
 ///     Mutually exclusive with <seealso cref="ActiveGameRuleComponent"/>.
 /// </summary>
 [RegisterComponent]
-public sealed partial class EndedGameRuleComponent : Component
-{
-}
+public sealed partial class EndedGameRuleComponent : Component;
similarity index 94%
rename from Content.Server/GameTicking/Components/GameRuleComponent.cs
rename to Content.Shared/GameTicking/Components/GameRuleComponent.cs
index 635452b3f3c343483d5450ea903b8dc60ea91cfb..4e93c2b0038202dc06b341d9b8e8abbb7a1896f9 100644 (file)
@@ -1,8 +1,8 @@
-using Content.Server.Destructible.Thresholds;
+using Content.Shared.Destructible.Thresholds;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
-namespace Content.Server.GameTicking.Components;
+namespace Content.Shared.GameTicking.Components;
 
 /// <summary>
 /// Component attached to all gamerule entities.