Skip to content

Commit

Permalink
Merge pull request #15 from Tropica1Owl/Pogmed
Browse files Browse the repository at this point in the history
Transplant surgery
  • Loading branch information
Eagle-0 authored Sep 1, 2024
2 parents 025ec05 + dca910f commit 40a4ab0
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ public partial class PSurgeryToolComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
public string kind = "scalpel";

[DataField("subKind")]
[ViewVariables(VVAccess.ReadWrite)]
public string subKind = "none"; // Used for implants

[DataField("useDelay")]
[ViewVariables(VVAccess.ReadWrite)]
public float useDelay = 3.0f;
Expand All @@ -29,5 +33,9 @@ public partial class PSurgeryToolComponent : Component
[DataField("audioEnd")]
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier? audioEnd = null;

[DataField("consumedOnUse")] // Used for implants
[ViewVariables(VVAccess.ReadWrite)]
public bool consumedOnUse = false;
}
}
30 changes: 27 additions & 3 deletions Content.Server/Palmtree/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Content.Shared.DoAfter;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
//using Content.Shared.Players;
using Content.Shared.Standing;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
Expand Down Expand Up @@ -53,8 +52,8 @@ public class PSurgerySystem : SharedSurgerySystem
{"SawBones", new string[]{"scalpel", "retractor"}}, // This comes before letting people saw bones
{"BrainTransfer", new string[]{"scalpel", "retractor", "saw"}},
{"ReduceRotting", new string[]{"scalpel", "retractor"}},
{"InsertAugment", new string[]{"scapel", "retractor", "saw"}}, // This procedure is used for augments and implants
{"RemoveAugment", new string[]{"scalpel", "retractor", "saw", "drill"}} // This procedure removes a person's augments, breaking them
{"InsertAugment", new string[]{"scalpel", "retractor", "saw"}}, // This procedure is used for augments and implants
{"RemoveAugment", new string[]{"scalpel", "retractor", "saw", "drill"}} // This procedure removes a person's augments, breaking them, synth organs cannot be removed
};

[Dependency] private readonly PopupSystem _popupSystem = default!;
Expand Down Expand Up @@ -195,6 +194,27 @@ private void OnProcedureFinished(EntityUid uid, PSurgeryToolComponent tool, Surg
failedProcedure = true;
}
break;
case "Implant": // Shitcode galore
{
if (patient.procedures.SequenceEqual(procedures["InsertAugment"]))
{
switch(tool.subKind)
{
case "BioHeart":
_rot.ReduceAccumulator((EntityUid) args.Target, TimeSpan.FromSeconds(2147483648));
break;
default: // Some simply don't have any behavior other than healing
break;
}
repeatableProcedure = true;
}
else
{
_popupSystem.PopupEntity("You can't implant right now.", args.User, PopupType.Small);
failedProcedure = true;
}
break;
}
default:
_popupSystem.PopupEntity("If you see this, contact TropicalOwl and tell which tool you used when seeing this, this is an error message.", args.User, PopupType.Small);
break;
Expand All @@ -213,6 +233,10 @@ private void OnProcedureFinished(EntityUid uid, PSurgeryToolComponent tool, Surg
_blood.TryModifyBleedAmount((EntityUid) args.Target, tool.bleedAmountOnUse);
}
_audio.PlayPvs(tool.audioEnd, args.User);
if (tool.consumedOnUse)
{
EntityManager.DeleteEntity(uid);
}
}
}
private void OnAfterInteract(EntityUid uid, PSurgeryToolComponent tool, AfterInteractEvent args) // Turn this into FTL strings later
Expand Down
9 changes: 5 additions & 4 deletions Content.Shared/Atmos/Rotting/RottingComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ public sealed partial class RottingComponent : Component
/// The damage dealt by rotting.
/// </summary>
[DataField]
public DamageSpecifier Damage = new()
public DamageSpecifier Damage = new() // SYNDIE STATION CHANGE START
{
DamageDict = new()
{
{ "Blunt", 0.06 },
{ "Cellular", 0.06 }
{ "Poison", 0.15 },
{ "Asphyxiation", 0.15 },
{ "Radiation", -10 }
}
};
}; // SYNDIE STATION CHANGE END
}
1 change: 0 additions & 1 deletion Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- id: Cautery
- id: Retractor
- id: Scalpel
- id: SurgeryItemBloodFilter # Syndie change
- id: PhantomLinkCard # Syndie change

- type: entity
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Catalog/Fills/Crates/medical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
- id: Saw
- id: Hemostat
- id: ClothingMaskSterile
- id: SurgeryItemBloodFilter # Syndie change
- id: PhantomLinkCard # Syndie change

- type: entity
Expand Down
39 changes: 39 additions & 0 deletions Resources/Prototypes/Palmtree/Catalog/Cargo/cargo_medical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- type: cargoProduct
id: SurgeryCrate
icon:
sprite: Objects/Specific/Medical/Surgery/scalpel.rsi
state: scalpel
product: CrateMedicalSurgery
cost: 1500
category: cargoproduct-category-name-medical
group: market

# I'm gonna make a proper file for this later, I just wanna get it done now.
- type: entity
id: CrateMedicalSpareOrgans
parent: CrateSurgery
name: Spare organs crate
description: A crate containing 3 of each kind of Syndicate-produced bio-synthetic universal organs as well as a spare phantom link.
components:
- type: StorageFill
contents:
- id: BioSynthHeart
- id: BioSynthHeart
- id: BioSynthHeart
- id: BioSynthLiver
- id: BioSynthLiver
- id: BioSynthLiver
- id: BioSynthLungs
- id: BioSynthLungs
- id: BioSynthLungs
- id: PhantomLinkCard

- type: cargoProduct
id: SpareOrganCrate
icon:
sprite: Mobs/Species/Human/organs.rsi
state: heart-on
product: CrateMedicalSpareOrgans
cost: 2000
category: cargoproduct-category-name-medical
group: market
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
tags:
- SurgeryTool

# Placeholder PAIs, aka semi-automatic ghost roles

- type: entity
parent: BaseItem
id: PhantomLinkCard
Expand All @@ -71,3 +69,80 @@
shader: unshaded
map: ["screen"]
- type: BlockMovement

# ORGANS

- type: entity
parent: BaseItem
id: BioSyntheticOrgan
abstract: true
components:
- type: PSurgeryTool
consumedOnUse: true
kind: Implant
useDelay: 5
damageOnUse:
types:
Asphyxiation: -1 # I cannot leave this empty or else the server crashes
audioStart:
path: "/Audio/Palmtree/Items/Medical/organ1.ogg"
audioEnd:
path: "/Audio/Palmtree/Items/Medical/organ2.ogg"
- type: Item
size: Tiny
- type: Sprite
sprite: Mobs/Species/Human/organs.rsi

- type: entity
parent: BioSyntheticOrgan
id: BioSynthHeart
name: bio-synthetic heart
description: This heart can be transplanted into any living organism and it will adapt to it's organism, in this state it is currently in stasis. Implanting this will allow the patient to be shocked even after rotting for long.
components:
- type: Sprite
state: heart-on
- type: PSurgeryTool
subKind: BioHeart

- type: entity
parent: BioSyntheticOrgan
id: BioSynthLiver
name: bio-synthetic liver
description: This liver can be transplanted into any living organism and it will adapt to it's organism, in this state it is currently in stasis. Implanting this will allow the patient to be revived even after building up too much toxin in their body, and in case of rot this might be necessary for revival.
components:
- type: Sprite
state: liver
- type: PSurgeryTool
subKind: BioLiver
damageOnUse:
types:
Poison: -2147483648 # Literally the max 32 bit value, if your patient has gone higher than this, maybe it's time to restart the round.

- type: entity
parent: BioSyntheticOrgan
id: BioSynthLungs
name: bio-synthetic lungs
description: This pair of lungs can be transplanted into any living organism and it will adapt to it's organism, in this state it is currently in stasis. Implanting this will help with excessive asphyxiation, and in case of rot this might be necessary for revival.
components:
- type: Sprite
layers:
- state: lung-l
- state: lung-r
- type: PSurgeryTool
subKind: BioLungs
damageOnUse:
types:
Asphyxiation: -2147483648 # Literally the max 32 bit value, if your patient has gone higher than this, maybe it's time to restart the round.

- type: entity
parent: BioSyntheticOrgan
id: BioSynthEyes
name: bio-synthetic eyes
description: This pair of eyes can be transplanted into any living organism and it will adapt to it's organism, in this state it is currently in stasis. Implanting this will treat the patient's blindness and serves as an alternative to oculine.
components:
- type: Sprite
layers:
- state: eyeball-l
- state: eyeball-r
- type: PSurgeryTool
subKind: BioEyes

0 comments on commit 40a4ab0

Please sign in to comment.