From: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Date: Thu, 17 Apr 2025 11:38:53 +0000 (+0200)
Subject: minor MindShieldSystem cleanup (#35905)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a85370cc8147f9a0966d86bbf0e860d0b243d8cb;p=space-station-14.git
minor MindShieldSystem cleanup (#35905)
clean up MindShieldSystem
---
diff --git a/Content.Server/Mindshield/MindShieldSystem.cs b/Content.Server/Mindshield/MindShieldSystem.cs
index 63d6bf097e..89ae090acd 100644
--- a/Content.Server/Mindshield/MindShieldSystem.cs
+++ b/Content.Server/Mindshield/MindShieldSystem.cs
@@ -4,51 +4,44 @@ using Content.Server.Popups;
using Content.Server.Roles;
using Content.Shared.Database;
using Content.Shared.Implants;
-using Content.Shared.Implants.Components;
using Content.Shared.Mindshield.Components;
using Content.Shared.Revolutionary.Components;
-using Content.Shared.Tag;
using Robust.Shared.Containers;
namespace Content.Server.Mindshield;
///
-/// System used for checking if the implanted is a Rev or Head Rev.
+/// System used for adding or removing components with a mindshield implant
+/// as well as checking if the implanted is a Rev or Head Rev.
///
public sealed class MindShieldSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
[Dependency] private readonly RoleSystem _roleSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
- [Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
- [ValidatePrototypeId]
- public const string MindShieldTag = "MindShield";
-
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(ImplantCheck);
+
+ SubscribeLocalEvent(OnImplantImplanted);
SubscribeLocalEvent(OnImplantDraw);
}
- ///
- /// Checks if the implant was a mindshield or not
- ///
- public void ImplantCheck(EntityUid uid, SubdermalImplantComponent comp, ref ImplantImplantedEvent ev)
+ private void OnImplantImplanted(Entity ent, ref ImplantImplantedEvent ev)
{
- if (_tag.HasTag(ev.Implant, MindShieldTag) && ev.Implanted != null)
- {
- EnsureComp(ev.Implanted.Value);
- MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant);
- }
+ if (ev.Implanted == null)
+ return;
+
+ EnsureComp(ev.Implanted.Value);
+ MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant);
}
///
/// Checks if the implanted person was a Rev or Head Rev and remove role or destroy mindshield respectively.
///
- public void MindShieldRemovalCheck(EntityUid implanted, EntityUid implant)
+ private void MindShieldRemovalCheck(EntityUid implanted, EntityUid implant)
{
if (HasComp(implanted))
{
diff --git a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
index e071a94988..13b906bbd7 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
@@ -343,9 +343,6 @@
components:
- type: SubdermalImplant
- type: MindShieldImplant
- - type: Tag
- tags:
- - MindShield
# Centcomm implants
diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml
index be6746141d..bd3644d53c 100644
--- a/Resources/Prototypes/tags.yml
+++ b/Resources/Prototypes/tags.yml
@@ -870,9 +870,6 @@
- type: Tag
id: MimeHappyHonk
-- type: Tag
- id: MindShield
-
- type: Tag
id: MindTransferTarget