Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💀 #174

Merged
merged 34 commits into from
Jan 12, 2025
Merged

💀 #174

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5af62a8
add painkillers to logi purchases (#2674)
Lyndomen Jan 10, 2025
2d6d852
Automatic changelog update
DeltaV-Bot Jan 10, 2025
d361ece
Add Machine Incompatible Trait (#2395)
Emily9031 Jan 10, 2025
f9d5f34
Automatic changelog update
DeltaV-Bot Jan 10, 2025
801d5d4
lighthouse update (#2664)
deltanedas Jan 10, 2025
b7610e4
glacier update (#2666)
deltanedas Jan 10, 2025
d4519a6
Byoin surgery accommodation (#2648)
FieldCommand Jan 10, 2025
d74450a
Automatic changelog update
DeltaV-Bot Jan 10, 2025
bf7be6d
Add tank harnesses to the medical techfab (#2679)
sowelipililimute Jan 10, 2025
2ff232e
Automatic changelog update
DeltaV-Bot Jan 10, 2025
3983e0d
Depression RP Trait (#2676)
LioValkyria Jan 10, 2025
c0f6293
Automatic changelog update
DeltaV-Bot Jan 10, 2025
87693ac
Remove the medical cybernetic eyes from the secfab (#2682)
Radezolid Jan 10, 2025
1e45bd7
Automatic changelog update
DeltaV-Bot Jan 10, 2025
45c2bbf
Allow tank harnesses and hospital gowns to be operated through (#2678)
sowelipililimute Jan 10, 2025
5a61853
Automatic changelog update
DeltaV-Bot Jan 10, 2025
d699757
Ported Reptilian Hiss for Reptilians, Kobolds and Lizards (#2689)
Tomce795 Jan 10, 2025
7fb28d9
Automatic changelog update
DeltaV-Bot Jan 10, 2025
02c690f
Steal imp station suits 😈 (#2675)
Radezolid Jan 10, 2025
3472522
Automatic changelog update
DeltaV-Bot Jan 10, 2025
4e175ea
Make chloral hydrate better suited for use as anesthesia (#2685)
sowelipililimute Jan 11, 2025
1e886e0
Automatic changelog update
DeltaV-Bot Jan 11, 2025
b3a9cb8
Tweaks to the paperwork belt (#2690)
Radezolid Jan 11, 2025
6ebe75b
Automatic changelog update
DeltaV-Bot Jan 11, 2025
056c98c
Replace ForcedSleep with Anesthesia for surgery (#2684)
sowelipililimute Jan 11, 2025
5af2d0b
Automatic changelog update
DeltaV-Bot Jan 11, 2025
bd3dab2
add surgeon description (#2697)
deltanedas Jan 11, 2025
3270d4d
Adds a random spawner for laws (#2633)
IamVelcroboy Jan 11, 2025
5069863
fix shocked door spraypaint error (#2700)
deltanedas Jan 11, 2025
a9aa81d
Asterisk surgery update (#2681)
Colin-Tel Jan 11, 2025
9065183
add cold weather ponchos (#2688)
TadJohnson00 Jan 11, 2025
4a06fae
Automatic changelog update
DeltaV-Bot Jan 11, 2025
239d397
Map Edits: Arena/Hive/Tortuga (#2673)
IamVelcroboy Jan 11, 2025
4bccb4e
ups fix
Jan 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Content.Client/Doors/DoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ private void OnAppearanceChange(EntityUid uid, DoorComponent comp, ref Appearanc
{
Log.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace);
}
args.Sprite.BaseRSI = res?.RSI; // DeltaV
/* DeltaV: just set BaseRSI instead
foreach (var layer in args.Sprite.AllLayers)
{
layer.Rsi = res?.RSI;
}
}*/
}

TryComp<AnimationPlayerComponent>(uid, out var animPlayer);
Expand Down
14 changes: 13 additions & 1 deletion Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using System.Numerics;
using Content.Client.Message;
using Content.Shared._DV.Traits.Assorted; // DeltaV
using Content.Shared.Atmos;
using Content.Client.UserInterface.Controls;
using Content.Shared._Shitmed.Targeting; // Shitmed
Expand Down Expand Up @@ -36,6 +37,7 @@ public sealed partial class HealthAnalyzerWindow : FancyWindow
private readonly SpriteSystem _spriteSystem;
private readonly IPrototypeManager _prototypes;
private readonly IResourceCache _cache;
private readonly UnborgableSystem _unborgable; // DeltaV

// Shitmed Change Start
public event Action<TargetBodyPart?, EntityUid>? OnBodyPartSelected;
Expand All @@ -57,6 +59,7 @@ public HealthAnalyzerWindow()
_spriteSystem = _entityManager.System<SpriteSystem>();
_prototypes = dependencies.Resolve<IPrototypeManager>();
_cache = dependencies.Resolve<IResourceCache>();
_unborgable = _entityManager.System<UnborgableSystem>(); // DeltaV
// Shitmed Change Start
_bodyPartControls = new Dictionary<TargetBodyPart, TextureButton>
{
Expand Down Expand Up @@ -184,7 +187,8 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)

// Alerts

var showAlerts = msg.Unrevivable == true || msg.Bleeding == true;
var unborgable = _unborgable.IsUnborgable(_target.Value); // DeltaV
var showAlerts = msg.Unrevivable == true || msg.Bleeding == true || unborgable;

AlertsDivider.Visible = showAlerts;
AlertsContainer.Visible = showAlerts;
Expand All @@ -208,6 +212,14 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)
MaxWidth = 300
});

if (unborgable) // DeltaV
AlertsContainer.AddChild(new RichTextLabel
{
Text = Loc.GetString("health-analyzer-window-entity-unborgable-text"),
Margin = new Thickness(0, 4),
MaxWidth = 300
});

// Damage Groups

var damageSortedGroups =
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/_Shitmed/Medical/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Content.Shared.Eye.Blinding.Systems;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared._DV.Surgery; // DeltaV: expanded anesthesia
using Content.Shared._Shitmed.Medical.Surgery;
using Content.Shared._Shitmed.Medical.Surgery.Conditions;
using Content.Shared._Shitmed.Medical.Surgery.Effects.Step;
Expand Down Expand Up @@ -143,7 +144,7 @@ private void OnSurgeryStepDamage(Entity<SurgeryTargetComponent> ent, ref Surgery
private void OnSurgeryDamageChange(Entity<SurgeryDamageChangeEffectComponent> ent, ref SurgeryStepEvent args) // DeltaV
{
var damageChange = ent.Comp.Damage;
if (HasComp<ForcedSleepingComponent>(args.Body))
if (HasComp<AnesthesiaComponent>(args.Body)) // DeltaV: anesthesia
damageChange = damageChange * ent.Comp.SleepModifier;

SetDamage(args.Body, damageChange, 0.5f, args.User, args.Part);
Expand All @@ -162,7 +163,7 @@ private void OnSurgerySpecialDamageChange(Entity<SurgerySpecialDamageChangeEffec

private void OnStepScreamComplete(Entity<SurgeryStepEmoteEffectComponent> ent, ref SurgeryStepEvent args)
{
if (HasComp<ForcedSleepingComponent>(args.Body))
if (HasComp<AnesthesiaComponent>(args.Body)) // DeltaV: anesthesia
return;

_chat.TryEmoteWithChat(args.Body, ent.Comp.Emote);
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/_DV/Surgery/AnesthesiaComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Shared._DV.Surgery;

/// <summary>
/// Exists for use as a status effect. Allows surgical operations to not cause immense pain.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class AnesthesiaComponent : Component;
10 changes: 10 additions & 0 deletions Content.Shared/_DV/Traits/Assorted/UnborgableComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Robust.Shared.GameStates;

namespace Content.Shared._DV.Traits.Assorted;

/// <summary>
/// This is used for the unborgable trait, which blacklists a brain from MMIs.
/// If this is added to a body, it gets moved to its brain if it has one.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class UnborgableComponent : Component;
54 changes: 54 additions & 0 deletions Content.Shared/_DV/Traits/Assorted/UnborgableSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Content.Shared.Body.Components;
using Content.Shared.Body.Organ;
using Content.Shared.Body.Systems;
using Content.Shared.Examine;
using Content.Shared.Movement.Components; // TODO: use BrainComponent instead of InputMover when shitmed is merged
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

TODO comment is stale - BrainComponent is available

The code is still using InputMoverComponent even though BrainComponent is now available in the codebase (Content.Server/Body/Components/BrainComponent.cs). The TODO comment should be addressed by updating the implementation to use BrainComponent.

  • Content.Shared/_DV/Traits/Assorted/UnborgableSystem.cs: Replace InputMoverComponent with BrainComponent in both the import statement and GetBodyOrganEntityComps<> call.
🔗 Analysis chain

Address TODO comment regarding BrainComponent.

The comment indicates a temporary solution using InputMoverComponent. This should be updated when shitmed is merged.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if BrainComponent is available
echo "Searching for BrainComponent..."
rg -l "BrainComponent"

echo "\nChecking shitmed merge status..."
git log --oneline | rg -i "shitmed"

Length of output: 600


Script:

#!/bin/bash
# Check the current implementation in UnborgableSystem.cs
echo "Checking UnborgableSystem.cs implementation..."
rg -A 10 "InputMover" "Content.Shared/_DV/Traits/Assorted/UnborgableSystem.cs"

echo "\nChecking BrainComponent usage..."
rg -A 10 "BrainComponent" "Content.Shared/_DV/Traits/Assorted/UnborgableSystem.cs"

Length of output: 1669

using Robust.Shared.Utility;

namespace Content.Shared._DV.Traits.Assorted;

/// <summary>
/// Adds a warning examine message to brains with <see cref="UnborgableComponent"/>.
/// </summary>
public sealed class UnborgableSystem : EntitySystem
{
[Dependency] private readonly SharedBodySystem _body = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<UnborgableComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<UnborgableComponent, ExaminedEvent>(OnExamined);
}

/// <summary>
/// Returns true if a mob's brain has <see cref="UnborgableComponent"/>.
/// </summary>
public bool IsUnborgable(Entity<BodyComponent?> ent)
{
// technically this will apply for any organ not just brain, but assume nobody will be evil and do that
return _body.GetBodyOrganEntityComps<UnborgableComponent>(ent).Count > 0;
Comment on lines +30 to +31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security concern: Potential component abuse.

The comment "assume nobody will be evil" suggests a potential security vulnerability. The system should enforce strict validation rather than relying on assumptions.

Consider implementing proper validation:

-// technically this will apply for any organ not just brain, but assume nobody will be evil and do that
-return _body.GetBodyOrganEntityComps<UnborgableComponent>(ent).Count > 0;
+var organs = _body.GetBodyOrganEntityComps<UnborgableComponent>(ent);
+return organs.Any(organ => HasComp<BrainComponent>(organ.Owner));

Committable suggestion skipped: line range outside the PR's diff.

}
Comment on lines +29 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security concern: Validate organ type in IsUnborgable.

The comment "technically this will apply for any organ not just brain" indicates a potential security issue. The method should explicitly check for brain organs to prevent misuse.

 public bool IsUnborgable(Entity<BodyComponent?> ent)
 {
-    // technically this will apply for any organ not just brain, but assume nobody will be evil and do that
-    return _body.GetBodyOrganEntityComps<UnborgableComponent>(ent).Count > 0;
+    var brainOrgans = _body.GetBodyOrganEntityComps<BrainComponent>(ent);
+    return brainOrgans.Any(brain => HasComp<UnborgableComponent>(brain));
 }

Committable suggestion skipped: line range outside the PR's diff.


private void OnMapInit(Entity<UnborgableComponent> ent, ref MapInitEvent args)
{
if (!TryComp<BodyComponent>(ent, out var body))
return;

var brains = _body.GetBodyOrganEntityComps<InputMoverComponent>((ent.Owner, body));
foreach (var brain in brains)
{
EnsureComp<UnborgableComponent>(brain);
}
}

private void OnExamined(Entity<UnborgableComponent> ent, ref ExaminedEvent args)
{
// need a health analyzer to see if someone can't be borged, can't just look at them and know
if (!args.IsInDetailsRange || HasComp<BodyComponent>(ent))
return;

args.PushMarkup(Loc.GetString("brain-cannot-be-borged-message"));
}
Comment on lines +46 to +53
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Review examination message visibility logic.

The examination message is only shown when the entity has no BodyComponent, which seems counterintuitive. Shouldn't this be visible when examining the brain itself?

Consider this alternative implementation:

-        if (!args.IsInDetailsRange || HasComp<BodyComponent>(ent))
+        if (!args.IsInDetailsRange)
            return;

+        // Only show message when examining the brain itself
+        if (!TryComp<InputMoverComponent>(ent, out _))
+            return;

         args.PushMarkup(Loc.GetString("brain-cannot-be-borged-message"));

Committable suggestion skipped: line range outside the PR's diff.

}
3 changes: 3 additions & 0 deletions Content.Shared/_Shitmed/Surgery/SharedSurgerySystem.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ private void OnToolCanPerform(Entity<SurgeryStepComponent> ent, ref SurgeryCanPe
if (!containerSlot.ContainedEntity.HasValue)
continue;

if (_tagSystem.HasTag(containerSlot.ContainedEntity.Value, "PermissibleForSurgery")) // DeltaV: allow some clothing items to be operated through
continue;

Comment on lines +286 to +288
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding validation for the contained entity.

The code assumes the contained entity is valid. Consider adding explicit validation.

         if (!containerSlot.ContainedEntity.HasValue)
             continue;

+                var containedEntity = containerSlot.ContainedEntity.Value;
+                if (!_entityManager.IsAlive(containedEntity))
+                    continue;
+
-                if (_tagSystem.HasTag(containerSlot.ContainedEntity.Value, "PermissibleForSurgery"))
+                if (_tagSystem.HasTag(containedEntity, PermissibleForSurgeryTag))
                     continue;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (_tagSystem.HasTag(containerSlot.ContainedEntity.Value, "PermissibleForSurgery")) // DeltaV: allow some clothing items to be operated through
continue;
if (!containerSlot.ContainedEntity.HasValue)
continue;
var containedEntity = containerSlot.ContainedEntity.Value;
if (!_entityManager.IsAlive(containedEntity))
continue;
if (_tagSystem.HasTag(containedEntity, PermissibleForSurgeryTag))
continue;

args.Invalid = StepInvalidReason.Armor;
args.Popup = Loc.GetString("surgery-ui-window-steps-error-armor");
return;
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/_Shitmed/Surgery/SharedSurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Content.Shared.Popups;
using Content.Shared.Prototypes;
using Content.Shared.Standing;
using Content.Shared.Tag; // DeltaV: surgery can operate through some clothing
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Network;
Expand All @@ -47,6 +48,7 @@ public abstract partial class SharedSurgerySystem : EntitySystem
[Dependency] private readonly RotateToFaceSystem _rotateToFace = default!;
[Dependency] private readonly StandingStateSystem _standing = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TagSystem _tagSystem = default!; // DeltaV: surgery can operate through some clothing

/// <summary>
/// Cache of all surgery prototypes' singleton entities.
Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/_Impstation/Voice/Reptilian/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["reptillian_hiss1.ogg"]
license: "CC-BY-SA-3.0"
copyright: "Taken from https://github.com/ss220-space/Paradise/commit/6572a5f522e32cb5e0af7fb3ca3e45a725e2e992. Downmixed to 1 channel, volume edited"
source: "https://github.com/ss220-space/Paradise/blob/4bbfb9eb00771b3fae7108fca1a1ba5879926e3e/sound/effects/unathihiss.ogg"
Binary file not shown.
Loading
Loading