Skip to content

Commit

Permalink
Merge branch 'master' into new-ai-objectie
Browse files Browse the repository at this point in the history
Signed-off-by: deltanedas <[email protected]>
  • Loading branch information
deltanedas authored Jan 16, 2025
2 parents 38bd4ba + 11900bc commit c45829b
Show file tree
Hide file tree
Showing 744 changed files with 17,633 additions and 7,952 deletions.
50 changes: 44 additions & 6 deletions Content.Client/CrewManifest/UI/CrewManifestSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,62 @@ public CrewManifestSection(
Text = Loc.GetString($"department-{section.ID}")
});

var gridContainer = new GridContainer()
// Delta-V - changed type from GridContainer to BoxContainer to better handle long names and titles.
var gridContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
Columns = 2
};

// Delta-V - Start of column BoxContainers.
var namesContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Vertical,
HorizontalExpand = true,
SizeFlagsStretchRatio = 3,
};

var titlesContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Vertical,
HorizontalExpand = true,
SizeFlagsStretchRatio = 2,
};

gridContainer.AddChild(namesContainer);
gridContainer.AddChild(titlesContainer);
// Delta-V - end of column BoxContainers.

AddChild(gridContainer);

foreach (var entry in entries)
{
var name = new RichTextLabel()
// Delta-V - start of name and pronoun container
var nameContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
};

var name = new RichTextLabel();
name.SetMessage(entry.Name);

var gender = new RichTextLabel()
{
Margin = new Thickness(6, 0, 0, 0),
StyleClasses = { "CrewManifestGender" }
};
gender.SetMessage(Loc.GetString("gender-display", ("gender", entry.Gender)));

nameContainer.AddChild(name);
nameContainer.AddChild(gender);
// Delta-V - end of name and pronoun container

var titleContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true
HorizontalExpand = true,
SizeFlagsStretchRatio = 1, // Delta-V
};

var title = new RichTextLabel();
Expand All @@ -69,8 +105,10 @@ public CrewManifestSection(
titleContainer.AddChild(title);
}

gridContainer.AddChild(name);
gridContainer.AddChild(titleContainer);
// Delta-V - grid was replaced with two BoxContainer columns
namesContainer.AddChild(nameContainer);
titlesContainer.AddChild(titleContainer);
// Delta-V - end of grid container change
}
}
}
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
9 changes: 9 additions & 0 deletions Content.Client/Stylesheets/StyleNano.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public sealed class StyleNano : StyleBase
public const string StyleClassPinButtonPinned = "pinButtonPinned";
public const string StyleClassPinButtonUnpinned = "pinButtonUnpinned";

//Delta-V - Manifest pronouns
public const string StyleClassCrewManifestGender = "CrewManifestGender";


public override Stylesheet Stylesheet { get; }

Expand Down Expand Up @@ -1291,6 +1294,12 @@ public StyleNano(IResourceCache resCache) : base(resCache)
.Prop("font", notoSansItalic10)
.Prop("font-color", ItemStatusNotHeldColor),

// Delta-V add style for pronouns on the crew manifest
Element<RichTextLabel>()
.Class(StyleClassCrewManifestGender)
.Prop("font", notoSansItalic10)
.Prop("font-style", "italic"),

Element<RichTextLabel>()
.Class(StyleClassItemStatus)
.Prop(nameof(RichTextLabel.LineHeightScale), 0.7f)
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
3 changes: 2 additions & 1 deletion Content.Server/CrewManifest/CrewManifestSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ private void BuildCrewManifest(EntityUid station)
foreach (var recordObject in iter)
{
var record = recordObject.Item2;
var entry = new CrewManifestEntry(record.Name, record.JobTitle, record.JobIcon, record.JobPrototype);
// Delta-V: Added gender to crew manifest
var entry = new CrewManifestEntry(record.Name, record.Gender.ToString().ToLowerInvariant(), record.JobTitle, record.JobIcon, record.JobPrototype);

_prototypeManager.TryIndex(record.JobPrototype, out JobPrototype? job);
entriesSort.Add((job, entry));
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/Kitchen/Components/SharpComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public sealed partial class SharpComponent : Component
[DataField("butcherDelayModifier")]
public float ButcherDelayModifier = 1.0f;

/// <summary>
/// Shitmed: Whether this item had <c>SurgeryToolComponent</c> before sharp was added.
/// </summary>
[DataField]
public bool HadSurgeryTool;

/// <summary>
/// Shitmed: Whether this item had <c>ScalpelComponent</c> before sharp was added.
/// </summary>
Expand Down

This file was deleted.

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

This file was deleted.

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
Loading

0 comments on commit c45829b

Please sign in to comment.