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

Shitmed: Implementing Existing Newmed Code Into SS14 #1159

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9ba5958
this might be the biggest piece of shitmed drama
gluesniffler Oct 5, 2024
cd6c0ce
Added layout for the proper bodydoll
gluesniffler Oct 6, 2024
0f6c2ab
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
gluesniffler Oct 6, 2024
989d831
Added body doll, and currently broken status doll.
gluesniffler Oct 6, 2024
06e2a1c
forgor to add this shit
gluesniffler Oct 7, 2024
c4ff6b5
Added body status doll, added real squares to doll, tweaked part removal
gluesniffler Oct 9, 2024
87e45f3
Update 2, body doll, severing drops, healing and command binds
gluesniffler Oct 12, 2024
2e0b0bb
Changed canTarget for a multiplier that can go on calls to TryChangeD…
gluesniffler Oct 13, 2024
da41313
surgery real
gluesniffler Oct 14, 2024
fa5a39d
Small checkpoint save
gluesniffler Oct 16, 2024
8c24925
Bunch o updates for the weekend.
gluesniffler Oct 21, 2024
c9cb2b8
Added malpractice penalties, repeatable tend wounds surgeries, body p…
gluesniffler Oct 23, 2024
a1fec38
insertion surgery, some fixes to wound tending
gluesniffler Oct 25, 2024
d20684e
Busting bugs
gluesniffler Oct 26, 2024
6ccc751
buggymed
gluesniffler Oct 26, 2024
2e785a2
Draft PR commit.
gluesniffler Oct 28, 2024
285c468
this is all shitcode
gluesniffler Oct 28, 2024
87a2520
another attempt?
gluesniffler Oct 28, 2024
57563a9
saving before switching to master
gluesniffler Oct 28, 2024
3ea0335
fixed part reattachment slots and cavity implant surgery
gluesniffler Oct 29, 2024
fd206e8
removed loggers trol
gluesniffler Oct 29, 2024
990fa8a
leaving some tests running
gluesniffler Oct 30, 2024
716811d
Fixed a buncho crap
gluesniffler Oct 31, 2024
917ade3
Added some experimental lag fixes to surgery. Might have crashes
gluesniffler Nov 2, 2024
3ca30f8
defelinization almost real
gluesniffler Nov 6, 2024
1d38934
Merge pull request #169 from XavierSomething/HealthAnalyzerUIWizden
FoxxoTrystan Sep 3, 2024
f3af74f
Fix medical PDA/health analyzer long range intel bug (#31879)
goet Sep 21, 2024
bd11689
Add health analyzer unrevivability warning (#32636)
SaphireLattice Oct 26, 2024
4c17800
helth
gluesniffler Nov 7, 2024
86eac6e
fixed some rich text issues
gluesniffler Nov 7, 2024
42c77fa
Merge branch 'health' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 7, 2024
56317c9
health analyzer real
gluesniffler Nov 7, 2024
1a0e84a
Update genericNegativeEffects.yml
gluesniffler Nov 8, 2024
8a7d372
Merge branch 'master' into SHITMED
gluesniffler Nov 11, 2024
553cd05
Please do not cherrypick this one yet.
gluesniffler Nov 12, 2024
ed03916
Merge branch 'SHITMED' of https://github.com/gluesniffler/Einstein-En…
gluesniffler Nov 12, 2024
c78d43c
guh forgot to merge upstream
gluesniffler Nov 12, 2024
7c49056
Merge branch 'master' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 12, 2024
243c93e
test change to see if rt shuts up
gluesniffler Nov 12, 2024
b1fe563
Refactored body parts to use damageablecomponent
gluesniffler Nov 13, 2024
db84845
fixed the funny detachment exception lmao, need to refactor some shit…
gluesniffler Nov 13, 2024
b3c8941
newmed health analyzer real, also refactors and some bugfixes
gluesniffler Nov 14, 2024
85964e4
somewhat stable release
gluesniffler Nov 14, 2024
e58d88a
Quick patch to see if tests shut up
gluesniffler Nov 14, 2024
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
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class BrainComponent : Component
{
}
}
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class LungComponent : Component
{
}
}
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class StomachComponent : Component
{
}
}
76 changes: 76 additions & 0 deletions Content.Client/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,83 @@
using Content.Shared.Body.Systems;
using Content.Shared.Body.Part;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
using Content.Shared.Body.Components;

namespace Content.Client.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
[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;
}
}
43 changes: 42 additions & 1 deletion Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Verbs.UI;
using Content.Shared.Body.Part;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -38,7 +39,6 @@ public sealed class HandsSystem : SharedHandsSystem
public event Action<string, EntityUid>? OnPlayerItemRemoved;
public event Action<string>? OnPlayerHandBlocked;
public event Action<string>? OnPlayerHandUnblocked;

public override void Initialize()
{
base.Initialize();
Expand All @@ -49,6 +49,8 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled);

OnHandSetActive += OnHandActivated;
}
Expand Down Expand Up @@ -236,8 +238,46 @@ public void UIHandAltActivateItem(string handName)
RaisePredictiveEvent(new RequestHandAltInteractEvent(handName));
}

#region pulling

#endregion

#region visuals

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);
}

protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
{
base.HandleEntityInserted(uid, hands, args);
Expand All @@ -262,6 +302,7 @@ protected override void HandleEntityRemoved(EntityUid uid, HandsComponent hands,

if (!hands.Hands.TryGetValue(args.Container.ID, out var hand))
return;

UpdateHandVisuals(uid, args.Entity, hand);
_stripSys.UpdateUi(uid);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.MedicalScanner;
using Content.Shared.Targeting;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

Expand All @@ -22,6 +23,7 @@ protected override void Open()
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};
_window.OnClose += Close;
_window.OnBodyPartSelected += SendBodyPartMessage;
_window.OpenCentered();
}

Expand All @@ -36,14 +38,25 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message)
_window.Populate(cast);
}

private void SendBodyPartMessage(TargetBodyPart? part, EntityUid target)
{
if (part == null)
SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), null));
else
SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part.Value));
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

if (_window != null)
{
_window.OnClose -= Close;
_window.OnBodyPartSelected -= SendBodyPartMessage;
}

_window?.Dispose();
}
Expand Down
Loading
Loading