From c86c92c5cf00a635f3ba2c5ddea1f28d6b71d2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D1=83=D0=B1=D1=8C?= <124601871+Golubgik@users.noreply.github.com> Date: Mon, 3 Aug 2026 14:16:25 +0700 Subject: [PATCH] update namespace for shared ghost folder (#45095) a --- .../Administration/AdminNameOverlay.cs | 2 +- Content.Client/Ghost/GhostSystem.cs | 3 +- .../Ghost/GhostToggleSelfVisibility.cs | 2 +- Content.Client/StatusIcon/StatusIconSystem.cs | 2 +- .../Ghost/Controls/GhostTargetWindow.xaml.cs | 2 +- .../Systems/Ghost/GhostUIController.cs | 5 +- Content.Client/Voting/UI/VoteCallMenu.xaml.cs | 1 + Content.Client/Voting/UI/VotePopup.xaml.cs | 1 + .../Tests/Commands/SuicideCommandTests.cs | 2 +- .../Tests/Minds/GhostRoleTests.cs | 4 +- .../Tests/Minds/GhostTests.cs | 4 +- .../Tests/Minds/MindTests.EntityDeletion.cs | 2 +- .../Tests/Minds/MindTests.Helpers.cs | 4 +- .../Tests/Minds/MindTests.ReconnectTests.cs | 2 +- .../Administration/Commands/AGhostCommand.cs | 3 +- .../Administration/Commands/WarpCommand.cs | 2 +- .../AntagSelectionSystem.API.Assignment.cs | 4 +- .../Antag/AntagSelectionSystem.API.cs | 2 +- .../Chat/Systems/ChatSystem.Utility.cs | 2 +- Content.Server/Chat/Systems/ChatSystem.cs | 1 + Content.Server/Fax/AdminUI/AdminFaxEui.cs | 2 +- Content.Server/Ghost/GhostSystem.cs | 3 +- Content.Server/Ghost/Roles/GhostRoleSystem.cs | 2 + Content.Server/Mind/MindSystem.cs | 2 +- Content.Server/Parallax/BiomeSystem.cs | 2 +- .../Pointing/EntitySystems/PointingSystem.cs | 2 +- .../Roles/ParadoxCloneRoleSystem.cs | 2 +- Content.Server/Teleportation/PortalSystem.cs | 4 +- Content.Server/Voting/Managers/VoteManager.cs | 2 +- Content.Server/Voting/VotingSystem.cs | 2 +- .../Actions/ActionContainerSystem.cs | 2 +- Content.Shared/Body/Systems/BrainSystem.cs | 4 +- .../Generic/IsGhostConditionSystem.cs | 2 +- Content.Shared/Examine/ExamineSystemShared.cs | 2 +- Content.Shared/Follower/FollowerSystem.cs | 2 +- .../Ghost/{ => Components}/GhostComponent.cs | 3 +- .../{ => Components}/GhostHearingComponent.cs | 2 +- .../{ => Components}/GhostOnMoveComponent.cs | 4 +- .../{ => Components}/SpectralComponent.cs | 2 +- Content.Shared/Ghost/SharedGhostSystem.cs | 230 ------------------ .../Ghost/Systems/SharedGhostSystem.cs | 230 ++++++++++++++++++ .../GhostTypes/GhostSpriteStateSystem.cs | 2 +- Content.Shared/IdentityManagement/Identity.cs | 2 +- .../Interaction/SharedInteractionSystem.cs | 2 +- .../Systems/SharedContentEyeSystem.cs | 2 +- .../EntitySystems/SharedEventHorizonSystem.cs | 3 +- .../UserInterface/ActivatableUISystem.cs | 2 +- Content.Shared/Warps/WarpPointSystem.cs | 2 +- .../Artifact/XAT/XATExamineSystem.cs | 2 +- 49 files changed, 291 insertions(+), 282 deletions(-) rename Content.Shared/Ghost/{ => Components}/GhostComponent.cs (97%) rename Content.Shared/Ghost/{ => Components}/GhostHearingComponent.cs (83%) rename Content.Shared/Ghost/{ => Components}/GhostOnMoveComponent.cs (72%) rename Content.Shared/Ghost/{ => Components}/SpectralComponent.cs (83%) delete mode 100644 Content.Shared/Ghost/SharedGhostSystem.cs create mode 100644 Content.Shared/Ghost/Systems/SharedGhostSystem.cs diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index d1a9f6f7a7..5951dff2e1 100644 --- a/Content.Client/Administration/AdminNameOverlay.cs +++ b/Content.Client/Administration/AdminNameOverlay.cs @@ -5,7 +5,7 @@ using Content.Client.Administration.Systems; using Content.Client.Stylesheets; using Content.Shared.Administration; using Content.Shared.CCVar; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Roles; using Robust.Client.Graphics; diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index 6551f9c7f9..3d65e993be 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -1,6 +1,7 @@ using Content.Client.Movement.Systems; using Content.Shared.Actions; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; +using Content.Shared.Ghost.Systems; using Content.Shared.NightVision; using Content.Shared.Overlays; using Robust.Client.Console; diff --git a/Content.Client/Ghost/GhostToggleSelfVisibility.cs b/Content.Client/Ghost/GhostToggleSelfVisibility.cs index 100f242eab..22b3bbf4e3 100644 --- a/Content.Client/Ghost/GhostToggleSelfVisibility.cs +++ b/Content.Client/Ghost/GhostToggleSelfVisibility.cs @@ -1,4 +1,4 @@ -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Robust.Client.GameObjects; using Robust.Shared.Console; diff --git a/Content.Client/StatusIcon/StatusIconSystem.cs b/Content.Client/StatusIcon/StatusIconSystem.cs index 72b52c19ab..1db1bb2ddd 100644 --- a/Content.Client/StatusIcon/StatusIconSystem.cs +++ b/Content.Client/StatusIcon/StatusIconSystem.cs @@ -1,5 +1,5 @@ using Content.Shared.CCVar; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.StatusIcon; using Content.Shared.StatusIcon.Components; using Content.Shared.Stealth.Components; diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs index dd0733ace5..7095594d6e 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs @@ -1,6 +1,6 @@ using System.Linq; using System.Numerics; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Systems; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; diff --git a/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs b/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs index 9c366a328f..db583b9875 100644 --- a/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs +++ b/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs @@ -1,8 +1,9 @@ -using Content.Client.Gameplay; +using Content.Client.Gameplay; using Content.Client.Ghost; using Content.Client.UserInterface.Systems.Gameplay; using Content.Client.UserInterface.Systems.Ghost.Widgets; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; +using Content.Shared.Ghost.Systems; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controllers; diff --git a/Content.Client/Voting/UI/VoteCallMenu.xaml.cs b/Content.Client/Voting/UI/VoteCallMenu.xaml.cs index fa2fb16000..ae821ecdbc 100644 --- a/Content.Client/Voting/UI/VoteCallMenu.xaml.cs +++ b/Content.Client/Voting/UI/VoteCallMenu.xaml.cs @@ -5,6 +5,7 @@ using Content.Client.Stylesheets; using Content.Shared.Administration; using Content.Shared.CCVar; using Content.Shared.Ghost; +using Content.Shared.Ghost.Systems; using Content.Shared.Voting; using JetBrains.Annotations; using Robust.Client.AutoGenerated; diff --git a/Content.Client/Voting/UI/VotePopup.xaml.cs b/Content.Client/Voting/UI/VotePopup.xaml.cs index bb0e181aa0..28e1b2843b 100644 --- a/Content.Client/Voting/UI/VotePopup.xaml.cs +++ b/Content.Client/Voting/UI/VotePopup.xaml.cs @@ -1,6 +1,7 @@ using System; using Content.Client.Stylesheets; using Content.Shared.Ghost; +using Content.Shared.Ghost.Systems; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; diff --git a/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs b/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs index f78bd4949e..5d33365c70 100644 --- a/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs +++ b/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs @@ -6,7 +6,7 @@ using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Systems; using Content.Shared.Execution; using Content.Shared.FixedPoint; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; using Content.Shared.Mind; diff --git a/Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs b/Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs index 7369fece35..cbb49a41ef 100644 --- a/Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs +++ b/Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs @@ -1,9 +1,9 @@ -#nullable enable +#nullable enable using System.Linq; using Content.IntegrationTests.Fixtures; using Content.Server.Ghost.Roles; using Content.Server.Ghost.Roles.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Players; using Robust.Shared.Console; diff --git a/Content.IntegrationTests/Tests/Minds/GhostTests.cs b/Content.IntegrationTests/Tests/Minds/GhostTests.cs index 26991c08ad..959a2582ce 100644 --- a/Content.IntegrationTests/Tests/Minds/GhostTests.cs +++ b/Content.IntegrationTests/Tests/Minds/GhostTests.cs @@ -1,7 +1,7 @@ -using System.Numerics; +using System.Numerics; using Content.IntegrationTests.Fixtures; using Content.IntegrationTests.Pair; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Players; using Robust.Server.GameObjects; diff --git a/Content.IntegrationTests/Tests/Minds/MindTests.EntityDeletion.cs b/Content.IntegrationTests/Tests/Minds/MindTests.EntityDeletion.cs index cf87b3ea76..ce2cd643b2 100644 --- a/Content.IntegrationTests/Tests/Minds/MindTests.EntityDeletion.cs +++ b/Content.IntegrationTests/Tests/Minds/MindTests.EntityDeletion.cs @@ -1,7 +1,7 @@ #nullable enable using System.Linq; using Content.Server.GameTicking; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Players; using Robust.Server.Console; diff --git a/Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs b/Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs index e22f6c1e4d..b3831a0cb1 100644 --- a/Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs +++ b/Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs @@ -1,8 +1,8 @@ -using System.Linq; +using System.Linq; using Content.IntegrationTests.Pair; using Content.Server.GameTicking; using Content.Server.Mind; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Players; using Robust.Server.GameObjects; diff --git a/Content.IntegrationTests/Tests/Minds/MindTests.ReconnectTests.cs b/Content.IntegrationTests/Tests/Minds/MindTests.ReconnectTests.cs index fbe79fe044..21bbafe438 100644 --- a/Content.IntegrationTests/Tests/Minds/MindTests.ReconnectTests.cs +++ b/Content.IntegrationTests/Tests/Minds/MindTests.ReconnectTests.cs @@ -1,5 +1,5 @@ using System.Linq; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Robust.Server.Player; using Robust.Shared.GameObjects; diff --git a/Content.Server/Administration/Commands/AGhostCommand.cs b/Content.Server/Administration/Commands/AGhostCommand.cs index 9bdb9890aa..5b450a2c4e 100644 --- a/Content.Server/Administration/Commands/AGhostCommand.cs +++ b/Content.Server/Administration/Commands/AGhostCommand.cs @@ -3,7 +3,8 @@ using Content.Server.GameTicking; using Content.Server.Ghost; using Content.Server.Mind; using Content.Shared.Administration; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; +using Content.Shared.Ghost.Systems; using Content.Shared.Mind; using Robust.Server.GameObjects; using Robust.Server.Player; diff --git a/Content.Server/Administration/Commands/WarpCommand.cs b/Content.Server/Administration/Commands/WarpCommand.cs index 28802ea84c..262a554844 100644 --- a/Content.Server/Administration/Commands/WarpCommand.cs +++ b/Content.Server/Administration/Commands/WarpCommand.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Numerics; using Content.Shared.Administration; using Content.Shared.Follower; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Warps; using Robust.Shared.Console; using Robust.Shared.Enums; diff --git a/Content.Server/Antag/AntagSelectionSystem.API.Assignment.cs b/Content.Server/Antag/AntagSelectionSystem.API.Assignment.cs index 4259916c77..12582961d1 100644 --- a/Content.Server/Antag/AntagSelectionSystem.API.Assignment.cs +++ b/Content.Server/Antag/AntagSelectionSystem.API.Assignment.cs @@ -1,11 +1,11 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Server.Antag.Components; using Content.Server.GameTicking.Rules.Components; using Content.Shared.Antag; using Content.Shared.Database; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Humanoid; using Content.Shared.Players; using JetBrains.Annotations; diff --git a/Content.Server/Antag/AntagSelectionSystem.API.cs b/Content.Server/Antag/AntagSelectionSystem.API.cs index a20319871c..b125d41149 100644 --- a/Content.Server/Antag/AntagSelectionSystem.API.cs +++ b/Content.Server/Antag/AntagSelectionSystem.API.cs @@ -4,7 +4,7 @@ using Content.Server.Antag.Selectors; using Content.Shared.Antag; using Content.Shared.Chat; using Content.Shared.GameTicking.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Roles; using JetBrains.Annotations; diff --git a/Content.Server/Chat/Systems/ChatSystem.Utility.cs b/Content.Server/Chat/Systems/ChatSystem.Utility.cs index b1eba9f856..8f39d7327d 100644 --- a/Content.Server/Chat/Systems/ChatSystem.Utility.cs +++ b/Content.Server/Chat/Systems/ChatSystem.Utility.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Text; using Content.Shared.Chat; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Players; using Content.Shared.Speech.Prototypes; using Robust.Shared.Console; diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index fbbe41310b..9f5a868e0c 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.CCVar; using Content.Shared.Chat; using Content.Shared.Examine; using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Players.RateLimiting; using Content.Shared.Speech.EntitySystems; diff --git a/Content.Server/Fax/AdminUI/AdminFaxEui.cs b/Content.Server/Fax/AdminUI/AdminFaxEui.cs index 06ee0ce7a9..21089befe0 100644 --- a/Content.Server/Fax/AdminUI/AdminFaxEui.cs +++ b/Content.Server/Fax/AdminUI/AdminFaxEui.cs @@ -5,9 +5,9 @@ using Content.Shared.Eui; using Content.Shared.Fax.Components; using Content.Shared.Fax; using Content.Shared.Follower; -using Content.Shared.Ghost; using Content.Shared.Paper; using Content.Shared.DeviceNetwork.Components; +using Content.Shared.Ghost.Components; namespace Content.Server.Fax.AdminUI; diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index d7f9010454..e760eca2a4 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -16,7 +16,8 @@ using Content.Shared.Eye; using Content.Shared.FixedPoint; using Content.Shared.Follower; using Content.Shared.Follower.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; +using Content.Shared.Ghost.Systems; using Content.Shared.GhostTypes; using Content.Shared.Mind; using Content.Shared.Mind.Components; diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 4d7122fc83..1c80c8b416 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -34,6 +34,8 @@ using Content.Shared.Verbs; using Robust.Shared.Collections; using Content.Shared.Ghost.Roles.Components; using Content.Shared.Roles.Components; +using Content.Shared.Ghost.Systems; +using Content.Shared.Ghost.Components; namespace Content.Server.Ghost.Roles; diff --git a/Content.Server/Mind/MindSystem.cs b/Content.Server/Mind/MindSystem.cs index 2db8400b10..be5dd86563 100644 --- a/Content.Server/Mind/MindSystem.cs +++ b/Content.Server/Mind/MindSystem.cs @@ -2,7 +2,7 @@ using Content.Server.Administration.Logs; using Content.Server.GameTicking; using Content.Server.Ghost; using Content.Shared.Database; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Players; diff --git a/Content.Server/Parallax/BiomeSystem.cs b/Content.Server/Parallax/BiomeSystem.cs index d37164a1c6..4cfcd65b41 100644 --- a/Content.Server/Parallax/BiomeSystem.cs +++ b/Content.Server/Parallax/BiomeSystem.cs @@ -6,7 +6,7 @@ using Content.Server.Ghost.Roles.Components; using Content.Server.Shuttles.Events; using Content.Server.Shuttles.Systems; using Content.Shared.Atmos; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Gravity; using Content.Shared.Light.Components; using Content.Shared.Parallax.Biomes; diff --git a/Content.Server/Pointing/EntitySystems/PointingSystem.cs b/Content.Server/Pointing/EntitySystems/PointingSystem.cs index 450bf5e31d..53f63728a9 100644 --- a/Content.Server/Pointing/EntitySystems/PointingSystem.cs +++ b/Content.Server/Pointing/EntitySystems/PointingSystem.cs @@ -5,7 +5,7 @@ using Content.Shared.CCVar; using Content.Shared.Database; using Content.Shared.Examine; using Content.Shared.Eye; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.IdentityManagement; using Content.Shared.Input; using Content.Shared.Interaction; diff --git a/Content.Server/Roles/ParadoxCloneRoleSystem.cs b/Content.Server/Roles/ParadoxCloneRoleSystem.cs index 85332ef4a4..1228b8aab0 100644 --- a/Content.Server/Roles/ParadoxCloneRoleSystem.cs +++ b/Content.Server/Roles/ParadoxCloneRoleSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.NameModifier.EntitySystems; using Content.Shared.Roles.Components; diff --git a/Content.Server/Teleportation/PortalSystem.cs b/Content.Server/Teleportation/PortalSystem.cs index 19cb785474..59ca14939c 100644 --- a/Content.Server/Teleportation/PortalSystem.cs +++ b/Content.Server/Teleportation/PortalSystem.cs @@ -1,6 +1,6 @@ -using Content.Shared.Administration.Logs; +using Content.Shared.Administration.Logs; using Content.Shared.Database; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind.Components; using Content.Shared.Teleportation.Systems; using Robust.Shared.Map; diff --git a/Content.Server/Voting/Managers/VoteManager.cs b/Content.Server/Voting/Managers/VoteManager.cs index 62341103ce..2f4cf272fa 100644 --- a/Content.Server/Voting/Managers/VoteManager.cs +++ b/Content.Server/Voting/Managers/VoteManager.cs @@ -11,7 +11,7 @@ using Content.Server.Maps; using Content.Shared.Administration; using Content.Shared.CCVar; using Content.Shared.Database; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Players.PlayTimeTracking; using Content.Shared.Voting; using Robust.Server.Player; diff --git a/Content.Server/Voting/VotingSystem.cs b/Content.Server/Voting/VotingSystem.cs index 626ace1896..41d7e72afc 100644 --- a/Content.Server/Voting/VotingSystem.cs +++ b/Content.Server/Voting/VotingSystem.cs @@ -4,7 +4,6 @@ using Content.Server.GameTicking; using Content.Server.Ghost; using Content.Server.Roles.Jobs; using Content.Shared.CCVar; -using Content.Shared.Ghost; using Content.Shared.Mind.Components; using Content.Shared.Voting; using Robust.Server.Player; @@ -15,6 +14,7 @@ using Robust.Shared.Timing; using System.Threading.Tasks; using Content.Server.Players.Whitelist; using Content.Shared.Players.PlayTimeTracking; +using Content.Shared.Ghost.Components; namespace Content.Server.Voting; diff --git a/Content.Shared/Actions/ActionContainerSystem.cs b/Content.Shared/Actions/ActionContainerSystem.cs index d813beb4fb..e09f3660f7 100644 --- a/Content.Shared/Actions/ActionContainerSystem.cs +++ b/Content.Shared/Actions/ActionContainerSystem.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Shared.Actions.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Mind.Components; using Robust.Shared.Containers; diff --git a/Content.Shared/Body/Systems/BrainSystem.cs b/Content.Shared/Body/Systems/BrainSystem.cs index bc93e2fe76..84ebd27413 100644 --- a/Content.Shared/Body/Systems/BrainSystem.cs +++ b/Content.Shared/Body/Systems/BrainSystem.cs @@ -1,5 +1,5 @@ -using Content.Shared.Body.Components; -using Content.Shared.Ghost; +using Content.Shared.Body.Components; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Mobs.Components; diff --git a/Content.Shared/EntityConditions/Conditions/Generic/IsGhostConditionSystem.cs b/Content.Shared/EntityConditions/Conditions/Generic/IsGhostConditionSystem.cs index dff9acf182..323138b82c 100644 --- a/Content.Shared/EntityConditions/Conditions/Generic/IsGhostConditionSystem.cs +++ b/Content.Shared/EntityConditions/Conditions/Generic/IsGhostConditionSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Robust.Shared.Prototypes; namespace Content.Shared.EntityConditions.Conditions.Generic; diff --git a/Content.Shared/Examine/ExamineSystemShared.cs b/Content.Shared/Examine/ExamineSystemShared.cs index 656deb2c70..88fef4c556 100644 --- a/Content.Shared/Examine/ExamineSystemShared.cs +++ b/Content.Shared/Examine/ExamineSystemShared.cs @@ -1,6 +1,6 @@ using System.Linq; using Content.Shared.Eye.Blinding.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Interaction; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; diff --git a/Content.Shared/Follower/FollowerSystem.cs b/Content.Shared/Follower/FollowerSystem.cs index 42990a8293..711089c329 100644 --- a/Content.Shared/Follower/FollowerSystem.cs +++ b/Content.Shared/Follower/FollowerSystem.cs @@ -3,7 +3,7 @@ using System.Numerics; using Content.Shared.Administration.Managers; using Content.Shared.Database; using Content.Shared.Follower.Components; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Hands; using Content.Shared.Movement.Events; using Content.Shared.Movement.Pulling.Events; diff --git a/Content.Shared/Ghost/GhostComponent.cs b/Content.Shared/Ghost/Components/GhostComponent.cs similarity index 97% rename from Content.Shared/Ghost/GhostComponent.cs rename to Content.Shared/Ghost/Components/GhostComponent.cs index 37f5c9e693..d52e7d6e58 100644 --- a/Content.Shared/Ghost/GhostComponent.cs +++ b/Content.Shared/Ghost/Components/GhostComponent.cs @@ -1,9 +1,10 @@ using Content.Shared.Actions; +using Content.Shared.Ghost.Systems; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; -namespace Content.Shared.Ghost; +namespace Content.Shared.Ghost.Components; /// /// Represents an observer ghost. diff --git a/Content.Shared/Ghost/GhostHearingComponent.cs b/Content.Shared/Ghost/Components/GhostHearingComponent.cs similarity index 83% rename from Content.Shared/Ghost/GhostHearingComponent.cs rename to Content.Shared/Ghost/Components/GhostHearingComponent.cs index c50a1f6c74..8d858ff03a 100644 --- a/Content.Shared/Ghost/GhostHearingComponent.cs +++ b/Content.Shared/Ghost/Components/GhostHearingComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared.Ghost; +namespace Content.Shared.Ghost.Components; /// /// This is used for marking entities which should receive all local chat message, even when out of range diff --git a/Content.Shared/Ghost/GhostOnMoveComponent.cs b/Content.Shared/Ghost/Components/GhostOnMoveComponent.cs similarity index 72% rename from Content.Shared/Ghost/GhostOnMoveComponent.cs rename to Content.Shared/Ghost/Components/GhostOnMoveComponent.cs index 44cb3d0168..2b6e4ea795 100644 --- a/Content.Shared/Ghost/GhostOnMoveComponent.cs +++ b/Content.Shared/Ghost/Components/GhostOnMoveComponent.cs @@ -1,6 +1,6 @@ -using Robust.Shared.GameStates; +using Robust.Shared.GameStates; -namespace Content.Shared.Ghost; +namespace Content.Shared.Ghost.Components; [RegisterComponent, NetworkedComponent] public sealed partial class GhostOnMoveComponent : Component diff --git a/Content.Shared/Ghost/SpectralComponent.cs b/Content.Shared/Ghost/Components/SpectralComponent.cs similarity index 83% rename from Content.Shared/Ghost/SpectralComponent.cs rename to Content.Shared/Ghost/Components/SpectralComponent.cs index 3799951152..9b7ef2cada 100644 --- a/Content.Shared/Ghost/SpectralComponent.cs +++ b/Content.Shared/Ghost/Components/SpectralComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.GameStates; -namespace Content.Shared.Ghost; +namespace Content.Shared.Ghost.Components; /// /// Marker component to identify "ghostly" entities. diff --git a/Content.Shared/Ghost/SharedGhostSystem.cs b/Content.Shared/Ghost/SharedGhostSystem.cs deleted file mode 100644 index d9f24e381f..0000000000 --- a/Content.Shared/Ghost/SharedGhostSystem.cs +++ /dev/null @@ -1,230 +0,0 @@ -using Content.Shared.Emoting; -using Content.Shared.Examine; -using Content.Shared.Hands; -using Content.Shared.Interaction.Events; -using Content.Shared.Item; -using Content.Shared.Popups; -using Robust.Shared.Serialization; -using Robust.Shared.Timing; - -namespace Content.Shared.Ghost -{ - /// - /// System for the . - /// Prevents ghosts from interacting when is false. - /// - public abstract partial class SharedGhostSystem : EntitySystem - { - [Dependency] protected SharedPopupSystem Popup = default!; - [Dependency] protected IGameTiming _gameTiming = default!; - - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnAttempt); - SubscribeLocalEvent(OnAttemptInteract); - SubscribeLocalEvent(OnAttempt); - SubscribeLocalEvent(OnAttempt); - SubscribeLocalEvent(OnAttempt); - SubscribeLocalEvent(OnGhostExamine); - } - - private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args) - { - var timeSinceDeath = _gameTiming.RealTime.Subtract(component.TimeOfDeath); - var deathTimeInfo = timeSinceDeath.Minutes > 0 - ? Loc.GetString("comp-ghost-examine-time-minutes", ("minutes", timeSinceDeath.Minutes)) - : Loc.GetString("comp-ghost-examine-time-seconds", ("seconds", timeSinceDeath.Seconds)); - - args.PushMarkup(deathTimeInfo); - } - - private void OnAttemptInteract(Entity ent, ref InteractionAttemptEvent args) - { - if (!ent.Comp.CanGhostInteract) - args.Cancelled = true; - } - - private void OnAttempt(EntityUid uid, GhostComponent component, CancellableEntityEventArgs args) - { - if (!component.CanGhostInteract) - args.Cancel(); - } - - /// - /// Sets the ghost's time of death. - /// - public void SetTimeOfDeath(Entity entity, TimeSpan value) - { - if (!Resolve(entity, ref entity.Comp)) - return; - - if (entity.Comp.TimeOfDeath == value) - return; - - entity.Comp.TimeOfDeath = value; - Dirty(entity); - } - - [Obsolete("Use the Entity overload")] - public void SetTimeOfDeath(EntityUid uid, TimeSpan value, GhostComponent? component) - { - SetTimeOfDeath((uid, component), value); - } - - /// - /// Sets whether or not the ghost player is allowed to return to their original body. - /// - public void SetCanReturnToBody(Entity entity, bool value) - { - if (!Resolve(entity, ref entity.Comp)) - return; - - if (entity.Comp.CanReturnToBody == value) - return; - - entity.Comp.CanReturnToBody = value; - Dirty(entity); - } - - [Obsolete("Use the Entity overload")] - public void SetCanReturnToBody(EntityUid uid, bool value, GhostComponent? component = null) - { - SetCanReturnToBody((uid, component), value); - } - - [Obsolete("Use the Entity overload")] - public void SetCanReturnToBody(GhostComponent component, bool value) - { - SetCanReturnToBody((component.Owner, component), value); - } - - - /// - /// Sets whether the ghost is allowed to interact with other entities. - /// - public void SetCanGhostInteract(Entity entity, bool value) - { - if (!Resolve(entity, ref entity.Comp)) - return; - - if (entity.Comp.CanGhostInteract == value) - return; - - entity.Comp.CanGhostInteract = value; - Dirty(entity); - } - } - - /// - /// A client to server request to get places a ghost can warp to. - /// Response is sent via - /// - [Serializable, NetSerializable] - public sealed class GhostWarpsRequestEvent : EntityEventArgs - { - } - - /// - /// An individual place a ghost can warp to. - /// This is used as part of - /// - [Serializable, NetSerializable] - public struct GhostWarp - { - public GhostWarp(NetEntity entity, string displayName, bool isWarpPoint) - { - Entity = entity; - DisplayName = displayName; - IsWarpPoint = isWarpPoint; - } - - /// - /// The entity representing the warp point. - /// This is passed back to the server in - /// - public NetEntity Entity { get; } - - /// - /// The display name to be surfaced in the ghost warps menu - /// - public string DisplayName { get; } - - /// - /// Whether this warp represents a warp point or a player - /// - public bool IsWarpPoint { get; } - } - - /// - /// A server to client response for a . - /// Contains players, and locations a ghost can warp to - /// - [Serializable, NetSerializable] - public sealed class GhostWarpsResponseEvent : EntityEventArgs - { - public GhostWarpsResponseEvent(List warps) - { - Warps = warps; - } - - /// - /// A list of warp points. - /// - public List Warps { get; } - } - - /// - /// A client to server request for their ghost to be warped to an entity - /// - [Serializable, NetSerializable] - public sealed class GhostWarpToTargetRequestEvent : EntityEventArgs - { - public NetEntity Target { get; } - - public GhostWarpToTargetRequestEvent(NetEntity target) - { - Target = target; - } - } - - /// - /// A client to server request for their ghost to be warped to the most followed player. - /// - [Serializable, NetSerializable] - public sealed class GhostnadoRequestEvent : EntityEventArgs; - - /// - /// A client to server request for their ghost to be warped to a random player with at least one ghost follower. - /// - [Serializable, NetSerializable] - public sealed class WarpToRandomFollowedRequestEvent : EntityEventArgs; - /// - - /// A client to server request for their ghost to be warped to a random player. - /// - [Serializable, NetSerializable] - public sealed class WarpToRandomRequestEvent : EntityEventArgs; - - /// - /// A client to server request for their ghost to return to body - /// - [Serializable, NetSerializable] - public sealed class GhostReturnToBodyRequest : EntityEventArgs - { - } - - /// - /// A server to client update with the available ghost role count - /// - [Serializable, NetSerializable] - public sealed class GhostUpdateGhostRoleCountEvent : EntityEventArgs - { - public int AvailableGhostRoles { get; } - - public GhostUpdateGhostRoleCountEvent(int availableGhostRoleCount) - { - AvailableGhostRoles = availableGhostRoleCount; - } - } -} diff --git a/Content.Shared/Ghost/Systems/SharedGhostSystem.cs b/Content.Shared/Ghost/Systems/SharedGhostSystem.cs new file mode 100644 index 0000000000..7ab6516e26 --- /dev/null +++ b/Content.Shared/Ghost/Systems/SharedGhostSystem.cs @@ -0,0 +1,230 @@ +using Content.Shared.Emoting; +using Content.Shared.Examine; +using Content.Shared.Ghost.Components; +using Content.Shared.Hands; +using Content.Shared.Interaction.Events; +using Content.Shared.Item; +using Content.Shared.Popups; +using Robust.Shared.Serialization; +using Robust.Shared.Timing; + +namespace Content.Shared.Ghost.Systems; + +/// +/// System for the . +/// Prevents ghosts from interacting when is false. +/// +public abstract partial class SharedGhostSystem : EntitySystem +{ + [Dependency] protected SharedPopupSystem Popup = default!; + [Dependency] protected IGameTiming _gameTiming = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnAttemptInteract); + SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnGhostExamine); + } + + private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args) + { + var timeSinceDeath = _gameTiming.RealTime.Subtract(component.TimeOfDeath); + var deathTimeInfo = timeSinceDeath.Minutes > 0 + ? Loc.GetString("comp-ghost-examine-time-minutes", ("minutes", timeSinceDeath.Minutes)) + : Loc.GetString("comp-ghost-examine-time-seconds", ("seconds", timeSinceDeath.Seconds)); + + args.PushMarkup(deathTimeInfo); + } + + private void OnAttemptInteract(Entity ent, ref InteractionAttemptEvent args) + { + if (!ent.Comp.CanGhostInteract) + args.Cancelled = true; + } + + private void OnAttempt(EntityUid uid, GhostComponent component, CancellableEntityEventArgs args) + { + if (!component.CanGhostInteract) + args.Cancel(); + } + + /// + /// Sets the ghost's time of death. + /// + public void SetTimeOfDeath(Entity entity, TimeSpan value) + { + if (!Resolve(entity, ref entity.Comp)) + return; + + if (entity.Comp.TimeOfDeath == value) + return; + + entity.Comp.TimeOfDeath = value; + Dirty(entity); + } + + [Obsolete("Use the Entity overload")] + public void SetTimeOfDeath(EntityUid uid, TimeSpan value, GhostComponent? component) + { + SetTimeOfDeath((uid, component), value); + } + + /// + /// Sets whether or not the ghost player is allowed to return to their original body. + /// + public void SetCanReturnToBody(Entity entity, bool value) + { + if (!Resolve(entity, ref entity.Comp)) + return; + + if (entity.Comp.CanReturnToBody == value) + return; + + entity.Comp.CanReturnToBody = value; + Dirty(entity); + } + + [Obsolete("Use the Entity overload")] + public void SetCanReturnToBody(EntityUid uid, bool value, GhostComponent? component = null) + { + SetCanReturnToBody((uid, component), value); + } + + [Obsolete("Use the Entity overload")] + public void SetCanReturnToBody(GhostComponent component, bool value) + { + SetCanReturnToBody((component.Owner, component), value); + } + + + /// + /// Sets whether the ghost is allowed to interact with other entities. + /// + public void SetCanGhostInteract(Entity entity, bool value) + { + if (!Resolve(entity, ref entity.Comp)) + return; + + if (entity.Comp.CanGhostInteract == value) + return; + + entity.Comp.CanGhostInteract = value; + Dirty(entity); + } +} + +/// +/// A client to server request to get places a ghost can warp to. +/// Response is sent via +/// +[Serializable, NetSerializable] +public sealed class GhostWarpsRequestEvent : EntityEventArgs +{ +} + +/// +/// An individual place a ghost can warp to. +/// This is used as part of +/// +[Serializable, NetSerializable] +public struct GhostWarp +{ + public GhostWarp(NetEntity entity, string displayName, bool isWarpPoint) + { + Entity = entity; + DisplayName = displayName; + IsWarpPoint = isWarpPoint; + } + + /// + /// The entity representing the warp point. + /// This is passed back to the server in + /// + public NetEntity Entity { get; } + + /// + /// The display name to be surfaced in the ghost warps menu + /// + public string DisplayName { get; } + + /// + /// Whether this warp represents a warp point or a player + /// + public bool IsWarpPoint { get; } +} + +/// +/// A server to client response for a . +/// Contains players, and locations a ghost can warp to +/// +[Serializable, NetSerializable] +public sealed class GhostWarpsResponseEvent : EntityEventArgs +{ + public GhostWarpsResponseEvent(List warps) + { + Warps = warps; + } + + /// + /// A list of warp points. + /// + public List Warps { get; } +} + +/// +/// A client to server request for their ghost to be warped to an entity +/// +[Serializable, NetSerializable] +public sealed class GhostWarpToTargetRequestEvent : EntityEventArgs +{ + public NetEntity Target { get; } + + public GhostWarpToTargetRequestEvent(NetEntity target) + { + Target = target; + } +} + +/// +/// A client to server request for their ghost to be warped to the most followed player. +/// +[Serializable, NetSerializable] +public sealed class GhostnadoRequestEvent : EntityEventArgs; + +/// +/// A client to server request for their ghost to be warped to a random player with at least one ghost follower. +/// +[Serializable, NetSerializable] +public sealed class WarpToRandomFollowedRequestEvent : EntityEventArgs; +/// + +/// A client to server request for their ghost to be warped to a random player. +/// +[Serializable, NetSerializable] +public sealed class WarpToRandomRequestEvent : EntityEventArgs; + +/// +/// A client to server request for their ghost to return to body +/// +[Serializable, NetSerializable] +public sealed class GhostReturnToBodyRequest : EntityEventArgs +{ +} + +/// +/// A server to client update with the available ghost role count +/// +[Serializable, NetSerializable] +public sealed class GhostUpdateGhostRoleCountEvent : EntityEventArgs +{ + public int AvailableGhostRoles { get; } + + public GhostUpdateGhostRoleCountEvent(int availableGhostRoleCount) + { + AvailableGhostRoles = availableGhostRoleCount; + } +} diff --git a/Content.Shared/GhostTypes/GhostSpriteStateSystem.cs b/Content.Shared/GhostTypes/GhostSpriteStateSystem.cs index 3f0baac831..7164984b21 100644 --- a/Content.Shared/GhostTypes/GhostSpriteStateSystem.cs +++ b/Content.Shared/GhostTypes/GhostSpriteStateSystem.cs @@ -2,7 +2,7 @@ using System.Linq; using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Systems; using Content.Shared.FixedPoint; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Mind; using Content.Shared.Random.Helpers; using Robust.Shared.Prototypes; diff --git a/Content.Shared/IdentityManagement/Identity.cs b/Content.Shared/IdentityManagement/Identity.cs index ac71194279..c3cd4938c4 100644 --- a/Content.Shared/IdentityManagement/Identity.cs +++ b/Content.Shared/IdentityManagement/Identity.cs @@ -1,4 +1,4 @@ -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.IdentityManagement.Components; namespace Content.Shared.IdentityManagement; diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index cc27609a15..14f2b7ff42 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -6,7 +6,7 @@ using Content.Shared.CCVar; using Content.Shared.Chat; using Content.Shared.CombatMode; using Content.Shared.Database; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Hands; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; diff --git a/Content.Shared/Movement/Systems/SharedContentEyeSystem.cs b/Content.Shared/Movement/Systems/SharedContentEyeSystem.cs index bf82ce0ea9..86d1d83564 100644 --- a/Content.Shared/Movement/Systems/SharedContentEyeSystem.cs +++ b/Content.Shared/Movement/Systems/SharedContentEyeSystem.cs @@ -2,7 +2,7 @@ using System.Numerics; using Content.Shared.Administration; using Content.Shared.Administration.Managers; using Content.Shared.Camera; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Input; using Content.Shared.Movement.Components; using Robust.Shared.Input.Binding; diff --git a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs index e0b0bfc15e..f5c5cbd687 100644 --- a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs +++ b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs @@ -3,10 +3,9 @@ using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Systems; - -using Content.Shared.Ghost; using Content.Shared.Singularity.Components; using Robust.Shared.Physics; +using Content.Shared.Ghost.Components; namespace Content.Shared.Singularity.EntitySystems; diff --git a/Content.Shared/UserInterface/ActivatableUISystem.cs b/Content.Shared/UserInterface/ActivatableUISystem.cs index c03d7dc7b2..3b650337d0 100644 --- a/Content.Shared/UserInterface/ActivatableUISystem.cs +++ b/Content.Shared/UserInterface/ActivatableUISystem.cs @@ -1,6 +1,6 @@ using Content.Shared.ActionBlocker; using Content.Shared.Administration.Managers; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Hands; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; diff --git a/Content.Shared/Warps/WarpPointSystem.cs b/Content.Shared/Warps/WarpPointSystem.cs index 6b03395c18..dd0d71cc23 100644 --- a/Content.Shared/Warps/WarpPointSystem.cs +++ b/Content.Shared/Warps/WarpPointSystem.cs @@ -1,5 +1,5 @@ using Content.Shared.Examine; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; namespace Content.Shared.Warps; diff --git a/Content.Shared/Xenoarchaeology/Artifact/XAT/XATExamineSystem.cs b/Content.Shared/Xenoarchaeology/Artifact/XAT/XATExamineSystem.cs index 44616ee7de..5363e0e85d 100644 --- a/Content.Shared/Xenoarchaeology/Artifact/XAT/XATExamineSystem.cs +++ b/Content.Shared/Xenoarchaeology/Artifact/XAT/XATExamineSystem.cs @@ -1,5 +1,5 @@ using Content.Shared.Examine; -using Content.Shared.Ghost; +using Content.Shared.Ghost.Components; using Content.Shared.Xenoarchaeology.Artifact.Components; using Content.Shared.Xenoarchaeology.Artifact.XAT.Components;