Skip to content

Commit

Permalink
One, two, one two three four.
Browse files Browse the repository at this point in the history
  • Loading branch information
gluesniffler committed Nov 17, 2024
1 parent 9c84e11 commit 2a5e36e
Show file tree
Hide file tree
Showing 23 changed files with 183 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;

namespace Content.IntegrationTests.Tests.Backmen.Body;
namespace Content.IntegrationTests.Tests._Shitmed.Body;

[TestFixture]
public sealed class SpeciesBUiTest
Expand Down
6 changes: 3 additions & 3 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ protected override void AddPart(
var layer = partEnt.Comp.ToHumanoidLayers();
if (layer != null)
{
var layers = HumanoidVisualLayersExtension.Sublayers(layer.Value);
_humanoidSystem.SetLayersVisibility(
bodyEnt, layers, visible: true, permanent: true, humanoid);
bodyEnt, new[] { layer.Value }, visible: true, permanent: true, humanoid);
}
}
}
Expand Down Expand Up @@ -163,7 +162,8 @@ public override HashSet<EntityUid> GibPart(
var ev = new BeingGibbedEvent(gibs);
RaiseLocalEvent(partId, ref ev);

QueueDel(partId);
if (gibs.Any())
QueueDel(partId);

return gibs;
}
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Medical/HealingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Targeting;
using Content.Shared.Stacks;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Body/Systems/SharedBodySystem.Body.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ public virtual HashSet<EntityUid> GibPart(

if (part.Body is { } bodyEnt)
{
if (IsPartRoot(bodyEnt, partId, part: part))
return gibs;

RemovePartChildren((partId, part), bodyEnt);
foreach (var organ in GetPartOrgans(partId, part))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ private void InitializePartAppearances()

private void OnPartAppearanceStartup(EntityUid uid, BodyPartAppearanceComponent component, ComponentStartup args)
{
if (!TryComp(uid, out BodyPartComponent? part))
if (!TryComp(uid, out BodyPartComponent? part)
|| part.ToHumanoidLayers() is not { } relevantLayer)
return;

if (part.OriginalBody == null
|| TerminatingOrDeleted(part.OriginalBody.Value)
|| !TryComp(part.OriginalBody.Value, out HumanoidAppearanceComponent? bodyAppearance)
|| part.ToHumanoidLayers() is not { } relevantLayer)
|| !TryComp(part.OriginalBody.Value, out HumanoidAppearanceComponent? bodyAppearance))
{
component.ID = part.BaseLayerId;
component.Type = relevantLayer;
return;
}

Expand Down
2 changes: 0 additions & 2 deletions Content.Shared/Damage/Systems/DamageableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public sealed class DamageableSystem : EntitySystem
private EntityQuery<AppearanceComponent> _appearanceQuery;
private EntityQuery<DamageableComponent> _damageableQuery;
private EntityQuery<MindContainerComponent> _mindContainerQuery;
private EntityQuery<TargetingComponent> _targetingQuery;
public override void Initialize()
{
SubscribeLocalEvent<DamageableComponent, ComponentInit>(DamageableInit);
Expand All @@ -42,7 +41,6 @@ public override void Initialize()
_appearanceQuery = GetEntityQuery<AppearanceComponent>();
_damageableQuery = GetEntityQuery<DamageableComponent>();
_mindContainerQuery = GetEntityQuery<MindContainerComponent>();
_targetingQuery = GetEntityQuery<TargetingComponent>();
}

/// <summary>
Expand Down
7 changes: 7 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
- type: Lung
- type: Metabolizer
removeEmpty: true
Expand Down Expand Up @@ -70,6 +71,7 @@
- type: Sprite
state: stomach
- type: Organ
slotId: stomach
- type: SolutionContainerManager
solutions:
stomach:
Expand Down Expand Up @@ -107,6 +109,8 @@
- type: Sprite
state: liver
- type: Organ
slotId: liver
- type: Liver
- type: Metabolizer
maxReagents: 1
metabolizerTypes: [ Animal ]
Expand All @@ -123,6 +127,8 @@
- type: Sprite
state: heart-on
- type: Organ
slotId: heart
- type: Heart
- type: Metabolizer
maxReagents: 2
metabolizerTypes: [ Animal ]
Expand All @@ -142,6 +148,7 @@
- state: kidney-l
- state: kidney-r
- type: Organ
slotId: kidneys
- type: Metabolizer
maxReagents: 5
metabolizerTypes: [ Animal ]
Expand Down
4 changes: 4 additions & 0 deletions Resources/Prototypes/Body/Organs/Animal/slimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
state: brain-slime
- type: Stomach
- type: Metabolizer
- type: Organ
slotId: core
maxReagents: 3
metabolizerTypes: [ Slime ]
removeEmpty: true
Expand Down Expand Up @@ -38,6 +40,8 @@
- state: lung-r-slime
- type: Lung
alert: LowNitrogen
- type: Organ
slotId: lungs
- type: Metabolizer
removeEmpty: true
solutionOnBody: false
Expand Down
13 changes: 13 additions & 0 deletions Resources/Prototypes/Body/Organs/arachnid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
state: stomach
- type: Stomach
updateInterval: 1.5
- type: Organ
slotId: stomach
- type: SolutionContainerManager
solutions:
stomach:
Expand All @@ -59,6 +61,8 @@
- state: lung-l
- state: lung-r
- type: Lung
- type: Organ
slotId: lungs
- type: Metabolizer
updateInterval: 1.5
removeEmpty: true
Expand Down Expand Up @@ -91,6 +95,9 @@
components:
- type: Sprite
state: heart-on
- type: Heart
- type: Organ
slotId: heart
- type: Metabolizer
updateInterval: 1.5
maxReagents: 2
Expand All @@ -109,6 +116,9 @@
components:
- type: Sprite
state: liver
- type: Liver
- type: Organ
slotId: liver
- type: Metabolizer # The liver metabolizes certain chemicals only, like alcohol.
updateInterval: 1.5
maxReagents: 1
Expand Down Expand Up @@ -145,6 +155,9 @@
layers:
- state: eyeball-l
- state: eyeball-r
- type: Eyes
- type: Organ
slotId: eyes

- type: entity
id: OrganArachnidTongue
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/Body/Organs/diona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
- type: Sprite
sprite: Mobs/Species/Diona/organs.rsi
state: brain
- type: Brain
- type: Organ
slotId: brain
- type: SolutionContainerManager
solutions:
organ:
Expand All @@ -60,6 +63,9 @@
layers:
- state: eyeball-l
- state: eyeball-r
- type: Eyes
- type: Organ
slotId: eyes

- type: entity
id: OrganDionaStomach
Expand All @@ -69,6 +75,8 @@
components:
- type: Sprite
state: stomach
- type: Organ
slotId: stomach
- type: SolutionContainerManager
solutions:
stomach:
Expand Down Expand Up @@ -104,6 +112,8 @@
- state: lung-l
- state: lung-r
- type: Lung
- type: Organ
slotId: lungs
- type: Metabolizer
removeEmpty: true
solutionOnBody: false
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/Body/Organs/ipc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
- state: eyeball-l
- state: eyeball-r
- type: Organ
slotId: eyes
- type: Eyes

- type: entity
id: OrganIPCTongue
Expand All @@ -48,6 +50,7 @@
- type: Sprite
state: ears
- type: Organ
- type: Ears

- type: entity
id: OrganIPCPump
Expand All @@ -58,6 +61,8 @@
- type: Sprite
state: heart-on
- type: Organ
slotId: heart
- type: Heart
# The heart 'metabolizes' medicines and poisons that aren't filtered out by other organs.
# This is done because these chemicals need to have some effect even if they aren't being filtered out of your body.
# You're technically 'immune to poison' without a heart, but.. uhh, you'll have bigger problems on your hands.
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Organs/moth.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- type: entity
id: OrganMothStomach
name: moth stomach
parent: [OrganAnimalStomach, OrganHumanStomach]
noSpawn: true
components:
Expand Down
4 changes: 4 additions & 0 deletions Resources/Prototypes/Body/Organs/slime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
sprite: Mobs/Species/Slime/organs.rsi
state: brain-slime
- type: Stomach
- type: Organ
slotId: core
- type: Metabolizer
maxReagents: 6
metabolizerTypes: [ Slime ]
Expand Down Expand Up @@ -46,6 +48,8 @@
layers:
- state: lung-l-slime
- state: lung-r-slime
- type: Organ
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
@@ -1,5 +1,6 @@
- type: entity
id: OrganVoxLungs
name: vox lungs
parent: OrganHumanLungs
suffix: "vox"
components:
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/Body/Parts/animal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,13 @@
- ReagentId: Blood
Quantity: 20

# 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
12 changes: 10 additions & 2 deletions Resources/Prototypes/Body/Parts/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
- type: GuideHelp
guides:
- Cyborgs
- type: SurgeryTool
startSound:
path: /Audio/Medical/Surgery/organ1.ogg
endSound:
path: /Audio/Medical/Surgery/organ2.ogg
- type: Gibbable

- type: entity
id: BaseBorgArmLeft
Expand All @@ -33,7 +39,7 @@
abstract: true
components:
- type: BodyPart
partType: Hand
partType: Arm
symmetry: Left
- type: Tag
tags:
Expand All @@ -47,7 +53,7 @@
abstract: true
components:
- type: BodyPart
partType: Hand
partType: Arm
symmetry: Right
- type: Tag
tags:
Expand All @@ -67,6 +73,7 @@
tags:
- Trash
- BorgLeg
- type: MovementBodyPart

- type: entity
id: BaseBorgLegRight
Expand All @@ -81,6 +88,7 @@
tags:
- Trash
- BorgLeg
- type: MovementBodyPart

- type: entity
id: BaseBorgHead
Expand Down
7 changes: 7 additions & 0 deletions Resources/Prototypes/Body/Prototypes/primate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
name: "primate"
root: torso
slots:
head: # Put pun pun into a humans body
part: HeadAnimal
connections:
- torso
organs:
brain: OrganHumanBrain
eyes: OrganHumanEyes
torso:
part: TorsoAnimal
connections:
Expand Down
Loading

0 comments on commit 2a5e36e

Please sign in to comment.