surgery update (animal and moth surgery) (#882)

* 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>
This commit is contained in:
deltanedas 2024-11-17 13:36:48 +00:00 committed by deltanedas
parent a9bc9cca49
commit 38da68a741
28 changed files with 300 additions and 10 deletions

View File

@ -565,6 +565,18 @@ public partial class SharedBodySystem
&& 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,

View File

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

View File

@ -171,6 +171,12 @@ public abstract partial class SharedSurgerySystem : EntitySystem
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;

View File

@ -41,6 +41,7 @@
- state: lung-l
- state: lung-r
- type: Organ
slotId: lungs # GoobStation
- type: Lung
- type: Metabolizer
removeEmpty: true
@ -73,6 +74,7 @@
- type: Sprite
state: stomach
- type: Organ
slotId: stomach # GoobStation
- type: SolutionContainerManager
solutions:
stomach:
@ -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
@ -135,6 +144,7 @@
- type: Sprite
state: heart-on
- type: Organ
slotId: heart # GoobStation
- type: Metabolizer
maxReagents: 2
metabolizerTypes: [ Animal ]
@ -142,9 +152,18 @@
- 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
@ -157,6 +176,7 @@
- state: kidney-l
- state: kidney-r
- type: Organ
slotId: kidneys # GoobStation
- type: Metabolizer
maxReagents: 5
metabolizerTypes: [ Animal ]

View File

@ -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
@ -50,6 +49,9 @@
Quantity: 5
- type: Metabolizer
updateInterval: 1.5
- type: Item
size: Small
heldPrefix: stomach
- type: entity
id: OrganArachnidLungs
@ -61,6 +63,8 @@
layers:
- state: lung-l
- state: lung-r
- type: Organ # GoobStation
slotId: lungs
- type: Lung
- type: Metabolizer
updateInterval: 1.5
@ -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
@ -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
@ -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

View File

@ -36,6 +36,9 @@
heldPrefix: brain
- type: Sprite
state: brain
- type: Organ # GoobStation
slotId: Brain
- type: Brain # GoobStation
- type: SolutionContainerManager
solutions:
organ:
@ -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
@ -80,6 +90,8 @@
reagents:
- ReagentId: UncookedAnimalProteins
Quantity: 5
- type: Organ # GoobStation
slotId: stomach
- type: Stomach
- type: Metabolizer
maxReagents: 6
@ -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
@ -127,6 +138,9 @@
Lung:
maxVol: 100
canReact: False
- type: Item
size: Small
heldPrefix: lungs
# Organs that turn into nymphs on removal
- type: entity

View File

@ -2,6 +2,7 @@
id: OrganMothStomach
parent: [OrganAnimalStomach, OrganHumanStomach]
categories: [ HideSpawnMenu ]
name: moth stomach # GoobStation
components:
- type: Stomach
specialDigestible:

View File

@ -49,6 +49,8 @@
layers:
- state: lung-l-slime
- state: lung-r-slime
- type: Organ # GoobStation
slotId: lungs
- type: Lung
alert: LowNitrogen
- type: Metabolizer

View File

@ -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

View File

@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmArachnid
connections:

View File

@ -16,6 +16,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
stomach: OrganDionaStomachNymph
lungs: OrganDionaLungsNymph

View File

@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganDwarfHeart
lungs: OrganHumanLungs

View File

@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs

View File

@ -18,6 +18,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs

View File

@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmMoth
connections:

View File

@ -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

View File

@ -23,6 +23,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmReptilian
connections:

View File

@ -14,6 +14,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
right arm:
part: RightArmSkeleton
connections:

View File

@ -14,6 +14,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
core: SentientSlimeCore
lungs: OrganSlimeLungs

View File

@ -17,6 +17,7 @@
- left arm
- right leg
- left leg
- head # GoobStation
organs:
heart: OrganHumanHeart
lungs: OrganVoxLungs

View File

@ -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:

View File

@ -560,6 +560,7 @@
- Mouse
- type: Body
prototype: Mothroach
- type: SurgeryTarget # GoobStation
- type: TypingIndicator
proto: moth
- type: Destructible
@ -578,6 +579,8 @@
interfaces:
enum.StrippingUiKey.Key:
type: StrippableBoundUserInterface
enum.SurgeryUIKey.Key: # GoobStation
type: SurgeryBui
- type: InventorySlots
- type: Inventory
speciesId: hamster
@ -866,6 +869,11 @@
- Passive
- type: Body
prototype: AnimalRuminant
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: HTN
rootTask:
task: RuminantCompound
@ -943,6 +951,11 @@
task: RuminantCompound
- type: Body
prototype: AnimalHemocyanin
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: entity
name: goat
@ -1031,6 +1044,11 @@
- Passive
- type: Body
prototype: AnimalRuminant
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: NPCRetaliation
attackMemoryLength: 5
- type: FactionException
@ -1249,9 +1267,8 @@
abstract: true
components:
- type: CombatMode
#- type: SurgeryTarget
# canOperate: false
#- type: Targeting
- type: SurgeryTarget # GoobStation
- type: Targeting # GoobStation
- type: Inventory
templateId: monkey
speciesId: monkey
@ -1306,6 +1323,12 @@
- type: Body
prototype: Primate
requiredLegs: 1 # TODO: More than 1 leg
- type: UserInterface # GoobStation: Add SurgeryUIKey on top of stripping ui
interfaces:
enum.StrippingUiKey.Key:
type: StrippableBoundUserInterface
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: CreamPied
- type: FireVisuals
sprite: Mobs/Effects/onfire.rsi
@ -1620,6 +1643,11 @@
components:
- type: Body
prototype: Mouse
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: GhostRole
makeSentient: true
allowSpeech: true
@ -2307,6 +2335,11 @@
- type: CombatMode
- type: Body
prototype: AnimalHemocyanin
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: MobThresholds
thresholds:
0: Alive

View File

@ -251,6 +251,11 @@
- type: Body
prototype: Bloodsucker
requiredLegs: 1
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: Butcherable
spawned:
- id: FoodMeatFish

View File

@ -60,6 +60,11 @@
- type: Body
prototype: Rat
requiredLegs: 1 # TODO: More than 1 leg
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: Hunger # probably should be prototyped
thresholds:
Overfed: 200
@ -244,6 +249,11 @@
- type: Body
prototype: Rat
requiredLegs: 1 # TODO: More than 1 leg
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: Hunger # probably should be prototyped
thresholds:
Overfed: 200

View File

@ -93,6 +93,11 @@
- type: Body
prototype: Slimes
requiredLegs: 1
- type: SurgeryTarget # GoobStation
- type: UserInterface # GoobStation
interfaces:
enum.SurgeryUIKey.Key:
type: SurgeryBui
- type: MeleeWeapon
altDisarm: false
soundHit:

View File

@ -0,0 +1,10 @@
# Monkey head for borging/transplanting pun pun
- type: entity
parent: [PartAnimal, BaseHead]
id: HeadAnimal
name: animal head
categories: [ HideSpawnMenu ]
components:
- type: Sprite
layers:
- state: head_m

View File

@ -76,6 +76,7 @@
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: head
part: Head
- type: entity
@ -92,6 +93,7 @@
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: left arm
part: Arm
symmetry: Left
@ -109,9 +111,28 @@
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: right arm
part: Arm
symmetry: Right
- type: entity
parent: SurgeryBase
id: SurgeryAttachLegs
name: Attach Legs
categories: [ HideSpawnMenu ]
components:
- type: Surgery
requirement: SurgeryOpenIncision
steps:
- SurgeryStepInsertFeature
- SurgeryStepSealWounds
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: legs
part: Leg
symmetry: None
- type: entity
parent: SurgeryBase
id: SurgeryAttachLeftLeg
@ -126,6 +147,7 @@
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: left leg
part: Leg
symmetry: Left
@ -143,9 +165,28 @@
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: right leg
part: Leg
symmetry: Right
- type: entity
parent: SurgeryBase
id: SurgeryAttachHands
name: Attach Hands
categories: [ HideSpawnMenu ]
components:
- type: Surgery
requirement: SurgeryOpenIncision
steps:
- SurgeryStepInsertFeature
- SurgeryStepSealWounds
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: hands
part: Hand
symmetry: Left # shitcode i guess because of ui icons
- type: entity
parent: SurgeryBase
id: SurgeryAttachLeftHand
@ -161,6 +202,7 @@
part: Arm
symmetry: Left
- type: SurgeryPartRemovedCondition
connection: left hand
part: Hand
symmetry: Left
@ -179,9 +221,28 @@
part: Arm
symmetry: Right
- type: SurgeryPartRemovedCondition
connection: right hand
part: Hand
symmetry: Right
- type: entity
parent: SurgeryBase
id: SurgeryAttachFeet
name: Attach Feet
categories: [ HideSpawnMenu ]
components:
- type: Surgery
requirement: SurgeryOpenIncision
steps:
- SurgeryStepInsertFeature
- SurgeryStepSealWounds
- type: SurgeryPartCondition
part: Torso
- type: SurgeryPartRemovedCondition
connection: feet
part: Foot
symmetry: None
- type: entity
parent: SurgeryBase
id: SurgeryAttachLeftFoot
@ -197,6 +258,7 @@
part: Leg
symmetry: Left
- type: SurgeryPartRemovedCondition
connection: left foot
part: Foot
symmetry: Left
@ -215,6 +277,7 @@
part: Leg
symmetry: Right
- type: SurgeryPartRemovedCondition
connection: right foot
part: Foot
symmetry: Right
@ -432,6 +495,44 @@
inverse: true
reattaching: true
- type: entity
parent: SurgeryBase
id: SurgeryRemoveStomach
name: Remove Stomach
categories: [ HideSpawnMenu ]
components:
- type: Surgery
requirement: SurgeryOpenRibcage
steps:
- SurgeryStepSawBones
- SurgeryStepClampInternalBleeders
- SurgeryStepRemoveOrgan
- type: SurgeryPartCondition
part: Torso
- type: SurgeryOrganCondition
organ:
- type: Stomach
- type: entity
parent: SurgeryBase
id: SurgeryInsertStomach
name: Insert Stomach
categories: [ HideSpawnMenu ]
components:
- type: Surgery
requirement: SurgeryOpenRibcage
steps:
- SurgeryStepSawBones
- SurgeryStepInsertStomach
- SurgeryStepSealOrganWound
- type: SurgeryPartCondition
part: Torso
- type: SurgeryOrganCondition
organ:
- type: Stomach
inverse: true
reattaching: true
- type: entity
parent: SurgeryBase
id: SurgeryRemoveEyes

View File

@ -434,6 +434,13 @@
sleepModifier: 1
isConsumable: true
- type: entity
parent: SurgeryStepInsertOrgan
id: SurgeryStepInsertStomach
name: Add stomach
categories: [ HideSpawnMenu ]
# no effect its just for minmaxing metabolism
- type: entity
parent: SurgeryStepInsertOrgan
id: SurgeryStepInsertLiver