Fix DNA scrambler (#19079)
This commit is contained in:
parent
ff4f01e9d8
commit
2f2df5c74b
|
|
@ -1,21 +1,24 @@
|
||||||
using Content.Server.Cuffs;
|
using Content.Server.Cuffs;
|
||||||
|
using Content.Server.Humanoid;
|
||||||
using Content.Server.Store.Components;
|
using Content.Server.Store.Components;
|
||||||
using Content.Server.Store.Systems;
|
using Content.Server.Store.Systems;
|
||||||
using Content.Shared.Cuffs.Components;
|
using Content.Shared.Cuffs.Components;
|
||||||
|
using Content.Shared.Humanoid;
|
||||||
using Content.Shared.Implants;
|
using Content.Shared.Implants;
|
||||||
using Content.Shared.Implants.Components;
|
using Content.Shared.Implants.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Server.Polymorph.Systems;
|
using Content.Shared.Preferences;
|
||||||
|
|
||||||
namespace Content.Server.Implants;
|
namespace Content.Server.Implants;
|
||||||
|
|
||||||
public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly CuffableSystem _cuffable = default!;
|
[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 StoreSystem _store = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
[Dependency] private readonly PolymorphSystem _polymorph = default!;
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -69,20 +72,17 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
||||||
|
|
||||||
private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent component, UseDnaScramblerImplantEvent args)
|
private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent component, UseDnaScramblerImplantEvent args)
|
||||||
{
|
{
|
||||||
if (component.ImplantedEntity == null)
|
if (component.ImplantedEntity is not { } ent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var newIdentity = _polymorph.PolymorphEntity(component.ImplantedEntity.Value, "Scrambled");
|
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid))
|
||||||
|
|
||||||
//checks if someone is trying to use a dna scrambler implant while already scrambled
|
|
||||||
if (newIdentity == null)
|
|
||||||
{
|
{
|
||||||
_popup.PopupEntity(Loc.GetString("scramble-attempt-while-scrambled-popup"), component.ImplantedEntity.Value, component.ImplantedEntity.Value);
|
var newProfile = HumanoidCharacterProfile.RandomWithSpecies(humanoid.Species);
|
||||||
return;
|
_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;
|
args.Handled = true;
|
||||||
QueueDel(uid);
|
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-emp-implant-action-description = Triggers a small EMP pulse around you
|
||||||
|
|
||||||
use-dna-scrambler-implant-action-name = Scramble DNA
|
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
|
## Implant Popups
|
||||||
|
|
||||||
scramble-attempt-while-scrambled-popup = Scrambled DNA detected, please extract implant before undoing the current scramble.
|
scramble-implant-activated-popup = Your appearance shifts and changes!
|
||||||
scramble-implant-activated-popup = You transformed into {$identity}
|
|
||||||
|
|
||||||
## Implant Messages
|
## Implant Messages
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,3 @@
|
||||||
- type: NpcFactionMember
|
- type: NpcFactionMember
|
||||||
factions:
|
factions:
|
||||||
- Syndicate
|
- Syndicate
|
||||||
|
|
||||||
# DNA Scrambler
|
|
||||||
- type: entity
|
|
||||||
parent: MobHuman
|
|
||||||
id: MobHumanScrambled
|
|
||||||
name: Scrambled Human
|
|
||||||
components:
|
|
||||||
- type: RandomHumanoidAppearance
|
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,6 @@
|
||||||
forced: true
|
forced: true
|
||||||
duration: 30
|
duration: 30
|
||||||
|
|
||||||
- type: polymorph
|
|
||||||
id: Scrambled
|
|
||||||
entity: MobHumanScrambled
|
|
||||||
forced: false
|
|
||||||
inventory: Transfer
|
|
||||||
revertOnCrit: true
|
|
||||||
revertOnDeath: true
|
|
||||||
|
|
||||||
- type: polymorph
|
- type: polymorph
|
||||||
id: Chicken
|
id: Chicken
|
||||||
entity: MobChicken
|
entity: MobChicken
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue