Skip to content

Commit

Permalink
Merge pull request #174 from EndrAnimet/up
Browse files Browse the repository at this point in the history
💀
  • Loading branch information
GeneralGaws authored Jan 12, 2025
2 parents 9cffeab + 4bccb4e commit 9be051d
Show file tree
Hide file tree
Showing 203 changed files with 7,968 additions and 3,201 deletions.
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
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;
}

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"));
}
}
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;

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

0 comments on commit 9be051d

Please sign in to comment.