From c9ac29b8dc88dbf5f30a1eee8f4ac81f4759a3c7 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Thu, 30 Dec 2021 11:55:22 +0100 Subject: [PATCH] Fixes holoparasite injector being usable on anything --- Content.Server/Guardian/CanHostGuardianComponent.cs | 8 ++++++++ Content.Server/Guardian/GuardianSystem.cs | 8 ++++++++ Resources/Changelog/Parts/holoparasite.yml | 4 ++++ Resources/Locale/en-US/guardian/guardian.ftl | 1 + Resources/Prototypes/Entities/Mobs/NPCs/animals.yml | 3 +++ Resources/Prototypes/Entities/Mobs/Player/human.yml | 1 + 6 files changed, 25 insertions(+) create mode 100644 Content.Server/Guardian/CanHostGuardianComponent.cs create mode 100644 Resources/Changelog/Parts/holoparasite.yml diff --git a/Content.Server/Guardian/CanHostGuardianComponent.cs b/Content.Server/Guardian/CanHostGuardianComponent.cs new file mode 100644 index 0000000000..05c9216a4c --- /dev/null +++ b/Content.Server/Guardian/CanHostGuardianComponent.cs @@ -0,0 +1,8 @@ +using Robust.Shared.GameObjects; + +namespace Content.Server.Guardian; + +[RegisterComponent, ComponentProtoName("CanHostGuardian")] +public class CanHostGuardianComponent : Component +{ +} diff --git a/Content.Server/Guardian/GuardianSystem.cs b/Content.Server/Guardian/GuardianSystem.cs index 7373a6c079..67bae906e4 100644 --- a/Content.Server/Guardian/GuardianSystem.cs +++ b/Content.Server/Guardian/GuardianSystem.cs @@ -126,6 +126,14 @@ namespace Content.Server.Guardian return; } + // Can only inject things with the component... + if (!HasComp(target)) + { + _popupSystem.PopupEntity(Loc.GetString("guardian-activator-invalid-target"), user, Filter.Entities(user)); + return; + } + + // If user is already a host don't duplicate. if (HasComp(target)) { diff --git a/Resources/Changelog/Parts/holoparasite.yml b/Resources/Changelog/Parts/holoparasite.yml new file mode 100644 index 0000000000..a46c8c10f0 --- /dev/null +++ b/Resources/Changelog/Parts/holoparasite.yml @@ -0,0 +1,4 @@ +author: Your_Name_Here +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Fixes guardian injector being usable on anything. Now only humans can use it. diff --git a/Resources/Locale/en-US/guardian/guardian.ftl b/Resources/Locale/en-US/guardian/guardian.ftl index 7aca501bd2..370a405284 100644 --- a/Resources/Locale/en-US/guardian/guardian.ftl +++ b/Resources/Locale/en-US/guardian/guardian.ftl @@ -7,6 +7,7 @@ guardian-already-present-invalid-creation = You are NOT re-living that haunting guardian-no-actions-invalid-creation = You don't have the ability to host a guardian! guardian-activator-empty-invalid-creation = The injector is spent. guardian-activator-empty-examine = [color=#ba1919]The injector is spent.[/color] +guardian-activator-invalid-target = Only humans can be injected! # Change this once other species can inject it? guardian-no-soul = Your guardian has no soul. guardian-available = Your guardian now has a soul. diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index da04a4edf4..ec3952b272 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -371,6 +371,9 @@ makeSentient: true name: monkey description: Ook ook! + rules: | + Being a monkey does NOT give you a free pass to kill, RDM or self-antag. + - type: Sprite drawdepth: Mobs layers: diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index 8f5ef460c7..1e007e2a0f 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -21,6 +21,7 @@ - type: CameraRecoil - type: Examiner - type: HumanInventoryController + - type: CanHostGuardian - type: AiFactionTag factions: - NanoTrasen