Skip to content

Commit

Permalink
Merge branch 'master' into wall-locker-ops
Browse files Browse the repository at this point in the history
Signed-off-by: boogiebogus <[email protected]>
  • Loading branch information
boogiebogus authored Jan 15, 2025
2 parents 3bc3af7 + 7ca7d9c commit 468cc47
Show file tree
Hide file tree
Showing 503 changed files with 10,999 additions and 4,607 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
13 changes: 10 additions & 3 deletions Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ private void OnGetProgress(EntityUid uid, KillPersonConditionComponent comp, ref

private void OnPersonAssigned(Entity<PickRandomPersonComponent> ent, ref ObjectiveAssignedEvent args)
{
AssignRandomTarget(ent, args, _ => true);
AssignRandomTarget(ent, ref args, _ => true);
}

private void OnHeadAssigned(Entity<PickRandomHeadComponent> ent, ref ObjectiveAssignedEvent args)
{
AssignRandomTarget(ent, args, mindId =>
AssignRandomTarget(ent, ref args, mindId =>
TryComp<MindComponent>(mindId, out var mind) &&
mind.OwnedEntity is { } ownedEnt &&
HasComp<CommandStaffComponent>(ownedEnt));
}

private void AssignRandomTarget(EntityUid uid, ObjectiveAssignedEvent args, Predicate<EntityUid> filter, bool fallbackToAny = true)
private void AssignRandomTarget(EntityUid uid, ref ObjectiveAssignedEvent args, Predicate<EntityUid> filter, bool fallbackToAny = true)
{
// invalid prototype
if (!TryComp<TargetObjectiveComponent>(uid, out var target))
Expand Down Expand Up @@ -97,6 +97,13 @@ private void AssignRandomTarget(EntityUid uid, ObjectiveAssignedEvent args, Pred
// Pick between humans matching our filter or fall back to all humans alive
var selectedHumans = filteredHumans.Count > 0 ? filteredHumans : allHumans;

// Still no valid targets even after the fallback
if (selectedHumans.Count == 0)
{
args.Cancelled = true;
return;
}

_target.SetTarget(uid, _random.Pick(selectedHumans), target);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public sealed partial class TeslaEnergyBallComponent : Component
/// The amount of energy to which the tesla must reach in order to be destroyed.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float EnergyToDespawn = -100f;
public float EnergyToDespawn = -540f; // DeltaV, make the Tesla take as long to fail as the singulo.

/// <summary>
/// Played when energy reaches the lower limit (and entity destroyed)
Expand Down
61 changes: 0 additions & 61 deletions Content.Server/_DV/RoundEnd/RoundEndSystem.Pacified.cs

This file was deleted.

60 changes: 60 additions & 0 deletions Content.Server/_Harmony/RoundEnd/PacifyAllCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Credits:
// This code was originally created by DebugOk, deltanedas, and NullWanderer for DeltaV.
// Available at https://github.com/DebugOk/Delta-v/blob/master/Content.Server/DeltaV/RoundEnd/RoundEndSystem.Pacified.cs
// Original PR: https://github.com/DeltaV-Station/Delta-v/pull/350
// Modified by FluffMe on 12.10.2024 with no major changes except the Namespaces and the CVar name.
// Modified and moved by youtissoum on 04.01.2025 to turn into a command.
using Content.Server.Administration;
using Content.Server.Explosion.Components; // DeltaV
using Content.Shared.Administration;
using Content.Shared.CombatMode;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Explosion.Components;
using Content.Shared.Flash.Components;
using Content.Shared.Store.Components;
using Robust.Shared.Console;

namespace Content.Server._Harmony.RoundEnd;

[AdminCommand(AdminFlags.Admin)]
public sealed class PacifyAllCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entityManager = default!;

public string Command => "pacifyall";
public string Description => "Pacify all players permanently.";
public string Help => string.Empty;

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var harmQuery = _entityManager.EntityQueryEnumerator<CombatModeComponent>();
while (harmQuery.MoveNext(out var uid, out _))
{
_entityManager.EnsureComponent<PacifiedComponent>(uid);
}

var explosiveQuery = _entityManager.EntityQueryEnumerator<ExplosiveComponent>();
while (explosiveQuery.MoveNext(out var uid, out _))
{
_entityManager.RemoveComponent<ExplosiveComponent>(uid);
}

var grenadeQuery = _entityManager.EntityQueryEnumerator<OnUseTimerTriggerComponent>();
while (grenadeQuery.MoveNext(out var uid, out _))
{
_entityManager.RemoveComponent<OnUseTimerTriggerComponent>(uid);
}

var flashQuery = _entityManager.EntityQueryEnumerator<FlashComponent>();
while (flashQuery.MoveNext(out var uid, out _))
{
_entityManager.RemoveComponent<FlashComponent>(uid);
}

var uplinkQuery = _entityManager.EntityQueryEnumerator<StoreComponent>();
while (uplinkQuery.MoveNext(out var uid, out _))
{
_entityManager.RemoveComponent<StoreComponent>(uid);
}
}
}
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
2 changes: 2 additions & 0 deletions Content.Shared/Humanoid/HumanoidVisualLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public enum HumanoidVisualLayers : byte
Hair,
FacialHair,
Chest,
Underwear, // DeltaV
Undershirt, // DeltaV
Head,
Snout,
HeadSide, // side parts (i.e., frills)
Expand Down
4 changes: 4 additions & 0 deletions Content.Shared/Humanoid/Markings/MarkingCategories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum MarkingCategories : byte
HeadSide,
Snout,
Chest,
Underwear, // DeltaV
Undershirt, // DeltaV
Arms,
Legs,
Tail,
Expand All @@ -32,6 +34,8 @@ public static MarkingCategories FromHumanoidVisualLayers(HumanoidVisualLayers la
HumanoidVisualLayers.HeadTop => MarkingCategories.HeadTop,
HumanoidVisualLayers.HeadSide => MarkingCategories.HeadSide,
HumanoidVisualLayers.Snout => MarkingCategories.Snout,
HumanoidVisualLayers.Undershirt => MarkingCategories.Undershirt, // DeltaV
HumanoidVisualLayers.Underwear => MarkingCategories.Underwear, // DeltaV
HumanoidVisualLayers.Chest => MarkingCategories.Chest,
HumanoidVisualLayers.RArm => MarkingCategories.Arms,
HumanoidVisualLayers.LArm => MarkingCategories.Arms,
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 468cc47

Please sign in to comment.