Skip to content

Commit

Permalink
Minor Shitmed Bugfixes (#971)
Browse files Browse the repository at this point in the history
* full fucking send

* ope forgot to remove the EE scripts

* fix test

* fix shitcode fail

* DELTA THAT VALUE IS NULLABLE

* whoopsie daysie

* fixed???

* chat is this real

* bugfixes

* more bugfixes

* goobmed
  • Loading branch information
gluesniffler authored and Roudenn committed Nov 30, 2024
1 parent f6604c1 commit 11d8926
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 49 deletions.
24 changes: 0 additions & 24 deletions Content.Server/Backmen/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,6 @@ private void SetDamage(EntityUid body,
targetPart: _body.GetTargetBodyPart(partComp));
}

private void AttemptStartSurgery(Entity<SurgeryToolComponent> ent, EntityUid user, EntityUid target)
{
var user = args.User;
if (args.Handled
|| !args.CanReach
|| args.Target == null
|| !HasComp<SurgeryTargetComponent>(args.Target)
|| !TryComp<SurgeryTargetComponent>(args.User, out var surgery)
|| !surgery.CanOperate
|| !IsLyingDown(args.Target.Value, args.User))
{
return;

if (user == args.Target && !_config.GetCVar(Shared.Backmen.CCVar.CCVars.CanOperateOnSelf))
{
_popup.PopupEntity(Loc.GetString("surgery-error-self-surgery"), user, user);
return;
}

args.Handled = true;
_ui.OpenUi(args.Target.Value, SurgeryUIKey.Key, user);
RefreshUI(args.Target.Value);
}

private void OnUtilityVerb(Entity<SurgeryToolComponent> ent, ref GetVerbsEvent<UtilityVerb> args)
{
if (!args.CanInteract
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/Backmen/Surgery/SanitizedComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;

namespace Content.Shared._Shitmed.Medical.Surgery;

/// <summary>
/// Prevents the entity from causing toxin damage to entities it does surgery on.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SanitizedComponent : Component { }
11 changes: 7 additions & 4 deletions Content.Shared/Backmen/Surgery/SharedSurgerySystem.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ private void OnToolStep(Entity<SurgeryStepComponent> ent, ref SurgeryStepEvent a
RaiseLocalEvent(args.Body, new MoodEffectEvent("SurgeryPain"));

if (!_inventory.TryGetSlotEntity(args.User, "gloves", out var _)
|| !_inventory.TryGetSlotEntity(args.User, "mask", out var _))
|| !_inventory.TryGetSlotEntity(args.User, "mask", out var _))
{
var sepsis = new DamageSpecifier(_prototypes.Index<DamageTypePrototype>("Poison"), 5);
var ev = new SurgeryStepDamageEvent(args.User, args.Body, args.Part, args.Surgery, sepsis, 0.5f);
RaiseLocalEvent(args.Body, ref ev);
if (!HasComp<SanitizedComponent>(args.User))
{
var sepsis = new DamageSpecifier(_prototypes.Index<DamageTypePrototype>("Poison"), 5);
var ev = new SurgeryStepDamageEvent(args.User, args.Body, args.Part, args.Surgery, sepsis, 0.5f);
RaiseLocalEvent(args.Body, ref ev);
}
}
}

Expand Down
7 changes: 1 addition & 6 deletions Content.Shared/Body/Systems/SharedBodySystem.Body.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Events;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Rejuvenate;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.Standing;
Expand Down Expand Up @@ -142,7 +143,6 @@ private void MapInitBody(EntityUid bodyEntity, BodyPrototype prototype)
var rootPartUid = SpawnInContainerOrDrop(protoRoot.Part, bodyEntity, BodyRootContainerId);
var rootPart = Comp<BodyPartComponent>(rootPartUid);
rootPart.Body = bodyEntity;
rootPart.OriginalBody = bodyEntity;
Dirty(rootPartUid, rootPart);
// Setup the rest of the body entities.
SetupOrgans((rootPartUid, rootPart), protoRoot.Organs);
Expand Down Expand Up @@ -464,11 +464,6 @@ private void OnProfileLoadFinished(EntityUid uid, BodyComponent component, Profi
foreach (var part in GetBodyChildren(uid, component))
EnsureComp<BodyPartAppearanceComponent>(part.Id);
}
private void OnStandAttempt(Entity<BodyComponent> ent, ref StandAttemptEvent args)
{
if (ent.Comp.LegEntities.Count == 0)
args.Cancel();
}

private void OnBeingEquippedAttempt(Entity<BodyComponent> ent, ref IsEquippingAttemptEvent args)
{
Expand Down
14 changes: 0 additions & 14 deletions Content.Shared/Body/Systems/SharedBodySystem.Parts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,19 +1144,5 @@ public bool TryGetBodyPartAdjacentPartsComponents<T>(
return false;
}

public int GetBodyPartCount(EntityUid bodyId, BodyPartType partType, BodyComponent? body = null)
{
if (!Resolve(bodyId, ref body, logMissing: false))
return 0;

int count = 0;
foreach (var part in GetBodyChildren(bodyId, body))
{
if (part.Component.PartType == partType)
count++;
}
return count;
}

#endregion
}
10 changes: 10 additions & 0 deletions Resources/Prototypes/Body/Parts/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
- type: BodyPart
partType: Leg
symmetry: Left
toolName: "a left leg" # Shitmed Change
children: # Shitmed Change
left foot:
id: "left foot"
type: Foot
- type: Sprite
state: borg_l_leg
- type: Icon
Expand All @@ -94,6 +99,11 @@
- type: BodyPart
partType: Leg
symmetry: Right
toolName: "a right leg" # Shitmed Change
children: # Shitmed Change
right foot:
id: "right foot"
type: Foot
- type: Sprite
state: borg_r_leg
- type: Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- type: SurgeryTarget
- type: TTS # Corvax-TTS
voice: TrainingRobot
- type: Sanitized

- type: entity
id: BorgChassisService
Expand Down
4 changes: 3 additions & 1 deletion Resources/Prototypes/_Backmen/Body/Prototypes/cybernetic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
- type: BodyPart
onAdd:
- type: NoSlip
- type: ProtectedFromStepTriggers

- type: entity
parent: RightLegCybernetic
Expand All @@ -166,4 +167,5 @@
sprintSpeed: 5.625
- type: BodyPart
onAdd:
- type: NoSlip
- type: NoSlip
- type: ProtectedFromStepTriggers
24 changes: 24 additions & 0 deletions Resources/Prototypes/_Backmen/Body/Prototypes/generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
id: BioSynthLeftArm
name: bio-synthetic left arm
description: This left arm can be transplanted into any living organism and it will adapt to its recipient.
components:
- type: BodyPart
children:
left hand:
id: "left hand"
type: Hand

- type: entity
parent: RightArmHuman
id: BioSynthRightArm
name: bio-synthetic right arm
description: This right arm can be transplanted into any living organism and it will adapt to its recipient.
components:
- type: BodyPart
children:
right hand:
id: "right hand"
type: Hand

- type: entity
parent: LeftHandHuman
Expand All @@ -27,12 +39,24 @@
id: BioSynthLeftLeg
name: bio-synthetic left leg
description: This left leg can be transplanted into any living organism and it will adapt to its recipient.
components:
- type: BodyPart
children:
left foot:
id: "left foot"
type: Foot

- type: entity
parent: RightLegHuman
id: BioSynthRightLeg
name: bio-synthetic right leg
description: This right leg can be transplanted into any living organism and it will adapt to its recipient.
components:
- type: BodyPart
children:
right foot:
id: "right foot"
type: Foot

- type: entity
parent: LeftFootHuman
Expand Down

0 comments on commit 11d8926

Please sign in to comment.