Skip to content

Commit

Permalink
Хирургия (попытка 2) (#65)
Browse files Browse the repository at this point in the history
* The ShitMed

* Fixes

fix locale

* Delete redudant systems

* fix components

* fix error, update system

* Update BodyPartComponent.cs

* fix max health, fix test legs

* fix test

* Port fixes from EE (space-syndicate#875)

* [Fix] Healing Fixes (space-syndicate#874)

* Targeting & Healing Fixes

* Update Content.Server/Medical/HealingSystem.cs

Co-authored-by: gluesniffler <[email protected]>

* Fix Vital Damage

* Update BodyPartComponent.cs

* fix

---------

Co-authored-by: gluesniffler <[email protected]>

* [Port] Surgery fixes: Part 2 (space-syndicate#876)

* Fix a ton of shitmed

Fixed a buncho crap

* Guidebook

* Russian Locale

* fix

* hotfix added Rxup/space-station-14@e92f013

---------

Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: Zack Backmen <[email protected]>
Co-authored-by: Token <github.com/TokenStyle>

* remove backmen ccvar

* Body doll in the Health Analyzer menu (space-syndicate#877)

* fixes and fix guidebook paths (space-syndicate#887)

* fixes

* Added some experimental lag fixes to surgery. Might have crashes

* russian locale

* Revert "Added some experimental lag fixes to surgery. Might have crashes"

This reverts commit de95d85.

* [Port] Surgery fixes: Part 3 (space-syndicate#892)

* Added some experimental lag fixes to surgery. Might have crashes

* Fix

* migrate and add comments to shit

* fix

---------

Co-authored-by: gluesniffler <[email protected]>

* [Tweak] Rework BodyPartComponent to use DamageSpecifier (space-syndicate#890)

* Rework BodyPart to use DamageSpecifier

* Fix that shit

* Update Content.Shared/Backmen/Surgery/Body/SharedBodySystem.Integrity.cs

Co-authored-by: gluesniffler <[email protected]>

* Uh?

* Update HealthAnalyzerWindow.xaml.cs

* balanced a buncho crap

---------

Co-authored-by: gluesniffler <[email protected]>

* [Port] Surgery fixes: Part 4 (space-syndicate#909)

* defelinization almost real

* fix?

* Corvax next fix that surgery doesn't work with fatal error

---------

Co-authored-by: gluesniffler <[email protected]>
Roudenn: Rxup/space-station-14#909

* [Fix] surgery emergency fix

* Fixed mechanics of attaching body parts to Body. (now taken from prototypes, not generated at random)

---------

Co-authored-by: gluesniffler <[email protected]>
KayzelW: Rxup/space-station-14#912

* [Balance] Surgery healing tweaks (space-syndicate#911)

* Balance surgery

* Fix Severing parts

---------

Co-authored-by: gluesniffler <[email protected]>
Roudenn: Rxup/space-station-14#911

* [Port] Surgery Update V: The Phantom Gib (space-syndicate#919)

* Megasquached Surgery Updates

Megasquached Surgery Updates

Quick patch to see if tests shut up

Refactored body parts to use damageablecomponent

newmed health analyzer real, also refactors and some bugfixes

* added solidus's comments, pending removal of namespace thingies for this repo, also fixed some healing thingies

* fixes?

* fix gib torso

* fix prototypes

* oops

---------

Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: Zack Backmen <[email protected]>
Roudenn: Rxup/space-station-14#919

* let me pass tests

* let me pass test pls

* let me pass test pls

* let me pass tests

* chief medical officer pass tests

* no felinid ears no fun pass tests

* [Port] Surgery Fixes: Popup Walker (space-syndicate#923)

* Megasquached Surgery Updates

Megasquached Surgery Updates

Quick patch to see if tests shut up

Please do not cherrypick this one yet.

Refactored body parts to use damageablecomponent

newmed health analyzer real, also refactors and some bugfixes

* added solidus's comments, pending removal of namespace thingies for this repo, also fixed some healing thingies

* fixes?

* fix gib torso

* fix prototypes

* oops

* Shitmed Update 1 (space-syndicate#1240)

First in a series of PRs to introduce bugfixes and updates to Shitmed,
this will generally feature PRs from Goobstation or Backmen as well
since they are actively helping me maintain the code.

Usual Shoutouts:
Deltanedas: Goob-Station/Goob-Station#882

---

:cl: Mocho, Deltanedas
- add: You can now perform surgery as a monke. Rejoice.
- add: You can perform surgery on a lot of animals now, I missed a lot
of them so just ask if you want any particular critter to get it.
- tweak: Entities now perish after 60 seconds of losing their heart
and/or brain.
- fix: Entities properly take asphyxiation damage after losing their
brain.
- fix: Torsos being gibbable, which would break surgery or just about
anything.
- fix: Items not being removed from their respective slots if the parts
were gibbed rather than dropped.
- fix: Animal organs not being usable properly in surgeries
- fix: Cyborg limbs are now usable as pseudo-peg arm/legs.

---------

Signed-off-by: gluesniffler <[email protected]>
Co-authored-by: FoxxoTrystan <[email protected]>
Co-authored-by: goet <[email protected]>
Co-authored-by: Saphire Lattice <[email protected]>
Co-authored-by: Roudenn <[email protected]>

* Shitmed Surgery Popups (space-syndicate#1241)

Adds popups for surgery steps in Shitmed that every player within PVS
range can see. This allows other players to see if the correct procedure
is being performed. This PR also includes locale text for the new
procedures and steps in space-syndicate#1240.

**Remove Brain / Insert Brain**

https://github.com/user-attachments/assets/ac20afa1-df74-48ab-b1d5-2e9a273dfba2

<details><summary>See more</summary>

**Amputate Right Arm**

https://github.com/user-attachments/assets/17f78683-6d3b-44ee-aea3-bb6987844fdc

**Attach Right Arm**

https://github.com/user-attachments/assets/584d4da2-d8b0-4c82-a323-26636e7fa4b8

</details>

:cl: Skubman
- add: Surgery step descriptions (like making an incision,
removing/attaching limbs and organs) are now shown as popups to everyone
in range upon the start of the step. This makes it clear which surgical
procedure is being done and to which body part. No more stealthy
brain-stealing in front of everyone!

* fix the things + locale

---------

Signed-off-by: gluesniffler <[email protected]>
Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: Zack Backmen <[email protected]>
Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: FoxxoTrystan <[email protected]>
Co-authored-by: goet <[email protected]>
Co-authored-by: Saphire Lattice <[email protected]>
Co-authored-by: Skubman <[email protected]>

* [PORT]Health Analyzer update (space-syndicate#925)

Add amazing Health analyzer UI.
Rxup/space-station-14#925

* Update HealthAnalyzerSystem.cs

* Update medical-scanner-component.ftl

* Update HealthAnalyzerWindow.xaml.cs

* Update health-analyzer-component.ftl

* fix

---------

Co-authored-by: trest100 <[email protected]>

* let me pass tests

* remove shadowkin let tests pass

* first commit

* Revert "first commit" formatting changes

Reverted only formats though, being saved moves everythin to appropriate folders, and nice and clean
This reverts commit e66b04b.

* add corvax next comments for changes for easier upstreams

Be aware though, that everything that related to BodySystem, OrganComponent, DamageSystem etc was changed completely

- add comments _CorvaxNext
- moved .ftl files and cvars to appropriate Corvax Next folders
- removed unnecessary felinids and silicon_base

* namespaces changes for everythin

* Revert "namespaces changes for everythin"

This reverts commit 221ee3e.

* [Fix] Surgery Hotfix: Head and Limbs dissapears

---------

Signed-off-by: gluesniffler <[email protected]>
Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: Roudenn <[email protected]>
Co-authored-by: Zack Backmen <[email protected]>
Co-authored-by: Rouden <[email protected]>
Co-authored-by: gluesniffler <[email protected]>
Co-authored-by: FoxxoTrystan <[email protected]>
Co-authored-by: goet <[email protected]>
Co-authored-by: Saphire Lattice <[email protected]>
Co-authored-by: Skubman <[email protected]>
Co-authored-by: Trest <[email protected]>
Co-authored-by: AwareFoxy <[email protected]>
Co-authored-by: AwareFoxy <[email protected]>
  • Loading branch information
13 people authored Nov 22, 2024
1 parent 585ef2e commit fdb6e27
Show file tree
Hide file tree
Showing 401 changed files with 8,913 additions and 409 deletions.
7 changes: 0 additions & 7 deletions Content.Client/Body/Systems/BodySystem.cs

This file was deleted.

37 changes: 36 additions & 1 deletion Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,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 @@ -40,7 +41,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 @@ -51,6 +51,8 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved); // _CorvaxNext: surgery
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled); // _CorvaxNext: surgery

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

#region pulling

#endregion

#region visuals

// start-_CorvaxNext: surgery
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);
// end-_CorvaxNext: surgery

protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
{
base.HandleEntityInserted(uid, hands, args);
Expand All @@ -264,6 +298,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,6 +1,7 @@
using Content.Shared.MedicalScanner;
using Content.Shared._CorvaxNext.Targeting;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
using Robust.Client.GameObjects;

namespace Content.Client.HealthAnalyzer.UI
{
Expand All @@ -17,10 +18,13 @@ public HealthAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owne
protected override void Open()
{
base.Open();

_window = this.CreateWindow<HealthAnalyzerWindow>();

_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
_window = new HealthAnalyzerWindow
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};
_window.OnClose += Close;
_window.OnBodyPartSelected += SendBodyPartMessage;
_window.OpenCentered();
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand All @@ -33,5 +37,22 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message)

_window.Populate(cast);
}

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.OnClose -= Close;
_window.OnBodyPartSelected -= SendBodyPartMessage;
}

_window?.Dispose();
}
}
}
222 changes: 196 additions & 26 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<controls:FancyWindow
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
MaxHeight="525"
MinWidth="300">
MinWidth="350">
<ScrollContainer
Margin="5 5 5 5"
ReturnMeasure="True"
Expand All @@ -13,45 +13,215 @@
Orientation="Vertical">
<Label
Name="NoPatientDataText"
Text="{Loc health-analyzer-window-no-patient-data-text}" />

Text="{Loc health-analyzer-window-no-patient-data-text}"/>
<Button Name="ReturnButton"
Text="{Loc 'health-analyzer-window-return-button-text'}"
Margin="0 0 0 10"
HorizontalExpand="False"/>
<BoxContainer
Name="PatientDataContainer"
Margin="0 0 0 5"
Orientation="Vertical">
<BoxContainer Orientation="Horizontal" Margin="0 0 0 5">
<SpriteView OverrideDirection="South" Scale="2 2" Name="SpriteView" Access="Public" SetSize="64 64" />
<TextureRect Name="NoDataTex" Access="Public" SetSize="64 64" Visible="false" Stretch="KeepAspectCentered" TexturePath="/Textures/Interface/Misc/health_analyzer_out_of_range.png"/>
<BoxContainer Margin="5 0 0 0" Orientation="Vertical" VerticalAlignment="Top">
<RichTextLabel Name="NameLabel" SetWidth="150" />
<Label Name="SpeciesLabel" VerticalAlignment="Top" StyleClasses="LabelSubText" />
<BoxContainer Orientation="Horizontal"
Margin="0 0 0 5">
<PanelContainer>
<SpriteView OverrideDirection="South"
Scale="2.5 2.5"
Name="SpriteView"
Access="Public"
SetSize="96 96"/>
<PanelContainer
Name="PartView"
SetSize="57 96"
Margin="18 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Left">
<PanelContainer
SetSize="15 33"
Margin="4 0 0 0"
HorizontalAlignment="Left">
<TextureButton
Name="RightArmButton"
MinSize="15 25"
StyleClasses="TargetDollButtonRightArm"
VerticalAlignment="Top">
</TextureButton>
<TextureButton
Name="RightHandButton"
MinSize="15 15"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonRightHand">
</TextureButton>
</PanelContainer>
<PanelContainer
SetSize="43 75"
Margin="0 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextureButton
Name="HeadButton"
MinSize="28 23"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonHead">
<!--<PanelContainer
SetSize="15 15"
Margin="0 9 0 0"
HorizontalAlignment="Center">
<TextureButton
Name="EyesButton"
MinSize="15 9"
VerticalAlignment="Top"
StyleClasses="TargetDollButtonEyes">
<TextureRect
TexturePath="/Textures/Interface/Targeting/Doll/eyes.png"
Stretch="KeepAspectCentered"
SetSize="15 9"/>
</TextureButton>
<TextureButton
Name="MouthButton"
SetSize="9 6"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonMouth">
<TextureRect
TexturePath="/Textures/Interface/Targeting/Doll/mouth.png"
Stretch="KeepAspectCentered"
SetSize="9 6"/>
</TextureButton>
</PanelContainer>-->
</TextureButton>
<TextureButton
Name="ChestButton"
SetSize="28 30"
Margin="0 18 0 0"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonChest">
</TextureButton>
<PanelContainer
MinSize="38 35"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<TextureButton
Name="GroinButton"
MinSize="28 15"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonGroin">
</TextureButton>
<PanelContainer
MinSize="20 30"
VerticalAlignment="Bottom"
HorizontalAlignment="Right">
<TextureButton
Name="LeftLegButton"
MinSize="15 28"
VerticalAlignment="Top"
HorizontalAlignment="Left"
StyleClasses="TargetDollButtonLeftLeg">
</TextureButton>
<TextureButton
Name="LeftFootButton"
MinSize="20 10"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonLeftFoot">
</TextureButton>
</PanelContainer>
<PanelContainer
MinSize="20 30"
VerticalAlignment="Bottom"
HorizontalAlignment="Left">
<TextureButton
Name="RightLegButton"
MinSize="15 28"
VerticalAlignment="Top"
HorizontalAlignment="Right"
StyleClasses="TargetDollButtonRightLeg">
</TextureButton>
<TextureButton
Name="RightFootButton"
MinSize="20 10"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonRightFoot">
</TextureButton>
</PanelContainer>
</PanelContainer>
</PanelContainer>
<PanelContainer
SetSize="15 33"
Margin="0 0 4 0"
HorizontalAlignment="Right">
<TextureButton
Name="LeftArmButton"
MinSize="15 25"
StyleClasses="TargetDollButtonLeftArm"
VerticalAlignment="Top">
</TextureButton>
<TextureButton
Name="LeftHandButton"
MinSize="15 15"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonLeftHand">
</TextureButton>
</PanelContainer>
</PanelContainer>
</PanelContainer>
<TextureRect Name="NoDataTex"
Access="Public"
SetSize="64 64"
Visible="false"
Stretch="KeepAspectCentered"
TexturePath="/Textures/Interface/Misc/health_analyzer_out_of_range.png"/>
<BoxContainer Margin="5 0 0 0"
Orientation="Vertical"
VerticalAlignment="Top">
<RichTextLabel Name="NameLabel"
SetWidth="150"/>
<Label Name="SpeciesLabel"
VerticalAlignment="Top"
StyleClasses="LabelSubText"/>
<Label Name="PartNameLabel"
VerticalAlignment="Bottom"
StyleClasses="LabelSubText"/>
</BoxContainer>
<Label Margin="0 0 5 0" HorizontalExpand="True" HorizontalAlignment="Right" VerticalExpand="True"
VerticalAlignment="Top" Name="ScanModeLabel"
Text="{Loc 'health-analyzer-window-entity-unknown-text'}" />
<Label Margin="0 0 5 0"
HorizontalExpand="True"
HorizontalAlignment="Right"
VerticalExpand="True"
VerticalAlignment="Top"
Name="ScanModeLabel"
Text="{Loc 'health-analyzer-window-entity-unknown-text'}"/>
</BoxContainer>

<PanelContainer StyleClasses="LowDivider" />
<PanelContainer StyleClasses="LowDivider"/>

<GridContainer Margin="0 5 0 0" Columns="2">
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}" />
<Label Name="StatusLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}" />
<Label Name="TemperatureLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-blood-level-text'}" />
<Label Name="BloodLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}" />
<Label Name="DamageLabel" />
<GridContainer Margin="0 5 0 0"
Columns="2">
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}"/>
<Label Name="StatusLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}"/>
<Label Name="TemperatureLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-blood-level-text'}"/>
<Label Name="BloodLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}"/>
<Label Name="DamageLabel"/>
</GridContainer>
</BoxContainer>

<PanelContainer Name="AlertsDivider" Visible="False" StyleClasses="LowDivider" />
<PanelContainer Name="AlertsDivider"
Visible="False"
StyleClasses="LowDivider"/>

<BoxContainer Name="AlertsContainer" Visible="False" Margin="0 5" Orientation="Vertical" HorizontalAlignment="Center">
<BoxContainer Name="AlertsContainer"
Visible="False"
Margin="0 5"
Orientation="Vertical"
HorizontalAlignment="Center">

</BoxContainer>

<PanelContainer StyleClasses="LowDivider" />
<PanelContainer StyleClasses="LowDivider"/>

<BoxContainer
Name="GroupsContainer"
Expand Down
Loading

0 comments on commit fdb6e27

Please sign in to comment.