Allow players to print IPC/FBP chasses (#3418)

Allow players to print IPC chasses
This commit is contained in:
pathetic meowmeow 2025-04-13 06:27:41 -04:00 committed by GitHub
parent 047e1870ae
commit 578dcd0c68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 102 additions and 8 deletions

View File

@ -126,7 +126,7 @@ public partial class SharedBodySystem
MapInitBody(ent, prototype);
}
private void MapInitBody(EntityUid bodyEntity, BodyPrototype prototype)
private void MapInitBody(Entity<BodyComponent> bodyEntity, BodyPrototype prototype) // DeltaV - don't drop the component, we need it for below
{
var protoRoot = prototype.Slots[prototype.Root];
if (protoRoot.Part is null)
@ -141,6 +141,7 @@ public partial class SharedBodySystem
// Setup the rest of the body entities.
SetupOrgans((rootPartUid, rootPart), protoRoot.Organs);
MapInitParts(rootPartUid, rootPart, prototype); // Shitmed Change
MapInitAppearance(bodyEntity); // DeltaV - some bodies don't spawn with all their parts
}
private void OnBodyCanDrag(Entity<BodyComponent> ent, ref CanDragEvent args)

View File

@ -82,9 +82,15 @@ namespace Content.Shared.Humanoid
}
}
// Begin DeltaV - We want this data w/o needing a BodyPartComponnet
public static HumanoidVisualLayers? ToHumanoidLayers(this BodyPartComponent part)
{
switch (part.PartType)
return part.PartType.ToHumanoidLayers(part.Symmetry);
}
public static HumanoidVisualLayers? ToHumanoidLayers(this BodyPartType partType, BodyPartSymmetry partSymmetry)
{
switch (partType)
{
case BodyPartType.Other:
break;
@ -97,7 +103,7 @@ namespace Content.Shared.Humanoid
// if that's what you're looking for
return HumanoidVisualLayers.Head;
case BodyPartType.Arm:
switch (part.Symmetry)
switch (partSymmetry)
{
case BodyPartSymmetry.None:
break;
@ -109,7 +115,7 @@ namespace Content.Shared.Humanoid
break;
case BodyPartType.Hand:
switch (part.Symmetry)
switch (partSymmetry)
{
case BodyPartSymmetry.None:
break;
@ -121,7 +127,7 @@ namespace Content.Shared.Humanoid
break;
case BodyPartType.Leg:
switch (part.Symmetry)
switch (partSymmetry)
{
case BodyPartSymmetry.None:
break;
@ -133,7 +139,7 @@ namespace Content.Shared.Humanoid
break;
case BodyPartType.Foot:
switch (part.Symmetry)
switch (partSymmetry)
{
case BodyPartSymmetry.None:
break;
@ -148,5 +154,6 @@ namespace Content.Shared.Humanoid
return null;
}
// End DeltaV - We want this data w/o needing a BodyPartComponnet
}
}

View File

@ -0,0 +1,57 @@
using System.Linq;
using Content.Shared.Body.Components;
using Content.Shared.Body.Part;
using Content.Shared.Humanoid;
namespace Content.Shared.Body.Systems;
public partial class SharedBodySystem
{
private static readonly BodyPartType[] _asymmetric =
[
BodyPartType.Other,
BodyPartType.Torso,
BodyPartType.Tail,
BodyPartType.Head,
];
private static readonly BodyPartType[] _symmetric =
[
BodyPartType.Arm,
BodyPartType.Hand,
BodyPartType.Leg,
BodyPartType.Foot,
];
[Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidAppearance = default!;
private void MapInitAppearance(Entity<BodyComponent> ent)
{
var symmetries = Enum.GetValues<BodyPartSymmetry>();
foreach (var part in _asymmetric)
{
if (part.ToHumanoidLayers(BodyPartSymmetry.None) is not {} layer)
continue;
var layers = HumanoidVisualLayersExtension.Sublayers(layer);
var visible = GetBodyChildrenOfType(ent, part).Any();
_humanoidAppearance.SetLayersVisibility(ent.Owner, layers, visible: visible);
}
foreach (var part in _symmetric)
{
foreach (var side in symmetries)
{
if (part.ToHumanoidLayers(side) is not {} layer)
continue;
var layers = HumanoidVisualLayersExtension.Sublayers(layer);
var visible = GetBodyChildrenOfType(ent, part, symmetry: side).Any();
_humanoidAppearance.SetLayersVisibility(ent.Owner, layers, visible: visible);
}
}
}
}

View File

@ -15,6 +15,8 @@
- type: Input
context: human
- type: MMI
- type: Organ # DeltaV - mmis also count as positronic brains for IPC chasses
slotId: posbrain
- type: BorgBrain
- type: BlockMovement
- type: Examiner

View File

@ -0,0 +1,7 @@
- type: body
id: IPCTorsoOnly
name: "ipc"
root: torso
slots:
torso:
part: TorsoIPC

View File

@ -0,0 +1,16 @@
- type: entity
parent: MobIPC
id: MobIPCTorsoOnly
name: ipc chassis
suffix: Torso Only
components:
- type: Body
prototype: IPCTorsoOnly
- type: IsDeadIC
- type: RandomHumanoidAppearance
- type: ItemSlots
slots:
cell_slot:
locked: true
name: power-cell-slot-component-slot-name-default
startingItem: null

View File

@ -317,3 +317,4 @@
- type: LayingDown
- type: Fiber # DeltaV - IPCs leave fibers instead of prints
fiberMaterial: fibers-steel
- type: Anesthesia # DeltaV - IPCs can be operated on without anesthesia

View File

@ -108,8 +108,11 @@
- type: latheRecipe
parent: BaseRoboticsRecipe
id: TorsoIPC
result: TorsoIPC
completetime: 3
result: MobIPCTorsoOnly # DeltaV - this prints an actual body that can have stuff inserted into
completetime: 15 # DeltaV - Don't let players spam beeping IPC chasses
icon: # DeltaV - don't false marketing what the lathe will spit out
sprite: _Shitmed/Mobs/Species/IPC/parts.rsi
state: "torso_m"
materials:
Steel: 3000
Gold: 500