From 467e983ba972a7ae749c95448febd19c7c285514 Mon Sep 17 00:00:00 2001 From: Aexxie Date: Thu, 1 Feb 2024 07:29:01 -0600 Subject: [PATCH] Move grenade components to shared (#22691) * Moves FlashComponent.cs, FlashOnTriggerComponent.cs, and SmokeOnTriggerComponent.cs to Shared * Moves ExplodeOnTriggerComponent.cs, OnUseTimerTriggerComponent.cs, ActiveTimerTriggerComponent.cs, and SmokeOnTriggerComponent.cs to Shared * Delete .run/Content Server+Client.run.xml HOW DID THIS GET IN HERE ITS NOT AHHHH * Update Content.Client/Explosion/SmokeOnTriggerSystem.cs Co-authored-by: DrSmugleaf * Update Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs Co-authored-by: DrSmugleaf * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf * Update Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs Co-authored-by: DrSmugleaf * Update Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs Co-authored-by: DrSmugleaf * Update ExplodeOnTriggerComponent.cs * Revert "Delete .run/Content Server+Client.run.xml" This reverts commit 29ee05f57de60eab5c92158d8eba5e3acba483c2. * Fix? * cannot figure out how to get this to go back please forgive * Fixes a network issue * leftovers * Fixes --------- Co-authored-by: DrSmugleaf Co-authored-by: metalgearsloth --- .run/Content Server+Client.run.xml | 2 +- .../ClusterGrenadeVisualizerSystem.cs | 1 + Content.Client/Explosion/ExplosionOverlay.cs | 2 +- .../Explosion/ExplosionOverlaySystem.cs | 1 + .../Explosion/SmokeOnTriggerSystem.cs | 7 ++++ .../Explosion/TriggerOnProximityComponent.cs | 1 + .../Tests/Payload/ModularGrenadeTests.cs | 1 + .../Defusable/Systems/DefusableSystem.cs | 2 ++ .../Components/ActiveTimerTriggerComponent.cs | 25 --------------- .../Components/TriggerOnProximityComponent.cs | 1 + .../EntitySystems/ClusterGrenadeSystem.cs | 2 ++ .../EntitySystems/ExplosionSystem.GridMap.cs | 1 + .../ExplosionSystem.Processing.cs | 1 + .../EntitySystems/ExplosionSystem.TileFill.cs | 1 + .../EntitySystems/ExplosionSystem.Visuals.cs | 1 + .../EntitySystems/SmokeOnTriggerSystem.cs | 6 ++-- .../EntitySystems/TriggerSystem.Mobstate.cs | 1 + .../EntitySystems/TriggerSystem.OnUse.cs | 1 + .../Explosion/EntitySystems/TriggerSystem.cs | 4 ++- .../Components/FlashOnTriggerComponent.cs | 12 ------- Content.Server/Flash/FlashSystem.cs | 1 + .../Nutrition/EntitySystems/CreamPieSystem.cs | 1 + .../Administration/SpawnExplosionEuiMsg.cs | 1 + .../Components/ActiveTimerTriggerComponent.cs | 21 ++++++++++++ .../ExplosionVisualsComponent.cs | 2 +- .../OnTrigger/ExplodeOnTriggerComponent.cs | 6 ++-- .../OnTrigger/SmokeOnTriggerComponent.cs | 7 ++-- .../Components/OnUseTimerTriggerComponent.cs | 32 +++++++------------ .../SharedClusterGrenadeComponent.cs | 2 +- .../SharedTriggerOnProximityComponent.cs | 2 +- .../SharedSmokeOnTriggerSystem.cs | 6 ++++ .../EntitySystems/SharedTriggerSystem.cs | 6 ++++ .../Flash/Components/FlashComponent.cs | 6 ++-- .../Components/FlashOnTriggerComponent.cs | 13 ++++++++ .../Objects/Devices/Electronics/triggers.yml | 7 ++-- .../Objects/Misc/subdermal_implants.yml | 7 ++-- .../Objects/Specific/Janitorial/janitor.yml | 7 ++-- .../Entities/Objects/Weapons/Bombs/funny.yml | 7 ++-- .../Entities/Objects/Weapons/Bombs/ied.yml | 3 +- .../Entities/Objects/Weapons/security.yml | 1 - 40 files changed, 125 insertions(+), 86 deletions(-) create mode 100644 Content.Client/Explosion/SmokeOnTriggerSystem.cs delete mode 100644 Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs delete mode 100644 Content.Server/Flash/Components/FlashOnTriggerComponent.cs create mode 100644 Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs rename Content.Shared/Explosion/{ => Components}/ExplosionVisualsComponent.cs (97%) rename {Content.Server => Content.Shared}/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs (57%) rename {Content.Server => Content.Shared}/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs (85%) rename {Content.Server => Content.Shared}/Explosion/Components/OnUseTimerTriggerComponent.cs (59%) rename Content.Shared/Explosion/{ => Components}/SharedClusterGrenadeComponent.cs (77%) rename Content.Shared/Explosion/{ => Components}/SharedTriggerOnProximityComponent.cs (74%) create mode 100644 Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs create mode 100644 Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs rename {Content.Server => Content.Shared}/Flash/Components/FlashComponent.cs (83%) create mode 100644 Content.Shared/Flash/Components/FlashOnTriggerComponent.cs diff --git a/.run/Content Server+Client.run.xml b/.run/Content Server+Client.run.xml index 0ec9bf16a750..191d737ccff6 100644 --- a/.run/Content Server+Client.run.xml +++ b/.run/Content Server+Client.run.xml @@ -1,4 +1,4 @@ - + diff --git a/Content.Client/Explosion/ClusterGrenadeVisualizerSystem.cs b/Content.Client/Explosion/ClusterGrenadeVisualizerSystem.cs index 1e35cb6b5928..c8171742dc2a 100644 --- a/Content.Client/Explosion/ClusterGrenadeVisualizerSystem.cs +++ b/Content.Client/Explosion/ClusterGrenadeVisualizerSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Robust.Client.GameObjects; namespace Content.Client.Explosion; diff --git a/Content.Client/Explosion/ExplosionOverlay.cs b/Content.Client/Explosion/ExplosionOverlay.cs index 2ab84d4438a8..94e8ca598237 100644 --- a/Content.Client/Explosion/ExplosionOverlay.cs +++ b/Content.Client/Explosion/ExplosionOverlay.cs @@ -1,5 +1,5 @@ using System.Numerics; -using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using JetBrains.Annotations; using Robust.Client.Graphics; using Robust.Shared.Enums; diff --git a/Content.Client/Explosion/ExplosionOverlaySystem.cs b/Content.Client/Explosion/ExplosionOverlaySystem.cs index 7ced95d2c1f2..fe552af0e795 100644 --- a/Content.Client/Explosion/ExplosionOverlaySystem.cs +++ b/Content.Client/Explosion/ExplosionOverlaySystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Shared.GameStates; diff --git a/Content.Client/Explosion/SmokeOnTriggerSystem.cs b/Content.Client/Explosion/SmokeOnTriggerSystem.cs new file mode 100644 index 000000000000..cac255e1ba9e --- /dev/null +++ b/Content.Client/Explosion/SmokeOnTriggerSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared.Explosion.EntitySystems; + +namespace Content.Client.Explosion; + +public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem +{ +} \ No newline at end of file diff --git a/Content.Client/Explosion/TriggerOnProximityComponent.cs b/Content.Client/Explosion/TriggerOnProximityComponent.cs index 5d4714d19c3c..5fa9bbfd2372 100644 --- a/Content.Client/Explosion/TriggerOnProximityComponent.cs +++ b/Content.Client/Explosion/TriggerOnProximityComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; namespace Content.Client.Explosion; diff --git a/Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs b/Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs index 0e47de968f0a..70179fdec1aa 100644 --- a/Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs +++ b/Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs @@ -1,5 +1,6 @@ using Content.IntegrationTests.Tests.Interaction; using Content.Server.Explosion.Components; +using Content.Shared.Explosion.Components; using Robust.Shared.Containers; using Robust.Shared.GameObjects; diff --git a/Content.Server/Defusable/Systems/DefusableSystem.cs b/Content.Server/Defusable/Systems/DefusableSystem.cs index 6927df256a47..1e9caece9456 100644 --- a/Content.Server/Defusable/Systems/DefusableSystem.cs +++ b/Content.Server/Defusable/Systems/DefusableSystem.cs @@ -8,6 +8,8 @@ using Content.Shared.Database; using Content.Shared.Defusable; using Content.Shared.Examine; +using Content.Shared.Explosion.Components; +using Content.Shared.Explosion.Components.OnTrigger; using Content.Shared.Popups; using Content.Shared.Verbs; using Content.Shared.Wires; diff --git a/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs b/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs deleted file mode 100644 index d4f57b713701..000000000000 --- a/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Robust.Shared.Audio; - -namespace Content.Server.Explosion.Components; - -/// -/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. . -/// -[RegisterComponent] -public sealed partial class ActiveTimerTriggerComponent : Component -{ - [DataField("timeRemaining")] - public float TimeRemaining; - - [DataField("user")] - public EntityUid? User; - - [DataField("beepInterval")] - public float BeepInterval; - - [DataField("timeUntilBeep")] - public float TimeUntilBeep; - - [DataField("beepSound")] - public SoundSpecifier? BeepSound; -} diff --git a/Content.Server/Explosion/Components/TriggerOnProximityComponent.cs b/Content.Server/Explosion/Components/TriggerOnProximityComponent.cs index cfa1042245b0..504ef4dee43e 100644 --- a/Content.Server/Explosion/Components/TriggerOnProximityComponent.cs +++ b/Content.Server/Explosion/Components/TriggerOnProximityComponent.cs @@ -1,5 +1,6 @@ using Content.Server.Explosion.EntitySystems; using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Content.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; diff --git a/Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs b/Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs index ee3f76d04c63..4ea857a5527f 100644 --- a/Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs +++ b/Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs @@ -8,6 +8,8 @@ using Robust.Shared.Random; using Content.Server.Weapons.Ranged.Systems; using System.Numerics; +using Content.Shared.Explosion.Components; +using Content.Shared.Flash.Components; using Robust.Server.Containers; using Robust.Server.GameObjects; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs index 799489d7b4cd..b04642a8db00 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs @@ -1,6 +1,7 @@ using System.Numerics; using Content.Shared.Atmos; using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Robust.Shared.Map; using Robust.Shared.Map.Components; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index e48d9f145ebb..2bfc753b74ae 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -3,6 +3,7 @@ using Content.Shared.CCVar; using Content.Shared.Damage; using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Content.Shared.Maps; using Content.Shared.Physics; using Content.Shared.Projectiles; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs index 65ca6e782ca6..1b324d924bc0 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs @@ -2,6 +2,7 @@ using System.Numerics; using Content.Shared.Administration; using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Robust.Shared.Map; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs index ef8e1ffd987f..d332531502c7 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs @@ -1,4 +1,5 @@ using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; using Robust.Server.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.Map; diff --git a/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs b/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs index 3ddb411d40db..ab706d6d9c51 100644 --- a/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs @@ -1,7 +1,9 @@ -using Content.Server.Explosion.Components; +using Content.Shared.Explosion.Components; using Content.Server.Fluids.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Coordinates.Helpers; +using Content.Shared.Explosion.Components.OnTrigger; +using Content.Shared.Explosion.EntitySystems; using Content.Shared.Maps; using Robust.Shared.Map; @@ -10,7 +12,7 @@ namespace Content.Server.Explosion.EntitySystems; /// /// Handles creating smoke when is triggered. /// -public sealed class SmokeOnTriggerSystem : EntitySystem +public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem { [Dependency] private readonly IMapManager _mapMan = default!; [Dependency] private readonly SmokeSystem _smoke = default!; diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs index 0b674adefd98..45198662ec3b 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs @@ -1,4 +1,5 @@ using Content.Server.Explosion.Components; +using Content.Shared.Explosion.Components; using Content.Shared.Implants; using Content.Shared.Interaction.Events; using Content.Shared.Mobs; diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs index 7edca9b803a6..373cd1a9956f 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs @@ -1,6 +1,7 @@ using Content.Server.Explosion.Components; using Content.Server.Sticky.Events; using Content.Shared.Examine; +using Content.Shared.Explosion.Components; using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Verbs; diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index 7b3e0b0e6267..aa81f80c5011 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -3,11 +3,13 @@ using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Explosion.Components; using Content.Server.Flash; -using Content.Server.Flash.Components; +using Content.Shared.Flash.Components; using Content.Server.Radio.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Database; +using Content.Shared.Explosion.Components; +using Content.Shared.Explosion.Components.OnTrigger; using Content.Shared.Implants.Components; using Content.Shared.Interaction; using Content.Shared.Mobs; diff --git a/Content.Server/Flash/Components/FlashOnTriggerComponent.cs b/Content.Server/Flash/Components/FlashOnTriggerComponent.cs deleted file mode 100644 index ad12dbdb02d1..000000000000 --- a/Content.Server/Flash/Components/FlashOnTriggerComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Content.Server.Flash.Components -{ - /// - /// Upon being triggered will flash in an area around it. - /// - [RegisterComponent] - internal sealed partial class FlashOnTriggerComponent : Component - { - [DataField("range")] internal float Range = 1.0f; - [DataField("duration")] internal float Duration = 8.0f; - } -} diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index ff50c813eb95..5bee1834fa43 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Charges.Systems; using Content.Shared.Eye.Blinding.Components; using Content.Shared.Flash; +using Content.Shared.Flash.Components; using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; diff --git a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs index 45d868cdbf6a..f8d781bcfff6 100644 --- a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Nutrition.Components; using Content.Server.Popups; using Content.Shared.Containers.ItemSlots; +using Content.Shared.Explosion.Components; using Content.Shared.Interaction; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; diff --git a/Content.Shared/Administration/SpawnExplosionEuiMsg.cs b/Content.Shared/Administration/SpawnExplosionEuiMsg.cs index 910399a95c26..03c0625b9af3 100644 --- a/Content.Shared/Administration/SpawnExplosionEuiMsg.cs +++ b/Content.Shared/Administration/SpawnExplosionEuiMsg.cs @@ -2,6 +2,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Map; using Content.Shared.Explosion; +using Content.Shared.Explosion.Components; namespace Content.Shared.Administration; diff --git a/Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs b/Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs new file mode 100644 index 000000000000..b0304715b1b5 --- /dev/null +++ b/Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs @@ -0,0 +1,21 @@ +using Robust.Shared.Audio; +using Robust.Shared.GameStates; + +namespace Content.Shared.Explosion.Components; + +/// +/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. . +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class ActiveTimerTriggerComponent : Component +{ + [DataField] public float TimeRemaining; + + [DataField] public EntityUid? User; + + [DataField] public float BeepInterval; + + [DataField] public float TimeUntilBeep; + + [DataField] public SoundSpecifier? BeepSound; +} diff --git a/Content.Shared/Explosion/ExplosionVisualsComponent.cs b/Content.Shared/Explosion/Components/ExplosionVisualsComponent.cs similarity index 97% rename from Content.Shared/Explosion/ExplosionVisualsComponent.cs rename to Content.Shared/Explosion/Components/ExplosionVisualsComponent.cs index 5baa59fc5a07..7477b6c26eae 100644 --- a/Content.Shared/Explosion/ExplosionVisualsComponent.cs +++ b/Content.Shared/Explosion/Components/ExplosionVisualsComponent.cs @@ -2,7 +2,7 @@ using Robust.Shared.Map; using Robust.Shared.Serialization; -namespace Content.Shared.Explosion; +namespace Content.Shared.Explosion.Components; /// /// Component that is used to send explosion overlay/visual data to an abstract explosion entity. diff --git a/Content.Server/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs b/Content.Shared/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs similarity index 57% rename from Content.Server/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs rename to Content.Shared/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs index 326ae6dab57b..e14cd1246405 100644 --- a/Content.Server/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs +++ b/Content.Shared/Explosion/Components/OnTrigger/ExplodeOnTriggerComponent.cs @@ -1,9 +1,11 @@ -namespace Content.Server.Explosion.Components; +using Robust.Shared.GameStates; + +namespace Content.Shared.Explosion.Components.OnTrigger; /// /// Explode using the entity's if Triggered. /// -[RegisterComponent] +[RegisterComponent, NetworkedComponent] public sealed partial class ExplodeOnTriggerComponent : Component { } diff --git a/Content.Server/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs b/Content.Shared/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs similarity index 85% rename from Content.Server/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs rename to Content.Shared/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs index d71e93495a98..dfaee98fab96 100644 --- a/Content.Server/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs +++ b/Content.Shared/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs @@ -1,14 +1,15 @@ -using Content.Server.Explosion.EntitySystems; using Content.Shared.Chemistry.Components; +using Content.Shared.Explosion.EntitySystems; +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; -namespace Content.Server.Explosion.Components; +namespace Content.Shared.Explosion.Components.OnTrigger; /// /// Creates a smoke cloud when triggered, with an optional solution to include in it. /// No sound is played incase a grenade is stealthy, use if you want a sound. /// -[RegisterComponent, Access(typeof(SmokeOnTriggerSystem))] +[RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))] public sealed partial class SmokeOnTriggerComponent : Component { /// diff --git a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs b/Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs similarity index 59% rename from Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs rename to Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs index f2e94239a033..5e509cb10bba 100644 --- a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs +++ b/Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs @@ -1,57 +1,49 @@ using Robust.Shared.Audio; +using Robust.Shared.GameStates; -namespace Content.Server.Explosion.Components +namespace Content.Shared.Explosion.Components { - [RegisterComponent] + [RegisterComponent, NetworkedComponent] public sealed partial class OnUseTimerTriggerComponent : Component { - [DataField("delay")] - public float Delay = 1f; + [DataField] public float Delay = 1f; /// /// If not null, a user can use verbs to configure the delay to one of these options. /// - [DataField("delayOptions")] - public List? DelayOptions = null; + [DataField] public List? DelayOptions = null; /// /// If not null, this timer will periodically play this sound while active. /// - [DataField("beepSound")] - public SoundSpecifier? BeepSound; + [DataField] public SoundSpecifier? BeepSound; /// /// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use. /// - [DataField("initialBeepDelay")] - public float? InitialBeepDelay; + [DataField] public float? InitialBeepDelay; - [DataField("beepInterval")] - public float BeepInterval = 1; + [DataField] public float BeepInterval = 1; /// /// Whether the timer should instead be activated through a verb in the right-click menu /// - [DataField("useVerbInstead")] - public bool UseVerbInstead = false; + [DataField] public bool UseVerbInstead = false; /// /// Should timer be started when it was stuck to another entity. /// Used for C4 charges and similar behaviour. /// - [DataField("startOnStick")] - public bool StartOnStick; + [DataField] public bool StartOnStick; /// /// Allows changing the start-on-stick quality. /// - [DataField("canToggleStartOnStick")] - public bool AllowToggleStartOnStick; + [DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick; /// /// Whether you can examine the item to see its timer or not. /// - [DataField("examinable")] - public bool Examinable = true; + [DataField] public bool Examinable = true; } } diff --git a/Content.Shared/Explosion/SharedClusterGrenadeComponent.cs b/Content.Shared/Explosion/Components/SharedClusterGrenadeComponent.cs similarity index 77% rename from Content.Shared/Explosion/SharedClusterGrenadeComponent.cs rename to Content.Shared/Explosion/Components/SharedClusterGrenadeComponent.cs index 602e0e4479ef..1655e4cb57d0 100644 --- a/Content.Shared/Explosion/SharedClusterGrenadeComponent.cs +++ b/Content.Shared/Explosion/Components/SharedClusterGrenadeComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.Serialization; -namespace Content.Shared.Explosion +namespace Content.Shared.Explosion.Components { [Serializable, NetSerializable] public enum ClusterGrenadeVisuals : byte diff --git a/Content.Shared/Explosion/SharedTriggerOnProximityComponent.cs b/Content.Shared/Explosion/Components/SharedTriggerOnProximityComponent.cs similarity index 74% rename from Content.Shared/Explosion/SharedTriggerOnProximityComponent.cs rename to Content.Shared/Explosion/Components/SharedTriggerOnProximityComponent.cs index fdc5cd11342b..02d115610495 100644 --- a/Content.Shared/Explosion/SharedTriggerOnProximityComponent.cs +++ b/Content.Shared/Explosion/Components/SharedTriggerOnProximityComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.GameStates; -namespace Content.Shared.Explosion; +namespace Content.Shared.Explosion.Components; [NetworkedComponent] public abstract partial class SharedTriggerOnProximityComponent : Component diff --git a/Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs b/Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs new file mode 100644 index 000000000000..0a8caa5e2a1c --- /dev/null +++ b/Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs @@ -0,0 +1,6 @@ +namespace Content.Shared.Explosion.EntitySystems; + +public abstract class SharedSmokeOnTriggerSystem : EntitySystem +{ + +} \ No newline at end of file diff --git a/Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs b/Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs new file mode 100644 index 000000000000..cc5b3f6b7483 --- /dev/null +++ b/Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs @@ -0,0 +1,6 @@ +namespace Content.Shared.Explosion.EntitySystems; + +public abstract class SharedTriggerSystem : EntitySystem +{ + +} \ No newline at end of file diff --git a/Content.Server/Flash/Components/FlashComponent.cs b/Content.Shared/Flash/Components/FlashComponent.cs similarity index 83% rename from Content.Server/Flash/Components/FlashComponent.cs rename to Content.Shared/Flash/Components/FlashComponent.cs index f8437ab18061..a26e32cb70f5 100644 --- a/Content.Server/Flash/Components/FlashComponent.cs +++ b/Content.Shared/Flash/Components/FlashComponent.cs @@ -1,8 +1,10 @@ +using Content.Shared.Flash; using Robust.Shared.Audio; +using Robust.Shared.GameStates; -namespace Content.Server.Flash.Components +namespace Content.Shared.Flash.Components { - [RegisterComponent, Access(typeof(FlashSystem))] + [RegisterComponent, NetworkedComponent, Access(typeof(SharedFlashSystem))] public sealed partial class FlashComponent : Component { diff --git a/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs b/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs new file mode 100644 index 000000000000..f257c83b5aaa --- /dev/null +++ b/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Flash.Components; + +/// +/// Upon being triggered will flash in an area around it. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class FlashOnTriggerComponent : Component +{ + [DataField] public float Range = 1.0f; + [DataField] public float Duration = 8.0f; +} diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml index c462a3cb038a..43ed20c694c4 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml @@ -24,9 +24,10 @@ delay: 5 delayOptions: [3, 5, 10, 15, 30] initialBeepDelay: 0 - beepSound: /Audio/Machines/Nuke/general_beep.ogg - params: - volume: -2 + beepSound: + path: /Audio/Machines/Nuke/general_beep.ogg + params: + volume: -2 - type: StaticPrice price: 40 diff --git a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml index d369d0399684..092b013f5b77 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml @@ -252,9 +252,10 @@ - type: OnUseTimerTrigger delay: 7 initialBeepDelay: 0 - beepSound: /Audio/Machines/Nuke/general_beep.ogg - params: - volume: -2 + beepSound: + path: /Audio/Machines/Nuke/general_beep.ogg + params: + volume: -2 - type: ExplodeOnTrigger - type: GibOnTrigger deleteItems: true diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml index 3f53b3e1cea0..f83c48436a6c 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml @@ -253,9 +253,10 @@ - type: OnUseTimerTrigger useVerbInstead: true beepInterval: .25 - beepSound: /Audio/Items/Janitor/floor_sign_beep.ogg - params: - volume: 1 + beepSound: + path: /Audio/Items/Janitor/floor_sign_beep.ogg + params: + volume: 1 examinable: false - type: Tag tags: # ignore "WhitelistChameleon" tag diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/funny.yml b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/funny.yml index 7d95e7481e3b..4aff7363a450 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/funny.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/funny.yml @@ -24,9 +24,10 @@ Blunt: 5 - type: OnUseTimerTrigger delay: 120 - beepSound: /Audio/Machines/Nuke/general_beep.ogg - params: - volume: -2 + beepSound: + path: /Audio/Machines/Nuke/general_beep.ogg + params: + volume: -2 - type: ExplodeOnTrigger - type: Explosive explosionType: Default diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/ied.yml b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/ied.yml index 14906c7c2d5c..c4420a43a368 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/ied.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/ied.yml @@ -22,7 +22,8 @@ initialBeepDelay: 0 beepSound: path: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg - volume: 1 + params: + volume: 1 - type: RandomTimerTrigger min: 0 max: 60 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index c8f2fd4d0e7b..eef38e254163 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -179,7 +179,6 @@ sound: path: /Audio/Weapons/flash.ogg - type: FlashOnTrigger - repeating: true range: 3 - type: TriggerOnProximity enabled: true