From: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Date: Mon, 7 Jul 2025 21:43:33 +0000 (+0200)
Subject: New science unlock: the H.A.R.M.P.A.C.K (#38824)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=46ec3b402afffc6123cbc15ecc9d87aeae960b4d;p=space-station-14.git
New science unlock: the H.A.R.M.P.A.C.K (#38824)
---
diff --git a/Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs b/Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs
new file mode 100644
index 0000000000..fb3685c386
--- /dev/null
+++ b/Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs
@@ -0,0 +1,18 @@
+using Robust.Shared.GameStates;
+using Content.Shared.Hands.EntitySystems;
+
+namespace Content.Shared.Hands.Components;
+
+///
+/// An entity with this component will give you extra hands when you equip it in your inventory.
+///
+[RegisterComponent, NetworkedComponent]
+[Access(typeof(ExtraHandsEquipmentSystem))]
+public sealed partial class ExtraHandsEquipmentComponent : Component
+{
+ ///
+ /// Dictionary relating a unique hand ID corresponding to a container slot on the attached entity to a struct containing information about the Hand itself.
+ ///
+ [DataField]
+ public Dictionary Hands = new();
+}
diff --git a/Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs b/Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs
new file mode 100644
index 0000000000..4b96f89d81
--- /dev/null
+++ b/Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs
@@ -0,0 +1,43 @@
+using Content.Shared.Hands.Components;
+using Content.Shared.Inventory.Events;
+
+namespace Content.Shared.Hands.EntitySystems;
+
+public sealed class ExtraHandsEquipmentSystem : EntitySystem
+{
+ [Dependency] private readonly SharedHandsSystem _hands = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent(OnEquipped);
+ SubscribeLocalEvent(OnUnequipped);
+ }
+
+ private void OnEquipped(Entity ent, ref GotEquippedEvent args)
+ {
+ if (!TryComp(args.Equipee, out var handsComp))
+ return;
+
+ foreach (var (handName, hand) in ent.Comp.Hands)
+ {
+ // add the NetEntity id to the container name to prevent multiple items with this component from conflicting
+ var handId = $"{GetNetEntity(ent.Owner).Id}-{handName}";
+ _hands.AddHand((args.Equipee, handsComp), handId, hand.Location);
+ }
+ }
+
+ private void OnUnequipped(Entity ent, ref GotUnequippedEvent args)
+ {
+ if (!TryComp(args.Equipee, out var handsComp))
+ return;
+
+ foreach (var handName in ent.Comp.Hands.Keys)
+ {
+ // add the NetEntity id to the container name to prevent multiple items with this component from conflicting
+ var handId = $"{GetNetEntity(ent.Owner).Id}-{handName}";
+ _hands.RemoveHand((args.Equipee, handsComp), handId);
+ }
+ }
+}
diff --git a/Resources/Locale/en-US/research/technologies.ftl b/Resources/Locale/en-US/research/technologies.ftl
index 876579eea5..62432b8dd6 100644
--- a/Resources/Locale/en-US/research/technologies.ftl
+++ b/Resources/Locale/en-US/research/technologies.ftl
@@ -39,6 +39,7 @@ research-technology-kinetic-modifications = Kinetic Modifications
research-technology-basic-shuttle-armament = Shuttle Basic Armament
research-technology-advanced-shuttle-weapon = Advanced Shuttle Weapons
research-technology-thermal-weaponry = Thermal Weaponry
+research-technology-dual-wielding-technology = Dual Wielding Technology
research-technology-basic-robotics = Basic Robotics
research-technology-basic-anomalous-research = Basic Anomalous Research
diff --git a/Resources/Prototypes/Entities/Clothing/Back/specific.yml b/Resources/Prototypes/Entities/Clothing/Back/specific.yml
index ff06b93bbf..d303aa166c 100644
--- a/Resources/Prototypes/Entities/Clothing/Back/specific.yml
+++ b/Resources/Prototypes/Entities/Clothing/Back/specific.yml
@@ -98,3 +98,25 @@
- type: Construction
graph: ClothingBagPet
node: bagPet
+
+- type: entity
+ parent: Clothing
+ id: ClothingBackpackHarmpack
+ name: H.A.R.M.P.A.C.K.
+ description: Now you can reload, punch, and eat a snack - simultaneously.
+ components:
+ - type: Sprite
+ sprite: Clothing/Back/Specific/harmpack.rsi
+ state: icon
+ - type: Item
+ size: Ginormous
+ - type: Clothing
+ slots: BACK
+ - type: ExtraHandsEquipment
+ hands:
+ # middle hands to prevent overlapping inhand sprites
+ # This can be changed once we have per-hand displacement maps
+ extra_hand_1:
+ location: Middle
+ extra_hand_2:
+ location: Middle
diff --git a/Resources/Prototypes/Recipes/Lathes/Packs/science.yml b/Resources/Prototypes/Recipes/Lathes/Packs/science.yml
index 6308570e6f..164a85dc44 100644
--- a/Resources/Prototypes/Recipes/Lathes/Packs/science.yml
+++ b/Resources/Prototypes/Recipes/Lathes/Packs/science.yml
@@ -30,6 +30,7 @@
- SignallerAdvanced
- DeviceQuantumSpinInverter
- DeviceDesynchronizer
+ - ClothingBackpackHarmpack
- type: latheRecipePack
id: ScienceClothing
diff --git a/Resources/Prototypes/Recipes/Lathes/Packs/security.yml b/Resources/Prototypes/Recipes/Lathes/Packs/security.yml
index 4beee0f9d1..f3e8891b25 100644
--- a/Resources/Prototypes/Recipes/Lathes/Packs/security.yml
+++ b/Resources/Prototypes/Recipes/Lathes/Packs/security.yml
@@ -75,6 +75,7 @@
- PowerCageMedium
- PowerCageSmall
- TelescopicShield
+ - ClothingBackpackHarmpack
- type: latheRecipePack
id: SecurityBoards
diff --git a/Resources/Prototypes/Recipes/Lathes/security.yml b/Resources/Prototypes/Recipes/Lathes/security.yml
index 606e628669..71f815e5aa 100644
--- a/Resources/Prototypes/Recipes/Lathes/security.yml
+++ b/Resources/Prototypes/Recipes/Lathes/security.yml
@@ -84,6 +84,18 @@
Plasma: 500
Glass: 500
+- type: latheRecipe
+ id: ClothingBackpackHarmpack
+ result: ClothingBackpackHarmpack
+ categories:
+ - Clothing
+ completetime: 15
+ materials:
+ Steel: 2000
+ Plastic: 1000
+ Plasma: 500
+ Gold: 500
+
# Shields
- type: latheRecipe
parent: BaseShieldRecipe
diff --git a/Resources/Prototypes/Research/arsenal.yml b/Resources/Prototypes/Research/arsenal.yml
index 7ba7cea9da..bb12a2c25f 100644
--- a/Resources/Prototypes/Research/arsenal.yml
+++ b/Resources/Prototypes/Research/arsenal.yml
@@ -191,6 +191,18 @@
technologyPrerequisites:
- SalvageWeapons
+- type: technology
+ id: DualWieldingTechnology
+ name: research-technology-dual-wielding-technology
+ icon:
+ sprite: Clothing/Back/Specific/harmpack.rsi
+ state: icon
+ discipline: Arsenal
+ tier: 2
+ cost: 10000
+ recipeUnlocks:
+ - ClothingBackpackHarmpack
+
# Tier 3
- type: technology
diff --git a/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/equipped-BACKPACK.png b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/equipped-BACKPACK.png
new file mode 100644
index 0000000000..f1f9e5aff7
Binary files /dev/null and b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/equipped-BACKPACK.png differ
diff --git a/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/icon.png b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/icon.png
new file mode 100644
index 0000000000..ddf8af9119
Binary files /dev/null and b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/icon.png differ
diff --git a/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-left.png b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-left.png
new file mode 100644
index 0000000000..6b3dfd73ed
Binary files /dev/null and b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-left.png differ
diff --git a/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-right.png b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-right.png
new file mode 100644
index 0000000000..224065dc68
Binary files /dev/null and b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-right.png differ
diff --git a/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/meta.json b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/meta.json
new file mode 100644
index 0000000000..37ee2d1693
--- /dev/null
+++ b/Resources/Textures/Clothing/Back/Specific/harmpack.rsi/meta.json
@@ -0,0 +1,26 @@
+{
+ "version": 1,
+ "license": "CC0-1.0",
+ "copyright": "Created by EmoGarbage404 (github) for Space Station 14",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "icon"
+ },
+ {
+ "name": "equipped-BACKPACK",
+ "directions": 4
+ },
+ {
+ "name": "inhand-left",
+ "directions": 4
+ },
+ {
+ "name": "inhand-right",
+ "directions": 4
+ }
+ ]
+}