From 2f2df5c74bef953ef7eef92f4ffb31fe1fc61746 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 13 Aug 2023 12:56:21 -0400 Subject: [PATCH] Fix DNA scrambler (#19079) --- .../Implants/SubdermalImplantSystem.cs | 22 +++++++++---------- Resources/Locale/en-US/implant/implant.ftl | 5 ++--- .../Prototypes/Entities/Mobs/Player/human.yml | 8 ------- Resources/Prototypes/Polymorphs/polymorph.yml | 8 ------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/Content.Server/Implants/SubdermalImplantSystem.cs b/Content.Server/Implants/SubdermalImplantSystem.cs index e87a955fd1..038e0fdcdf 100644 --- a/Content.Server/Implants/SubdermalImplantSystem.cs +++ b/Content.Server/Implants/SubdermalImplantSystem.cs @@ -1,21 +1,24 @@ using Content.Server.Cuffs; +using Content.Server.Humanoid; using Content.Server.Store.Components; using Content.Server.Store.Systems; using Content.Shared.Cuffs.Components; +using Content.Shared.Humanoid; using Content.Shared.Implants; using Content.Shared.Implants.Components; using Content.Shared.Interaction; using Content.Shared.Popups; -using Content.Server.Polymorph.Systems; +using Content.Shared.Preferences; namespace Content.Server.Implants; public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem { [Dependency] private readonly CuffableSystem _cuffable = default!; + [Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearance = default!; + [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly StoreSystem _store = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly PolymorphSystem _polymorph = default!; public override void Initialize() { @@ -69,20 +72,17 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent component, UseDnaScramblerImplantEvent args) { - if (component.ImplantedEntity == null) + if (component.ImplantedEntity is not { } ent) return; - var newIdentity = _polymorph.PolymorphEntity(component.ImplantedEntity.Value, "Scrambled"); - - //checks if someone is trying to use a dna scrambler implant while already scrambled - if (newIdentity == null) + if (TryComp(ent, out var humanoid)) { - _popup.PopupEntity(Loc.GetString("scramble-attempt-while-scrambled-popup"), component.ImplantedEntity.Value, component.ImplantedEntity.Value); - return; + var newProfile = HumanoidCharacterProfile.RandomWithSpecies(humanoid.Species); + _humanoidAppearance.LoadProfile(ent, newProfile, humanoid); + _metaData.SetEntityName(ent, newProfile.Name); + _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup"), ent, ent); } - _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup", ("identity", newIdentity.Value)), newIdentity.Value, newIdentity.Value); - args.Handled = true; QueueDel(uid); } diff --git a/Resources/Locale/en-US/implant/implant.ftl b/Resources/Locale/en-US/implant/implant.ftl index 5c34420c7e..63efb313cc 100644 --- a/Resources/Locale/en-US/implant/implant.ftl +++ b/Resources/Locale/en-US/implant/implant.ftl @@ -35,12 +35,11 @@ use-emp-implant-action-name = Activate EMP use-emp-implant-action-description = Triggers a small EMP pulse around you use-dna-scrambler-implant-action-name = Scramble DNA -use-dna-scrambler-implant-action-description = LING IN MAINTS! +use-dna-scrambler-implant-action-description = Randomly changes your name and appearance. ## Implant Popups -scramble-attempt-while-scrambled-popup = Scrambled DNA detected, please extract implant before undoing the current scramble. -scramble-implant-activated-popup = You transformed into {$identity} +scramble-implant-activated-popup = Your appearance shifts and changes! ## Implant Messages diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index 1196642554..ba1d475b34 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -53,11 +53,3 @@ - type: NpcFactionMember factions: - Syndicate - -# DNA Scrambler -- type: entity - parent: MobHuman - id: MobHumanScrambled - name: Scrambled Human - components: - - type: RandomHumanoidAppearance diff --git a/Resources/Prototypes/Polymorphs/polymorph.yml b/Resources/Prototypes/Polymorphs/polymorph.yml index e51722437e..ccc35ae47a 100644 --- a/Resources/Prototypes/Polymorphs/polymorph.yml +++ b/Resources/Prototypes/Polymorphs/polymorph.yml @@ -4,14 +4,6 @@ forced: true duration: 30 -- type: polymorph - id: Scrambled - entity: MobHumanScrambled - forced: false - inventory: Transfer - revertOnCrit: true - revertOnDeath: true - - type: polymorph id: Chicken entity: MobChicken