mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-15 03:32:07 +01:00
Fix DNA scrambler (#19079)
This commit is contained in:
@@ -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<HumanoidAppearanceComponent>(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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -53,11 +53,3 @@
|
||||
- type: NpcFactionMember
|
||||
factions:
|
||||
- Syndicate
|
||||
|
||||
# DNA Scrambler
|
||||
- type: entity
|
||||
parent: MobHuman
|
||||
id: MobHumanScrambled
|
||||
name: Scrambled Human
|
||||
components:
|
||||
- type: RandomHumanoidAppearance
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user