Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surgery and Wounds (kinda) port from Delta-V #1272

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4da9a78
SHITMED REAL
gluesniffler Nov 16, 2024
d3e8777
pr 2
deltanedas Nov 17, 2024
5beb83c
commit 3
deltanedas Nov 18, 2024
bde47e7
they did surgery on a fish (#889)
deltanedas Nov 18, 2024
ec2288b
SO MANY COMMITS
gluesniffler Nov 18, 2024
414dda2
Hotfix for broken organ transplants (#933)
gluesniffler Nov 22, 2024
bb07a29
allow cloning living people (#932)
deltanedas Nov 23, 2024
5cf6698
fix borg limbs and make borg legs good (#916)
deltanedas Nov 23, 2024
10a6051
Shitmed Surgery Popups (EE Port) (#918)
angelofallars Nov 21, 2024
741fb31
shitmed is killign me
gluesniffler Nov 25, 2024
30ded5d
Minor Shitmed Bugfixes (#971)
gluesniffler Nov 26, 2024
b71c8a0
fix surgerytarget check (#972)
deltanedas Nov 26, 2024
943a201
surgery changes for autodoc (#969)
deltanedas Nov 26, 2024
c48e8c6
make any sharp item a ghetto surgery tool (#990)
deltanedas Nov 27, 2024
667dfcd
I LOVE COMMITS I LOVE THEM I LOVE THEM SO MUCH I LOVE DOING SO MANY O…
gluesniffler Nov 29, 2024
ba07c74
add autodoc (#970)
deltanedas Nov 29, 2024
38e0b9a
HI
gluesniffler Dec 2, 2024
ae63e54
Fix operating table test fail (#1041)
gluesniffler Dec 2, 2024
da8b419
Dying
gluesniffler Dec 11, 2024
7406577
Hi
Dec 27, 2024
cdbaf36
fix
Piras314 Dec 18, 2024
0827618
RAH
Dec 27, 2024
90e5af3
FIX
Dec 27, 2024
8f6fcf5
give borgs targeting
Dec 29, 2024
a2fb689
make mousetraps damage your feet
Dec 31, 2024
64af2a3
make limbs gib at 200 pierce
Jan 4, 2025
e988787
fix pierce not severing
Jan 4, 2025
d30557a
remove funny thing
Jan 4, 2025
6b2a9ec
hopefully fix the laying down mispredicts
Jan 4, 2025
3c715a2
evil surgery damage and change stuff to work for it
Jan 4, 2025
5cadfa6
spacing does 1/5 damage to limbs
Jan 6, 2025
d3e511a
nerf tending and ribcage ops
Jan 7, 2025
719d726
fixes and such
honeyed-lemons Jan 9, 2025
14042db
fix grey organs... and im so so sorry but lungs cannot be in their he…
honeyed-lemons Jan 9, 2025
44e6e95
More impstation species specific fixes
honeyed-lemons Jan 9, 2025
479f0d6
Move laying down CCVAR
honeyed-lemons Jan 9, 2025
a876053
revert cloning working on alive people
honeyed-lemons Jan 9, 2025
6c2916c
make limb severing bleed instead of bloodloss damage (#2668)
deltanedas Jan 9, 2025
fc48025
Remove gastropod legs and feet, and adjusts code to account for it!
honeyed-lemons Jan 10, 2025
b87cdd2
Decapoid lung fix, gastropod damage fix
honeyed-lemons Jan 10, 2025
9709194
Decapoid hand refactor!
honeyed-lemons Jan 11, 2025
8aaf91f
Merge branch 'master' into shitmed-dv
honeyed-lemons Jan 11, 2025
539008c
Fix gastropod damage stuff
honeyed-lemons Jan 11, 2025
79ff1c5
Add tank harnesses to medical fabricator
Radezolid Jan 10, 2025
bb49ecc
Tank harnesses and surgical gowns can be worn during surgery
sowelipililimute Jan 10, 2025
ad4907f
Changeling changes. Absorbing removes all organs and now only deals 1…
honeyed-lemons Jan 11, 2025
8728afd
Moves attachitemtohand stuff and fixes lots of tiny tiny itty bitty i…
honeyed-lemons Jan 12, 2025
a67f34f
Replace ForcedSleep with Anesthesia for surgery (#2684)
sowelipililimute Jan 11, 2025
7761cd4
Make chloral hydrate better suited for use as anesthesia (#2685)
sowelipililimute Jan 11, 2025
a1651c4
Fix namespace
honeyed-lemons Jan 12, 2025
a985f6d
Merge branch 'master' into shitmed-dv
honeyed-lemons Jan 21, 2025
6df37ee
bodypart refactor (#2718)
deltanedas Jan 18, 2025
4c0b0fd
Github yaml linter save me...
honeyed-lemons Jan 21, 2025
26d3e1e
AttachItemToHand refactor
honeyed-lemons Jan 21, 2025
fa7eb12
FIXED IT FIXED IT I FIXED IT I DID IT
honeyed-lemons Jan 23, 2025
2fb4847
surgery and shitmed tweaks (#2721)
Lyndomen Jan 16, 2025
0e9883c
add bloodloss cryo meds (#2727)
cjhveal Jan 15, 2025
7f8c872
update goblin to use new stuff, give apids insect blood in their body…
honeyed-lemons Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
69 changes: 69 additions & 0 deletions Content.Client/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,76 @@
using Content.Shared.Body.Systems;
// Shitmed Change Start
using Content.Shared._Shitmed.Body.Part;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
using Content.Shared.Body.Components;
// Shitmed Change End

namespace Content.Client.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
// Shitmed Change Start
[Dependency] private readonly MarkingManager _markingManager = default!;

private void ApplyMarkingToPart(MarkingPrototype markingPrototype,
IReadOnlyList<Color>? colors,
bool visible,
SpriteComponent sprite)
{
for (var j = 0; j < markingPrototype.Sprites.Count; j++)
{
var markingSprite = markingPrototype.Sprites[j];

if (markingSprite is not SpriteSpecifier.Rsi rsi)
continue;

var layerId = $"{markingPrototype.ID}-{rsi.RsiState}";

if (!sprite.LayerMapTryGet(layerId, out _))
{
var layer = sprite.AddLayer(markingSprite, j + 1);
sprite.LayerMapSet(layerId, layer);
sprite.LayerSetSprite(layerId, rsi);
}

sprite.LayerSetVisible(layerId, visible);

if (!visible)
continue;

// Okay so if the marking prototype is modified but we load old marking data this may no longer be valid
// and we need to check the index is correct. So if that happens just default to white?
if (colors != null && j < colors.Count)
sprite.LayerSetColor(layerId, colors[j]);
else
sprite.LayerSetColor(layerId, Color.White);
}
}

protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceComponent component)
{
if (!TryComp(target, out SpriteComponent? sprite))
return;

if (component.Color != null)
sprite.Color = component.Color.Value;

foreach (var (visualLayer, markingList) in component.Markings)
foreach (var marking in markingList)
{
if (!_markingManager.TryGetMarking(marking, out var markingPrototype))
continue;

ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite);
}
}

protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
{
return;
}
// Shitmed Change End
}
33 changes: 33 additions & 0 deletions Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared._Shitmed.Body.Events; // Shitmed Change
using Content.Client.DisplacementMap;
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Verbs.UI;
using Content.Shared.Body.Part; // Shitmed Change
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -51,6 +53,8 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved); // Shitmed Change
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled); // Shitmed Change

OnHandSetActive += OnHandActivated;
}
Expand Down Expand Up @@ -240,6 +244,35 @@ public void UIHandAltActivateItem(string handName)

#region visuals

// Shitmed Change Start
private void HideLayers(EntityUid uid, HandsComponent component, Entity<BodyPartComponent> part, SpriteComponent? sprite = null)
{
if (part.Comp.PartType != BodyPartType.Hand || !Resolve(uid, ref sprite, logMissing: false))
return;

var location = part.Comp.Symmetry switch
{
BodyPartSymmetry.None => HandLocation.Middle,
BodyPartSymmetry.Left => HandLocation.Left,
BodyPartSymmetry.Right => HandLocation.Right,
_ => throw new ArgumentOutOfRangeException(nameof(part.Comp.Symmetry))
};

if (component.RevealedLayers.TryGetValue(location, out var revealedLayers))
{
foreach (var key in revealedLayers)
sprite.RemoveLayer(key);

revealedLayers.Clear();
}
}

private void HandleBodyPartRemoved(EntityUid uid, HandsComponent component, ref BodyPartRemovedEvent args) => HideLayers(uid, component, args.Part);

private void HandleBodyPartDisabled(EntityUid uid, HandsComponent component, ref BodyPartDisabledEvent args) => HideLayers(uid, component, args.Part);

// Shitmed Change End

protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
{
base.HandleEntityInserted(uid, hands, args);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.MedicalScanner;
using Content.Shared._Shitmed.Targeting; // Shitmed Change
using JetBrains.Annotations;
using Robust.Client.UserInterface;

Expand All @@ -19,10 +20,11 @@ protected override void Open()
base.Open();

_window = this.CreateWindow<HealthAnalyzerWindow>();

_window.OnBodyPartSelected += SendBodyPartMessage; // Shitmed Change
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
}


protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
if (_window == null)
Expand All @@ -33,5 +35,21 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message)

_window.Populate(cast);
}

// Shitmed Change Start
private void SendBodyPartMessage(TargetBodyPart? part, EntityUid target) => SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part ?? null));
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

if (_window != null)
_window.OnBodyPartSelected -= SendBodyPartMessage;

_window?.Dispose();
}

// Shitmed Change End
}
}
Loading