Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Add-envelopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Forzii committed Feb 21, 2025
2 parents 75e0317 + 8f6aa7b commit 27db3be
Show file tree
Hide file tree
Showing 135 changed files with 4,580 additions and 284 deletions.
8 changes: 0 additions & 8 deletions Content.Client/Clothing/MagbootsSystem.cs

This file was deleted.

5 changes: 4 additions & 1 deletion Content.Client/Consent/UI/Windows/ConsentWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;

namespace Content.Client.Consent.UI.Windows;

Expand Down Expand Up @@ -157,7 +158,9 @@ public void UpdateUi()

_entries.Clear();

var consentprototypelist = _protoManager.EnumeratePrototypes<ConsentTogglePrototype>();
var consentprototypelist = _protoManager.EnumeratePrototypes<ConsentTogglePrototype>().ToList();
consentprototypelist.Sort();

foreach (var prototype in consentprototypelist)
AddConsentEntry(prototype);

Expand Down
31 changes: 0 additions & 31 deletions Content.Server/Atmos/Components/MovedByPressureComponent.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
mixtures[5].Temperature = 5000f;

// 6: (Walk-In) Freezer
mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard);
mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
// TODO: Adjust pressure? (test first)
mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard * Atmospherics.T20C / 235f);
mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard * Atmospherics.T20C / 235f);
mixtures[6].Temperature = 235f; // Little colder than an actual freezer but gives a grace period to get e.g. themomachines set up, should keep warm for a few door openings

foreach (var arg in args)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Humanoid;
using Content.Shared.Mobs.Components;
using Content.Shared.Physics;
Expand Down
24 changes: 24 additions & 0 deletions Content.Server/Atmos/Piping/Other/Components/GasTesterComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Content.Shared.Atmos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Content.Server.Atmos.Piping.Other.Components
{
[RegisterComponent]
public sealed partial class GasTesterComponent : Component
{
[DataField("mixzero")]
public GasMixture MixZero { get; set; } = new();

[DataField("mix-x")]
public GasMixture MixX { get; set; } = new();

[DataField("mix-y")]
public GasMixture MixY { get; set; } = new();

public GasMixture MixLocal;
}
}
51 changes: 51 additions & 0 deletions Content.Server/Atmos/Piping/Other/EntitySystems/GasTesterSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Components;
using Content.Server.Atmos.Piping.Other.Components;
using Content.Shared.Atmos;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Content.Server.Atmos.Piping.Other.EntitySystems
{
[UsedImplicitly]
public sealed class GasTesterSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;

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

SubscribeLocalEvent<GasTesterComponent, AtmosDeviceUpdateEvent>(OnTesterUpdated);
}

private void OnTesterUpdated(Entity<GasTesterComponent> ent, ref AtmosDeviceUpdateEvent args)
{
var (uid, tester) = ent;
GasMixture? containingMixture = _atmosphereSystem.GetContainingMixture(uid);
if (containingMixture == null)
return;

if (tester.MixLocal == null)
{
Vector2i tilePos = _transformSystem.GetGridTilePositionOrDefault(uid);
tester.MixLocal = tester.MixZero.Clone();
GasMixture mixXComp = tester.MixX.Clone(),
mixYComp = tester.MixY.Clone();
mixXComp.Multiply(tilePos.X);
mixYComp.Multiply(tilePos.Y);
_atmosphereSystem.Merge(tester.MixLocal, mixXComp);
_atmosphereSystem.Merge(tester.MixLocal, mixYComp);
}

containingMixture.Clear();
_atmosphereSystem.Merge(containingMixture, tester.MixLocal);
}
}
}
49 changes: 0 additions & 49 deletions Content.Server/Clothing/MagbootsSystem.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Content.Server/Damage/Systems/GodmodeSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos.Components;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;

Expand Down
32 changes: 21 additions & 11 deletions Content.Server/FloofStation/VoreSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Interaction.Events;
using Content.Shared.Hands.EntitySystems;
using Content.Server.Carrying;

namespace Content.Server.FloofStation;

Expand All @@ -61,6 +62,7 @@ public sealed class VoreSystem : EntitySystem
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly FoodSystem _food = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly CarryingSystem _carrying = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -98,13 +100,13 @@ private void DevourVerb(EntityUid uid, VoreComponent component, GetVerbsEvent<In
|| !voreuser.CanVore
|| !TryComp<VoreComponent>(args.Target, out var voretarget)
|| !voretarget.CanBeVored
|| !_consent.HasConsent(args.User, "Vore")
|| !_consent.HasConsent(args.User, "VorePred")
|| !_consent.HasConsent(args.Target, "Vore"))
return;

InnateVerb verbDevour = new()
{
Act = () => TryDevour(args.User, args.Target, component),
Act = () => TryDevour(args.User, args.Target, component, false),
Text = Loc.GetString("vore-devour"),
Category = VerbCategory.Interaction,
Icon = new SpriteSpecifier.Rsi(new ResPath("Interface/Actions/devour.rsi"), "icon-on"),
Expand All @@ -122,13 +124,13 @@ private void InsertSelfVerb(EntityUid uid, GetVerbsEvent<InnateVerb> args)
|| !voreuser.CanBeVored
|| !TryComp<VoreComponent>(args.Target, out var voretarget)
|| !voretarget.CanVore
|| !_consent.HasConsent(args.Target, "Vore")
|| !_consent.HasConsent(args.Target, "VorePred")
|| !_consent.HasConsent(args.User, "Vore"))
return;

InnateVerb verbInsert = new()
{
Act = () => TryDevour(args.Target, args.User, voretarget),
Act = () => TryDevour(args.Target, args.User, voretarget, true),
Text = Loc.GetString("action-name-insert-self"),
Category = VerbCategory.Interaction,
Icon = new SpriteSpecifier.Rsi(new ResPath("Interface/Actions/devour.rsi"), "icon"),
Expand Down Expand Up @@ -186,25 +188,30 @@ private void VoreVerb(EntityUid uid, VoreComponent component, GetVerbsEvent<Inna
}
}

public void TryDevour(EntityUid uid, EntityUid target, VoreComponent? component = null)
public void TryDevour(EntityUid uid, EntityUid target, VoreComponent? component = null, bool isInsertion = false)
{
if (!Resolve(uid, ref component))
return;

if (_food.IsMouthBlocked(uid, uid))
return;

_popups.PopupEntity(Loc.GetString("vore-attempt-devour", ("entity", uid), ("prey", target)), uid, target, PopupType.MediumCaution);
_popups.PopupEntity(Loc.GetString("vore-attempt-devour", ("entity", uid), ("prey", target)), target, uid, PopupType.MediumCaution);
if (isInsertion) {
_popups.PopupEntity(Loc.GetString("vore-attempt-insert", ("entity", uid), ("prey", target)), uid, target, PopupType.MediumCaution);
_popups.PopupEntity(Loc.GetString("vore-attempt-insert", ("entity", uid), ("prey", target)), target, uid, PopupType.MediumCaution);
} else {
_popups.PopupEntity(Loc.GetString("vore-attempt-devour", ("entity", uid), ("prey", target)), uid, target, PopupType.MediumCaution);
_popups.PopupEntity(Loc.GetString("vore-attempt-devour", ("entity", uid), ("prey", target)), target, uid, PopupType.MediumCaution);
}

if (!TryComp<PhysicsComponent>(uid, out var predPhysics)
|| !TryComp<PhysicsComponent>(target, out var preyPhysics))
return;

var length = TimeSpan.FromSeconds(component.Delay
* _contests.MassContest(preyPhysics, predPhysics, false, 4f)
* _contests.StaminaContest(uid, target)
* (_standingState.IsDown(target) ? 0.5f : 1));
* _contests.MassContest(preyPhysics, predPhysics, false, 4f) // Big things are harder to fit in small things
* _contests.StaminaContest(isInsertion?target:uid, isInsertion?uid:target) // The person doing the action having higher stamina makes it easier
* (_standingState.IsDown(isInsertion?uid:target) ? 0.5f : 1)); // If the person having the action done to them is on the ground it's easier

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, uid, length, new VoreDoAfterEvent(), uid, target: target)
{
Expand Down Expand Up @@ -240,6 +247,9 @@ public void Devour(EntityUid uid, EntityUid target, VoreComponent? component = n
if (TryComp<TemperatureComponent>(target, out var temp))
temp.AtmosTemperatureTransferEfficiency = 0;

_carrying.DropCarried(uid, target);
_carrying.DropCarried(target, uid);

_containerSystem.Insert(target, component.Stomach);

if (_playerManager.TryGetSessionByEntity(target, out var sessionprey)
Expand Down Expand Up @@ -426,7 +436,7 @@ private void FullyDigest(EntityUid uid, EntityUid prey)

private void OnExamine(EntityUid uid, ExaminedEvent args)
{
if (!_consent.HasConsent(args.Examiner, "Vore"))
if (!(_consent.HasConsent(args.Examiner, "Vore") || _consent.HasConsent(args.Examiner, "VorePred")))
return;

if (!_containerSystem.TryGetContainer(uid, "stomach", out var stomach)
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Gravity/GravitySystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Shared.Gravity;
using JetBrains.Annotations;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;

namespace Content.Server.Gravity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Content.Shared.Medical.SuitSensor;
using Robust.Shared.Audio; // DeltaV
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; // DeltaV

namespace Content.Server.Medical.CrewMonitoring;

[RegisterComponent]
[RegisterComponent, AutoGenerateComponentPause] // DeltaV - add AutoGenerateComponentPause
[Access(typeof(CrewMonitoringConsoleSystem))]
public sealed partial class CrewMonitoringConsoleComponent : Component
{
Expand All @@ -16,4 +18,35 @@ public sealed partial class CrewMonitoringConsoleComponent : Component
/// </summary>
[DataField("sensorTimeout"), ViewVariables(VVAccess.ReadWrite)]
public float SensorTimeout = 10f;

// DeltaV - start of alert system code
/// <summary>
/// Should the component beep if someone goes critical or dies
/// </summary>
[DataField]
public bool AlertsEnabled = true;

/// <summary>
/// Track sensors that have triggered the crew member critical alert.
/// </summary>
public HashSet<string> AlertedSensors = [];

/// <summary>
/// Timestamp of the next possible alert (alert cooldown)
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextAlert;

/// <summary>
/// Time between alerts
/// </summary>
[DataField]
public TimeSpan AlertCooldown = TimeSpan.FromSeconds(15);

/// <summary>
/// Alert sound that is played when a crew member goes into critical / dies.
/// </summary>
[DataField]
public SoundSpecifier AlertSound = new SoundPathSpecifier("/Audio/_DV/Medical/CrewMonitoring/crew_alert.ogg");
// DeltaV - end of alert system code
}
Loading

0 comments on commit 27db3be

Please sign in to comment.