From f60a0f944a3aba7bf6dde7d4ce4026676b5b0715 Mon Sep 17 00:00:00 2001 From: Sir Warock <67167466+SirWarock@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:04:50 +0200 Subject: [PATCH 1/2] One Commit Ops --- Content.Shared/Gravity/SharedGravitySystem.cs | 7 +- .../Inventory/InventorySystem.Relay.cs | 1 + Content.Shared/Slippery/SlipperySystem.cs | 2 +- .../Components/HeavyClothingComponent.cs | 15 ++++ .../Clothing/Systems/HeavyClothingSystem.cs | 69 ++++++++++++++++++ Resources/Locale/en-US/_DV/alerts/alerts.ftl | 3 + Resources/Prototypes/_DV/Alerts/alerts.yml | 8 ++ .../Clothing/OuterClothing/hardsuits.yml | 1 + .../Alerts/heavy_clothing.rsi/enabled.png | Bin 0 -> 430 bytes .../Alerts/heavy_clothing.rsi/meta.json | 14 ++++ 10 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs create mode 100644 Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs create mode 100644 Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/enabled.png create mode 100644 Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/meta.json diff --git a/Content.Shared/Gravity/SharedGravitySystem.cs b/Content.Shared/Gravity/SharedGravitySystem.cs index 7471cc6fe8..48bcb2b09b 100644 --- a/Content.Shared/Gravity/SharedGravitySystem.cs +++ b/Content.Shared/Gravity/SharedGravitySystem.cs @@ -257,4 +257,9 @@ public record struct IsWeightlessEvent(bool IsWeightless = false, bool Handled = /// Raised on an entity when their weightless status changes. /// [ByRefEvent] -public readonly record struct WeightlessnessChangedEvent(bool Weightless); +// Start DeltaV - Made WeightlessnessChangedEvent relay to inventory. +public readonly record struct WeightlessnessChangedEvent(bool Weightless) : IInventoryRelayEvent +{ + SlotFlags IInventoryRelayEvent.TargetSlots => ~SlotFlags.POCKET; +} +// End DeltaV - Made WeightlessnessChangedEvent relay to inventory. diff --git a/Content.Shared/Inventory/InventorySystem.Relay.cs b/Content.Shared/Inventory/InventorySystem.Relay.cs index 8b5ca620e3..b0d8a6ed29 100644 --- a/Content.Shared/Inventory/InventorySystem.Relay.cs +++ b/Content.Shared/Inventory/InventorySystem.Relay.cs @@ -86,6 +86,7 @@ public partial class InventorySystem SubscribeLocalEvent(RefRelayInventoryEvent); SubscribeLocalEvent(RefRelayInventoryEvent); SubscribeLocalEvent(RefRelayInventoryEvent); + SubscribeLocalEvent(RefRelayInventoryEvent); // Heavy Clothing // DeltaV End - Psionic Events // Eye/vision events diff --git a/Content.Shared/Slippery/SlipperySystem.cs b/Content.Shared/Slippery/SlipperySystem.cs index 355d898dbf..489f5a00b8 100644 --- a/Content.Shared/Slippery/SlipperySystem.cs +++ b/Content.Shared/Slippery/SlipperySystem.cs @@ -171,7 +171,7 @@ public sealed class SlipAttemptEvent : EntityEventArgs, IInventoryRelayEvent public EntityUid? SlipCausingEntity; - public SlotFlags TargetSlots { get; } = SlotFlags.FEET; + public SlotFlags TargetSlots { get; } = SlotFlags.FEET | SlotFlags.OUTERCLOTHING; // DeltaV - Added Heavy Clothing public SlipAttemptEvent(EntityUid? slipCausingEntity) { diff --git a/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs b/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs new file mode 100644 index 0000000000..eaaf5a8197 --- /dev/null +++ b/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs @@ -0,0 +1,15 @@ +using Content.Shared.Alert; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared._DV.Clothing.Components; + +[RegisterComponent, NetworkedComponent] +public sealed partial class HeavyClothingComponent : Component +{ + /// + /// The alert shown when wearing heavy clothing. + /// + [DataField] + public ProtoId AlertPrototype = "HeavyClothing"; +} diff --git a/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs b/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs new file mode 100644 index 0000000000..711b62d16c --- /dev/null +++ b/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs @@ -0,0 +1,69 @@ +using Content.Shared._DV.Clothing.Components; +using Content.Shared.Alert; +using Content.Shared.Atmos.Components; +using Content.Shared.Clothing; +using Content.Shared.Gravity; +using Content.Shared.Inventory; +using Content.Shared.Slippery; + +namespace Content.Shared._DV.Clothing.Systems; + +public sealed class HeavyClothingSystem : EntitySystem +{ + [Dependency] private readonly AlertsSystem _alerts = default!; + [Dependency] private readonly SharedGravitySystem _gravity = default!; + + public override void Initialize() + { + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnIsWeightless); + SubscribeLocalEvent>(OnIsWeightless); + SubscribeLocalEvent(OnSlipAttempt); + SubscribeLocalEvent>(OnSlipAttempt); + + } + + private void OnGotUnequipped(Entity clothing, ref ClothingGotUnequippedEvent args) + { + UpdateWindResistance(args.Wearer, clothing, false); + } + + private void OnGotEquipped(Entity clothing, ref ClothingGotEquippedEvent args) + { + UpdateWindResistance(args.Wearer, clothing, !_gravity.IsWeightless(args.Wearer)); + } + + public void UpdateWindResistance(EntityUid user, Entity clothing, bool state) + { + // TODO: public api for this and add access + if (TryComp(user, out var moved)) + moved.Enabled = !state; + + if (state) + _alerts.ShowAlert(user, clothing.Comp.AlertPrototype); + else + _alerts.ClearAlert(user, clothing.Comp.AlertPrototype); + } + + private void OnIsWeightless(Entity clothing, ref WeightlessnessChangedEvent args) + { + UpdateWindResistance(clothing, clothing, !args.Weightless); + } + + private void OnIsWeightless(Entity clothing, ref InventoryRelayedEvent args) + { + OnIsWeightless(clothing, ref args.Args); + UpdateWindResistance(args.Owner, clothing, !args.Args.Weightless); + } + + private void OnSlipAttempt(Entity clothing, ref SlipAttemptEvent args) + { + args.NoSlip = !_gravity.IsWeightless(clothing.Owner); + } + + private void OnSlipAttempt(Entity clothing, ref InventoryRelayedEvent args) + { + args.Args.NoSlip = !_gravity.IsWeightless(args.Owner); + } +} diff --git a/Resources/Locale/en-US/_DV/alerts/alerts.ftl b/Resources/Locale/en-US/_DV/alerts/alerts.ftl index cdd71403bb..58f53f2cd2 100644 --- a/Resources/Locale/en-US/_DV/alerts/alerts.ftl +++ b/Resources/Locale/en-US/_DV/alerts/alerts.ftl @@ -14,3 +14,6 @@ alerts-light-level-bright-desc = You are in an area with bright light. alerts-resurrecting-name = Resurrecting alerts-resurrecting-desc = You are currently dead, but will resurrect soon. + +alert-heavy-clothing-name = You're [color=yellow]heavy[/color] +alert-heavy-clothing-desc = Heavy gear is weighing you down, rendering you [color=yellow]immune[/color] to space wind and slippery surfaces! diff --git a/Resources/Prototypes/_DV/Alerts/alerts.yml b/Resources/Prototypes/_DV/Alerts/alerts.yml index 1c762016c3..bbec237100 100644 --- a/Resources/Prototypes/_DV/Alerts/alerts.yml +++ b/Resources/Prototypes/_DV/Alerts/alerts.yml @@ -4,3 +4,11 @@ icons: [ /Textures/_DV/Interface/Alerts/Grappled/grappled.png ] name: alerts-grappled-name description: alerts-grappled-desc + +- type: alert + id: HeavyClothing + icons: + - sprite: /Textures/_DV/Interface/Alerts/heavy_clothing.rsi + state: enabled + name: alert-heavy-clothing-name + description: alert-heavy-clothing-desc diff --git a/Resources/Prototypes/_DV/Entities/Clothing/OuterClothing/hardsuits.yml b/Resources/Prototypes/_DV/Entities/Clothing/OuterClothing/hardsuits.yml index 14fc71d7f0..3231cb8983 100644 --- a/Resources/Prototypes/_DV/Entities/Clothing/OuterClothing/hardsuits.yml +++ b/Resources/Prototypes/_DV/Entities/Clothing/OuterClothing/hardsuits.yml @@ -132,6 +132,7 @@ sprintModifier: 0.60 - type: ToggleableClothing clothingPrototype: ClothingHeadHelmetHardsuitCombatRiot + - type: HeavyClothing - type: entity parent: ClothingOuterHardsuitCombatRiot diff --git a/Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/enabled.png b/Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/enabled.png new file mode 100644 index 0000000000000000000000000000000000000000..21f88ae6c05902b1f3ab834b1ce55adc02660304 GIT binary patch literal 430 zcmV;f0a5;mP)Px$Xh}ptR9J=Wl`(IFFc5`bq;A=gDZs!GiAV?*#Lx|?Luvmouyv2JM2gg*15yp0 z7(2U557}TFNY!NVw;;~vd+*K`02Yho&aAH4lxGQ7#ml$T;(8C)2tU0(>QeYpBeM+5 z5C#AQQM}m5WI~=Ld`cJq*yp$OUKJ&L&zUq~oWNhi!#IWKZUKOsOlS?5#D{_=f+$AK zTK@j=r8Hrjz#O5fC`U1&`$?3p@+{%Pg)$0;aXQLTiC0Al)f9{q&~-;#&d1rE>d+dX zi=@JHw_r_&FiuewC7xe$qX=ud`34UA9S@=y>y10v-Q|3Q?>W+>RHi8p!00k+Cm@Qe zI-sKKjSGJeA3}Lx?PyJFKsPoL=!*jV6M$rf5Z9Fk4*MMk(BD$lbiELbR1^k)nzd3# zlvn@8qwS4Qtn|9UHhMl7U;BAaM-8gmgCljqbl-u~_cH Y4`8~w=dKo1rvLx|07*qoM6N<$f)iQ2R{#J2 literal 0 HcmV?d00001 diff --git a/Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/meta.json b/Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/meta.json new file mode 100644 index 0000000000..55e8b2ab76 --- /dev/null +++ b/Resources/Textures/_DV/Interface/Alerts/heavy_clothing.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CC-BY-SA-4.0", + "copyright": "Enabled Sprite sprited by SirWarock on Github for DeltaV.", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "enabled" + } + ] +} From ebb8e7c6cbe787323e1de6bbfc6dafa4c6548466 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:08:35 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../_DV/Clothing/Components/HeavyClothingComponent.cs | 2 +- Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs b/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs index eaaf5a8197..c103903770 100644 --- a/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs +++ b/Content.Shared/_DV/Clothing/Components/HeavyClothingComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.Alert; +using Content.Shared.Alert; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; diff --git a/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs b/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs index 711b62d16c..494320ee32 100644 --- a/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs +++ b/Content.Shared/_DV/Clothing/Systems/HeavyClothingSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared._DV.Clothing.Components; +using Content.Shared._DV.Clothing.Components; using Content.Shared.Alert; using Content.Shared.Atmos.Components; using Content.Shared.Clothing;