Skip to content

Commit

Permalink
Merge pull request Simple-Station#17 from Tropica1Owl/Pogmed
Browse files Browse the repository at this point in the history
Medical biofabricator + surgery extras
  • Loading branch information
Eagle-0 authored Sep 4, 2024
2 parents 86a829e + b6ba9f1 commit fb5ed43
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 5 deletions.
21 changes: 21 additions & 0 deletions Content.Server/Palmtree/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using Content.Server.Body.Systems;
using Content.Server.Popups;
using Content.Server.Mind;
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Eye.Blinding.Systems;
using Content.Shared.Inventory;
using Content.Shared.Atmos.Rotting;
using Content.Shared.Palmtree.Surgery;
Expand Down Expand Up @@ -69,6 +71,7 @@ public class PSurgerySystem : SharedSurgerySystem
[Dependency] private readonly BloodstreamSystem _blood = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly BlindableSystem _blindableSystem = default!;
public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -204,6 +207,12 @@ private void OnProcedureFinished(EntityUid uid, PSurgeryToolComponent tool, Surg
case "BioHeart":
_rot.ReduceAccumulator((EntityUid) args.Target, TimeSpan.FromSeconds(2147483648));
break;
case "BioEyes":
if (TryComp(args.Target, out BlindableComponent? blindcomp))
{
_blindableSystem.AdjustEyeDamage(((EntityUid) args.Target, blindcomp), -blindcomp!.EyeDamage);
}
break;
default: // Some simply don't have any behavior other than healing
break;
}
Expand Down Expand Up @@ -238,6 +247,18 @@ private void OnProcedureFinished(EntityUid uid, PSurgeryToolComponent tool, Surg
{
EntityManager.DeleteEntity(uid);
}
if (!_inventory.TryGetSlotEntity((EntityUid) args.User, "gloves", out var gloves) || !_inventory.TryGetSlotEntity((EntityUid) args.User, "mask", out var mask)) // INFECTION CODE GOES HERE!!!!
{
// Stolen straight from Solidus' CPR PR.
var infecting = new DamageSpecifier()
{
DamageDict = new()
{
{ "Poison", 10}
}
};
_damageableSystem.TryChangeDamage(args.Target, infecting, true, origin: uid);
}
}
}
private void OnAfterInteract(EntityUid uid, PSurgeryToolComponent tool, AfterInteractEvent args) // Turn this into FTL strings later
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
- id: RubberStampPsychologist # DeltaV
- id: MedicalTechFabCircuitboard
- id: BoxEncryptionKeyMedical
- id: MedicalBiofabMachineBoard # Syndicate station - CMO gets spare boards for his machiners
- id: BoxPDAMedical # Delta-V
- id: ClothingBeltMilitaryWebbingCMO # DeltaV - add webbing for CMO. ON THIS STATION, IT'S DRIP OR [die], CAPTAIN!
- id: CMOIDCard # Delta-V
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- type: entity
id: MedicalBiofabMachineBoard
parent: BaseMachineCircuitboard
name: medical biofab machine board
description: A machine printed circuit board for a medical biofab.
components:
- type: Sprite
state: medical
- type: MachineBoard
prototype: MedicalBiofabricator
requirements:
MatterBin: 2
Manipulator: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- type: entity
id: MedicalBiofabricator
parent: BaseLathe
name: medical biofabricator
description: Produces organs and other organic matter that can be surgically grafted onto patients with biomass.
components:
- type: Sprite
sprite: Palmtree/Structures/Machines/limbgrower.rsi
snapCardinals: true
layers:
- state: limbgrower_idleoff
map: ["enum.LatheVisualLayers.IsRunning"]
# - state: limbgrower_idleoff
# shader: unshaded
# map: ["enum.PowerDeviceVisualLayers.Powered"]
# - state: inserting
# map: ["enum.MaterialStorageVisualLayers.Inserting"]
# - state: panel
# map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: Machine
board: MedicalBiofabMachineBoard
- type: MaterialStorage
whitelist:
tags:
- Sheet
- RawMaterial
- type: Lathe
idleState: limbgrower_idleoff
runningState: limbgrower_idleon
staticRecipes:
- SynthHeart
- SynthLungs
- SynthLiver
- SynthEyes
27 changes: 27 additions & 0 deletions Resources/Prototypes/Palmtree/Recipes/Lathes/rehydrateable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- type: latheRecipe
id: SynthHeart
result: BioSynthHeart
completetime: 30
materials:
Biomass: 10

- type: latheRecipe
id: SynthLungs
result: BioSynthLungs
completetime: 30
materials:
Biomass: 10

- type: latheRecipe
id: SynthLiver
result: BioSynthLiver
completetime: 30
materials:
Biomass: 10

- type: latheRecipe
id: SynthEyes
result: BioSynthEyes
completetime: 30
materials:
Biomass: 10
13 changes: 8 additions & 5 deletions Resources/ServerInfo/Palmtree/Medical/Surgery.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Document>
# Surgery
Let's say that whatever patient arrives from the station straight into medbay is in a really bad shape. You have several options, clone them if they're dead, apply a mix of chemicals, topical medicine or even use the cryo tube with cryoxadone. There is a downside to those options however, all of them require specific external resources that aren't exactly abundant and a constantly running power supply.
Let's say that whatever patient arrives from the station straight into medbay is in a really bad shape. You have several options, clone them if they're dead, apply a mix of chemicals, topical medicine or even use the cryo tube with cryoxadone. There is a downside to those options however, all of them require specific external resources that aren't exactly abundant and/or a constantly running power supply.

That's where surgery comes in, it will allow you to treat the basic damages of your patients easily (albeit not as effective as every other method above) and it will even allow you to bring people who have rotted for long periods of time back to life.
That's where surgery comes in, it will allow you to treat the basic damages of your patients easily (albeit not as effective as every other method above) and it will even allow you to bring people who have rotted for long periods of time back to life without having to clone them completely, which can save on biomass and chemicals.

<Box>
<GuideEntityEmbed Entity="Cautery"/>
Expand All @@ -13,20 +13,23 @@ That's where surgery comes in, it will allow you to treat the basic damages of y
<GuideEntityEmbed Entity="Saw"/>
</Box>

## Sanitizing
Your patient may get infected from improper usage of surgical tools, to stop that from happening you must wear gloves and a mask anything will be better than your bare hands and uncovered face.

## The Basics
Performing surgery is done by steps, some steps are static while others are interchangeable, meaning they can be done alongside a more advanced procedure.

Every procedure starts with an incision and ends with cauterization, if you screw up at any point you can cauterize the patient and try again. The most basic procedure is tend wounds, it is done by using a hemostat at any point during the surgery, doing so also clamps the bleeders to stop your patient from bleeding out.

If someone is severely hurt, take them to the operating room, undress them and give it a shot.

<GuideEntityEmbed Entity="Scalpel" Caption="incision"/>
<GuideEntityEmbed Entity="Hemostat" Caption="tend wounds (repeatable)"/>
<GuideEntityEmbed Entity="Cautery" Caption="cauterization"/>

## Procedure conditions
Poor condition modifiers stacks and makes each step get progressively slower, the worst case scenario is if you were to do surgery on yourself while standing up and awake, and the best case scenario would be if you were doing surgery on someone else while they are laying down and sedated.

You also need to undress people before performing surgery.

## Transplants
If someone dies and doesn't get revived in time, their heart rot and soon does the rest of their organs, which get manifested in different types of damages (asphyxiation for lungs and poison for liver), lucky you, you should be prepared by now to deal exactly with that, these sorts of procedures should be done in this exact order, and the only tool you may optionally use during it is the hemostat to stop the patient from bleeding if they start to.

Expand All @@ -43,6 +46,6 @@ Additionally, you can also use the phantomlink card instead of an organ during t
<GuideEntityEmbed Entity="PhantomLinkCard" Caption="the phantomlink (sprite is a placeholder)"/>

## Getting organs
Currently the only transplantable organs are Interdyne's bio-synthetic organs, you can get them by buying a crate of them at cargo.
Currently the only transplantable organs are Interdyne's bio-synthetic organs, you can get them by buying a crate of them at cargo or using the medical biofabricator.

</Document>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"version": 1,
"license": "GNU AGPL v3",
"copyright": "Originally pulled from TGstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "limbgrower_fill",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "limbgrower_unfill",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "limbgrower_openpanel",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "limbgrower_idleoff",
"delays": [
[
0.3,
0.3,
0.3,
0.3
]
]
},
{
"name": "limbgrower_idleon",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "limbgrower_panelopen"
}
]
}

0 comments on commit fb5ed43

Please sign in to comment.