diff --git a/Content.Client/_Starlight/Medical/Surgery/CustomLimbVisualizerSystem.cs b/Content.Client/_Starlight/Medical/Surgery/CustomLimbVisualizerSystem.cs index 71adf34741..ac438756ce 100644 --- a/Content.Client/_Starlight/Medical/Surgery/CustomLimbVisualizerSystem.cs +++ b/Content.Client/_Starlight/Medical/Surgery/CustomLimbVisualizerSystem.cs @@ -121,6 +121,7 @@ public sealed class CustomLimbVisualizerSystem : EntitySystem { var index = sprite.LayerMapReserveBlank($"custom-{layer}"); sprite.LayerSetVisible(layer, false); + sprite.LayerSetVisible($"custom-{layer}", false); } } } diff --git a/Content.Server/_Starlight/Medical/Limbs/LimbSystem.Visual.cs b/Content.Server/_Starlight/Medical/Limbs/LimbSystem.Visual.cs index 7b5fad4af2..3f0c4e8ee2 100644 --- a/Content.Server/_Starlight/Medical/Limbs/LimbSystem.Visual.cs +++ b/Content.Server/_Starlight/Medical/Limbs/LimbSystem.Visual.cs @@ -4,10 +4,10 @@ using Content.Shared._Sunrise; using Content.Shared.Body.Components; using Content.Shared.Body.Part; using Content.Shared.Humanoid; -using Content.Shared.Humanoid.Prototypes; using Content.Shared.Starlight; namespace Content.Server._Starlight.Medical.Limbs; + public sealed partial class LimbSystem : SharedLimbSystem { public void AddLimbVisual(Entity body, Entity limb) diff --git a/Content.Server/_Starlight/Medical/Limbs/LimbSystem.cs b/Content.Server/_Starlight/Medical/Limbs/LimbSystem.cs index f5b0393865..ddc4ca3c10 100644 --- a/Content.Server/_Starlight/Medical/Limbs/LimbSystem.cs +++ b/Content.Server/_Starlight/Medical/Limbs/LimbSystem.cs @@ -1,4 +1,4 @@ -using System.Linq; +using Content.Server.Administration.Systems; using Content.Server.Body.Systems; using Content.Server.Hands.Systems; using Content.Server.Humanoid; @@ -8,14 +8,13 @@ using Content.Shared.Body.Components; using Content.Shared.Body.Part; using Content.Shared.Hands.Components; using Content.Shared.Humanoid; -using Content.Shared.Humanoid.Prototypes; using Content.Shared.Interaction.Components; -using Content.Shared.Starlight; using Content.Shared.Starlight.Medical.Surgery; using Robust.Server.Containers; using Robust.Shared.Prototypes; namespace Content.Server._Starlight.Medical.Limbs; + public sealed partial class LimbSystem : SharedLimbSystem { [Dependency] private readonly ContainerSystem _containers = default!; @@ -24,6 +23,7 @@ public sealed partial class LimbSystem : SharedLimbSystem [Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearanceSystem = default!; [Dependency] private readonly MetaDataSystem _metadata = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly StarlightEntitySystem _entity = default!; private readonly EntProtoId _virtual = "PartVirtual"; public override void Initialize() @@ -64,7 +64,7 @@ public sealed partial class LimbSystem : SharedLimbSystem return true; } - public void Amputatate(Entity body, Entity limb) + public void Amputate(Entity body, Entity limb) { if (!_containers.TryGetContainingContainer((limb.Owner, limb.Comp1, limb.Comp2), out var container) || _body.GetParentPartAndSlotOrNull(limb.Owner) is not var (_, slotId) @@ -72,10 +72,10 @@ public sealed partial class LimbSystem : SharedLimbSystem if (TryComp(limb, out var virtualLimb)) AmputateItemLimb((body, body.Comp1, body.Comp3), limb, slotId, virtualLimb); - else + else if (_entity.TryEntity(limb, out var bodyPart)) { - RemoveLimbVisual(body, limb); - RemoveLimb(body, limb); + RemoveLimbVisual(body, bodyPart); + RemoveLimb(body, bodyPart); } } @@ -87,7 +87,7 @@ public sealed partial class LimbSystem : SharedLimbSystem Dirty(body, vizualizer); } - private void AmputateItemLimb(Entity body, Entity limb, string slotId, CustomLimbComponent virtualLimb) + private void AmputateItemLimb(Entity body, Entity limb, string slotId, CustomLimbComponent virtualLimb) { RemoveItemLimb(body, virtualLimb.Item, BodySystem.GetPartSlotContainerId(slotId)); diff --git a/Content.Server/_Starlight/Medical/Surgery/SurgerySystem.Steps.cs b/Content.Server/_Starlight/Medical/Surgery/SurgerySystem.Steps.cs index c8a2200d4d..a684fb9a78 100644 --- a/Content.Server/_Starlight/Medical/Surgery/SurgerySystem.Steps.cs +++ b/Content.Server/_Starlight/Medical/Surgery/SurgerySystem.Steps.cs @@ -7,10 +7,8 @@ using Content.Shared.Body.Components; using Content.Shared.Body.Organ; using Content.Shared.Body.Part; using Content.Shared.Body.Systems; -using Content.Shared.Damage; using Content.Shared.Humanoid; using Content.Shared.Traits.Assorted; -using Microsoft.CodeAnalysis; using Content.Server._Starlight.Medical.Limbs; using Content.Server.Administration.Systems; using Content.Shared.Bed.Sleep; @@ -170,8 +168,8 @@ public sealed partial class SurgerySystem : SharedSurgerySystem private void OnStepAmputationComplete(Entity ent, ref SurgeryStepEvent args) { if (_entity.TryEntity(args.Body, out var body) - && _entity.TryEntity(args.Part, out var limb)) - _limbSystem.Amputatate(body, limb); + && _entity.TryEntity(args.Part, out var limb)) + _limbSystem.Amputate(body, limb); } private void CustomLimbRemoved(Entity ent, ref ComponentRemove args) diff --git a/Resources/Prototypes/Body/Parts/base.yml b/Resources/Prototypes/Body/Parts/base.yml index 8f3a62cc38..64379630c0 100644 --- a/Resources/Prototypes/Body/Parts/base.yml +++ b/Resources/Prototypes/Body/Parts/base.yml @@ -21,7 +21,6 @@ tags: - Trash # Sunrise-start - - type: SurgeryTarget - type: UserInterface interfaces: enum.SurgeryUIKey.Key: diff --git a/Resources/Prototypes/Entities/Objects/base_item.yml b/Resources/Prototypes/Entities/Objects/base_item.yml index 5eb4527bc1..627b3023e3 100644 --- a/Resources/Prototypes/Entities/Objects/base_item.yml +++ b/Resources/Prototypes/Entities/Objects/base_item.yml @@ -48,6 +48,7 @@ voice: Portal2FactCore # Sunrise-TTS - type: StaticPrice price: 0 # Sunrise-TTS + - type: SurgeryTarget # Sunrise added - type: entity name: "storage item"