Skip to content

Commit

Permalink
surgery update (animal and moth surgery) (DeltaV-Station#882)
Browse files Browse the repository at this point in the history
* dont allow attaching invalid limbs

* add more surgeries for organs and limbs

* fix harpies being immune to surgery

* update organs and shit

* make a bunch of animals operatable

* malf ai

* fix slime

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored and deltanedas committed Dec 27, 2024
1 parent a9bc9cc commit 38da68a
Show file tree
Hide file tree
Showing 28 changed files with 300 additions and 10 deletions.
12 changes: 12 additions & 0 deletions Content.Shared/Body/Systems/SharedBodySystem.Parts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,18 @@ public bool CanAttachPart(
&& Containers.CanInsert(partId, container);
}

/// <summary>
/// GoobStation: Returns true if this parentId supports attaching a new part to the specified slot.
/// </summary>
public bool CanAttachToSlot(
EntityUid parentId,
string slotId,
BodyPartComponent? parentPart = null)
{
return Resolve(parentId, ref parentPart, logMissing: false)
&& parentPart.Children.ContainsKey(slotId);
}

public bool AttachPartToRoot(
EntityUid bodyId,
EntityUid partId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ namespace Content.Shared._Shitmed.Medical.Surgery.Conditions;
[RegisterComponent, NetworkedComponent]
public sealed partial class SurgeryPartRemovedConditionComponent : Component
{
/// <summary>
/// GoobStation: Requires that the parent part can attach a new part to this slot.
/// </summary>
[DataField(required: true)]
public string Connection = string.Empty;

[DataField]
public BodyPartType Part;

[DataField]
public BodyPartSymmetry? Symmetry;
}
}
6 changes: 6 additions & 0 deletions Content.Shared/_Shitmed/Surgery/SharedSurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ private void OnOrganConditionValid(Entity<SurgeryOrganConditionComponent> ent, r

private void OnPartRemovedConditionValid(Entity<SurgeryPartRemovedConditionComponent> ent, ref SurgeryValidEvent args)
{
if (!_body.CanAttachToSlot(args.Part, ent.Comp.Connection))
{
args.Cancelled = true;
return;
}

var results = _body.GetBodyChildrenOfType(args.Body, ent.Comp.Part, symmetry: ent.Comp.Symmetry);
if (results is not { } || !results.Any())
return;
Expand Down
20 changes: 20 additions & 0 deletions Resources/Prototypes/Body/Organs/Animal/animal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- state: lung-l
- state: lung-r
- type: Organ
slotId: lungs # GoobStation
- type: Lung
- type: Metabolizer
removeEmpty: true
Expand Down Expand Up @@ -73,6 +74,7 @@
- type: Sprite
state: stomach
- type: Organ
slotId: stomach # GoobStation
- type: SolutionContainerManager
solutions:
stomach:
Expand Down Expand Up @@ -116,12 +118,19 @@
- type: Sprite
state: liver
- type: Organ
slotId: liver # GoobStation
- type: Metabolizer
maxReagents: 1
metabolizerTypes: [ Animal ]
groups:
- id: Alcohol
rateModifier: 0.1
- type: Liver # GoobStation
- type: Tag # goob edit
tags:
- Meat
- Organ
- Liver
- type: Item
size: Small
heldPrefix: liver
Expand All @@ -135,16 +144,26 @@
- type: Sprite
state: heart-on
- type: Organ
slotId: heart # GoobStation
- type: Metabolizer
maxReagents: 2
metabolizerTypes: [ Animal ]
groups:
- id: Medicine
- id: Poison
- id: Narcotic
<<<<<<< HEAD
- type: Item
size: Small
heldPrefix: heart
=======
- type: Heart # GoobStation
- type: Tag # goob edit
tags:
- Meat
- Organ
- Heart
>>>>>>> f00571107f (surgery update (animal and moth surgery) (#882))

- type: entity
id: OrganAnimalKidneys
Expand All @@ -157,6 +176,7 @@
- state: kidney-l
- state: kidney-r
- type: Organ
slotId: kidneys # GoobStation
- type: Metabolizer
maxReagents: 5
metabolizerTypes: [ Animal ]
Expand Down
43 changes: 40 additions & 3 deletions Resources/Prototypes/Body/Organs/arachnid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
- type: Sprite
sprite: Mobs/Species/Arachnid/organs.rsi
state: stomach
- type: Item
size: Small
heldPrefix: stomach
- type: Organ # GoobStation
slotId: stomach
- type: Stomach
updateInterval: 1.5
- type: SolutionContainerManager
Expand All @@ -50,6 +49,9 @@
Quantity: 5
- type: Metabolizer
updateInterval: 1.5
- type: Item
size: Small
heldPrefix: stomach

- type: entity
id: OrganArachnidLungs
Expand All @@ -61,6 +63,8 @@
layers:
- state: lung-l
- state: lung-r
- type: Organ # GoobStation
slotId: lungs
- type: Lung
- type: Metabolizer
updateInterval: 1.5
Expand Down Expand Up @@ -105,6 +109,17 @@
- id: Medicine
- id: Poison
- id: Narcotic
<<<<<<< HEAD
=======
- type: Organ # GoobStation
slotId: heart
- type: Heart # GoobStation: Lets you transplant spider hearts into other species
- type: Tag # goob edit
tags:
- Meat
- Organ
- Heart
>>>>>>> f00571107f (surgery update (animal and moth surgery) (#882))

- type: entity
id: OrganArachnidLiver
Expand All @@ -125,6 +140,17 @@
groups:
- id: Alcohol
rateModifier: 0.1 # removes alcohol very slowly along with the stomach removing it as a drink
<<<<<<< HEAD
=======
- type: Organ # GoobStation
slotId: liver
- type: Liver # GoobStation
- type: Tag # goob edit
tags:
- Meat
- Organ
- Liver
>>>>>>> f00571107f (surgery update (animal and moth surgery) (#882))

- type: entity
id: OrganArachnidKidneys
Expand Down Expand Up @@ -157,9 +183,20 @@
layers:
- state: eyeball-l
- state: eyeball-r
<<<<<<< HEAD
- type: Item
size: Small
heldPrefix: eyeballs
=======
- type: Organ # GoobStation
slotId: eyes
- type: Eyes # GoobStation
- type: Tag # goob edit
tags:
- Meat
- Organ
- Eyes
>>>>>>> f00571107f (surgery update (animal and moth surgery) (#882))

- type: entity
id: OrganArachnidTongue
Expand Down
20 changes: 17 additions & 3 deletions Resources/Prototypes/Body/Organs/diona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
heldPrefix: brain
- type: Sprite
state: brain
- type: Organ # GoobStation
slotId: Brain
- type: Brain # GoobStation
- type: SolutionContainerManager
solutions:
organ:
Expand All @@ -62,6 +65,13 @@
layers:
- state: eyeball-l
- state: eyeball-r
- type: Organ # GoobStation
slotId: eyes
- type: Tag # goob edit
tags:
- Meat
- Organ
- Eyes

- type: entity
id: OrganDionaStomach
Expand All @@ -80,6 +90,8 @@
reagents:
- ReagentId: UncookedAnimalProteins
Quantity: 5
- type: Organ # GoobStation
slotId: stomach
- type: Stomach
- type: Metabolizer
maxReagents: 6
Expand All @@ -105,9 +117,8 @@
components:
- type: Sprite
state: lungs
- type: Item
size: Small
heldPrefix: lungs
- type: Organ # GoobStation
slotId: lungs
- type: Lung
- type: Metabolizer
removeEmpty: true
Expand All @@ -127,6 +138,9 @@
Lung:
maxVol: 100
canReact: False
- type: Item
size: Small
heldPrefix: lungs

# Organs that turn into nymphs on removal
- type: entity
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Organs/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: OrganMothStomach
parent: [OrganAnimalStomach, OrganHumanStomach]
categories: [ HideSpawnMenu ]
name: moth stomach # GoobStation
components:
- type: Stomach
specialDigestible:
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Body/Organs/slime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
layers:
- state: lung-l-slime
- state: lung-r-slime
- type: Organ # GoobStation
slotId: lungs
- type: Lung
alert: LowNitrogen
- type: Metabolizer
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Organs/vox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
parent: OrganHumanLungs
description: "The blue, anaerobic lungs of a vox, they intake nitrogen to breathe. Any form of gaseous oxygen is lethally toxic if breathed in."
suffix: "vox"
name: vox lungs # GoobStation
components:
- type: Sprite
sprite: Mobs/Species/Vox/organs.rsi
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/arachnid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmArachnid
connections:
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/diona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
stomach: OrganDionaStomachNymph
lungs: OrganDionaLungsNymph
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/dwarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganDwarfHeart
lungs: OrganHumanLungs
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/gingerbread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/human.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmMoth
connections:
Expand Down
8 changes: 8 additions & 0 deletions Resources/Prototypes/Body/Prototypes/primate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
name: "primate"
root: torso
slots:
head: # GoobStation: put pun pun into a humans body
part: HeadAnimal
connections:
- torso
organs:
brain: OrganHumanBrain
eyes: OrganHumanEyes
torso:
part: TorsoAnimal
connections:
- hands
- legs
- head # GoobStation
organs:
lungs: OrganAnimalLungs
stomach: OrganAnimalStomach
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/reptilian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmReptilian
connections:
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/skeleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmSkeleton
connections:
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/slime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
core: SentientSlimeCore
lungs: OrganSlimeLungs
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/vox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganVoxLungs
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
type: HumanoidMarkingModifierBoundUserInterface
enum.StrippingUiKey.Key:
type: StrippableBoundUserInterface
enum.SurgeryUIKey.Key: # GoobStation
type: SurgeryBui
- type: Sprite
scale: 0.9, 0.9
layers:
Expand Down
Loading

0 comments on commit 38da68a

Please sign in to comment.