Skip to content

Commit

Permalink
Merge branch 'master' into sec-nonlethal-reversion
Browse files Browse the repository at this point in the history
  • Loading branch information
BlitzTheSquishy authored Jan 11, 2025
2 parents 01d5211 + 3270d4d commit 6af1a7c
Show file tree
Hide file tree
Showing 256 changed files with 9,806 additions and 3,523 deletions.
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
9 changes: 9 additions & 0 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Content.Server.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
[Dependency] private readonly BloodstreamSystem _bloodstream = default!; // Shitmed Change
[Dependency] private readonly GhostSystem _ghostSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
Expand Down Expand Up @@ -195,5 +196,13 @@ protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceC
Dirty(target, bodyAppearance);
}

protected override void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
{
var bleeding = partEnt.Comp.SeverBleeding;
if (partEnt.Comp.IsVital)
bleeding *= 2f;
_bloodstream.TryModifyBleedAmount(bodyEnt, bleeding);
}

// Shitmed Change End
}
2 changes: 1 addition & 1 deletion Content.Server/Cloning/CloningConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private CloningConsoleBoundUserInterfaceState GetUserInterfaceState(CloningConso
{
scanBodyInfo = MetaData(scanBody.Value).EntityName;

if (false) // GoobStation: Lets you clone living people
if (!_mobStateSystem.IsDead(scanBody.Value))
{
clonerStatus = ClonerStatus.ScannerOccupantAlive;
}
Expand Down
12 changes: 5 additions & 7 deletions Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
return false;

var mind = mindEnt.Comp;
// GoobStation: Remove this logic entirely, infinite clone army
/*if (ClonesWaitingForMind.TryGetValue(mind, out var clone))
if (ClonesWaitingForMind.TryGetValue(mind, out var clone))
{
if (EntityManager.EntityExists(clone) &&
!_mobStateSystem.IsDead(clone) &&
Expand All @@ -160,11 +159,10 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
return false; // Mind already has clone

ClonesWaitingForMind.Remove(mind);
}*/
}

// GoobStation: Lets you clone living people
//if (mind.OwnedEntity != null && !_mobStateSystem.IsDead(mind.OwnedEntity.Value))
// return false; // Body controlled by mind is not dead
if (mind.OwnedEntity != null && !_mobStateSystem.IsDead(mind.OwnedEntity.Value))
return false; // Body controlled by mind is not dead

// Yes, we still need to track down the client because we need to open the Eui
if (mind.UserId == null || !_playerManager.TryGetSessionById(mind.UserId.Value, out var client))
Expand Down Expand Up @@ -253,7 +251,7 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
cloneMindReturn.Mind = mind;
cloneMindReturn.Parent = uid;
_containerSystem.Insert(mob, clonePod.BodyContainer);
//ClonesWaitingForMind.Add(mind, mob); // GoobStation
ClonesWaitingForMind.Add(mind, mob);
UpdateStatus(uid, CloningPodStatus.NoMind, clonePod);
_euiManager.OpenEui(new AcceptCloningEui(mindEnt, mind, this), client);

Expand Down

This file was deleted.

47 changes: 0 additions & 47 deletions Content.Server/Nyanotrasen/Abilities/Borgs/FabricateCandySystem.cs

This file was deleted.

68 changes: 68 additions & 0 deletions Content.Server/_DV/FeedbackPopup/FeedbackPopupCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using System.Linq;
using Content.Server.Administration;
using Content.Shared._DV.FeedbackOverwatch;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;

namespace Content.Server._DV.FeedbackPopup;

[AdminCommand(AdminFlags.Server)]
public sealed class FeedbackPopupCommand : LocalizedEntityCommands
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedFeedbackOverwatchSystem _feedback = default!;

public override string Command => Loc.GetString("feedbackpopup-command-name");

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 2)
{
shell.WriteError(Loc.GetString("feedbackpopup-command-error-wrong-arguments"));
return;
}

if (!int.TryParse(args[0], out var entityUidInt))
{
shell.WriteError(Loc.GetString("feedbackpopup-command-error-invalid-uid"));
return;
}

var netEnt = new NetEntity(entityUidInt);

if (!EntityManager.TryGetEntity(netEnt, out var target))
{
shell.WriteLine(Loc.GetString("feedbackpopup-command-error-entity-not-found"));
return;
}

if (!_proto.HasIndex<FeedbackPopupPrototype>(args[1]))
{
shell.WriteError(Loc.GetString("feedbackpopup-command-error-invalid-proto"));
return;
}

if (!_feedback.SendPopup(target, args[1]))
{
shell.WriteError(Loc.GetString("feedbackpopup-command-error-popup-send-fail"));
return;
}

shell.WriteLine(Loc.GetString("feedbackpopup-command-success"));
}

public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{
if (args.Length == 1)
{
return CompletionResult.FromHint(Loc.GetString("feedbackpopup-command-hint-playerUid"));
}

if (args.Length == 2)
{
return CompletionResult.FromHintOptions(_feedback.FeedbackPopupProtoIds, Loc.GetString("feedbackpopup-command-hint-protoId"));
}
return CompletionResult.Empty;
}
}
8 changes: 6 additions & 2 deletions Content.Server/_DV/NPC/Roboisseur/RoboisseurComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ public sealed partial class RoboisseurComponent : Component
"FoodMothHeartburnSoup",
"FoodSoupBisque",
"FoodCakeSlime",
"FoodBurgerCrazy"
"FoodBurgerCrazy",
"FoodMealPoachedPears",
"FoodMealPearsBelleHelene",
"FoodTartPearCheese",
};

[DataField("robossuierRewards")]
Expand Down Expand Up @@ -302,7 +305,8 @@ public sealed partial class RoboisseurComponent : Component
"LeavesCannabisRainbowDried",
"LeavesCannabisDried",
"FoodCakeBrain",
"FoodBurgerBrain"
"FoodBurgerBrain",
"FoodMeatAnomaly",
};
}
}
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
1 change: 1 addition & 0 deletions Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<Acc
"Prosecutor", // Delta V - Add Prosecutor access
"Robotics", // DeltaV
"Clerk", // Delta V - Add Clerk access
"Surgery", // Delta V - Add Surgery access
};

[Serializable, NetSerializable]
Expand Down
8 changes: 4 additions & 4 deletions Content.Shared/Body/Part/BodyPartComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
public BodyPartSlot? ParentSlot;

/// <summary>
/// Shitmed Change: Amount of damage to deal when the part gets removed.
/// Only works if IsVital is true.
/// Shitmed Change: Bleeding stacks to give when this body part is severed.
/// Doubled for <see cref="IsVital"/>. parts.
/// </summary>
[DataField, AutoNetworkedField]
public FixedPoint2 VitalDamage = 100;
[DataField]
public float SeverBleeding = 4f;

[DataField, AlwaysPushInheritance]
public string ToolName { get; set; } = "A body part";
Expand Down
14 changes: 2 additions & 12 deletions Content.Shared/Body/Systems/SharedBodySystem.Parts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,9 @@ private void RemoveLeg(Entity<BodyPartComponent> legEnt, Entity<BodyComponent?>
}
}

private void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
// Shitmed Change: made virtual, bleeding damage is done on server
protected virtual void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
{
if (!Resolve(bodyEnt, ref bodyEnt.Comp, logMissing: false))
return;

if (!_timing.ApplyingState
&& partEnt.Comp.IsVital
&& !GetBodyChildrenOfType(bodyEnt, partEnt.Comp.PartType, bodyEnt.Comp).Any()
)
{
var damage = new DamageSpecifier(Prototypes.Index<DamageTypePrototype>("Bloodloss"), partEnt.Comp.VitalDamage); // Shitmed Change
Damageable.TryChangeDamage(bodyEnt, damage, partMultiplier: 0f); // Shitmed Change
}
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions Content.Shared/Lock/LockSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.ActionBlocker;
using Content.Shared.Construction.Components;
using Content.Shared.DoAfter;
using Content.Shared.Emag.Systems;
using Content.Shared.Examine;
using Content.Shared.Hands.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Popups;
Expand All @@ -26,6 +26,7 @@ namespace Content.Shared.Lock;
public sealed class LockSystem : EntitySystem
{
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly ActivatableUISystem _activatableUI = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
Expand Down Expand Up @@ -246,7 +247,7 @@ public bool IsLocked(Entity<LockComponent?> ent)
/// </summary>
public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true)
{
if (!HasComp<HandsComponent>(user))
if (!_actionBlocker.CanComplexInteract(user))
return false;

var ev = new LockToggleAttemptEvent(user, quiet);
Expand Down
4 changes: 0 additions & 4 deletions Content.Shared/Nyanotrasen/Actions/FabricateCandyEvent.cs

This file was deleted.

Loading

0 comments on commit 6af1a7c

Please sign in to comment.