]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
New science unlock: the H.A.R.M.P.A.C.K (#38824)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Mon, 7 Jul 2025 21:43:33 +0000 (23:43 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Jul 2025 21:43:33 +0000 (23:43 +0200)
13 files changed:
Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs [new file with mode: 0644]
Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs [new file with mode: 0644]
Resources/Locale/en-US/research/technologies.ftl
Resources/Prototypes/Entities/Clothing/Back/specific.yml
Resources/Prototypes/Recipes/Lathes/Packs/science.yml
Resources/Prototypes/Recipes/Lathes/Packs/security.yml
Resources/Prototypes/Recipes/Lathes/security.yml
Resources/Prototypes/Research/arsenal.yml
Resources/Textures/Clothing/Back/Specific/harmpack.rsi/equipped-BACKPACK.png [new file with mode: 0644]
Resources/Textures/Clothing/Back/Specific/harmpack.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-left.png [new file with mode: 0644]
Resources/Textures/Clothing/Back/Specific/harmpack.rsi/inhand-right.png [new file with mode: 0644]
Resources/Textures/Clothing/Back/Specific/harmpack.rsi/meta.json [new file with mode: 0644]

diff --git a/Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs b/Content.Shared/Hands/Components/ExtraHandsEquipmentComponent.cs
new file mode 100644 (file)
index 0000000..fb3685c
--- /dev/null
@@ -0,0 +1,18 @@
+using Robust.Shared.GameStates;
+using Content.Shared.Hands.EntitySystems;
+
+namespace Content.Shared.Hands.Components;
+
+/// <summary>
+/// An entity with this component will give you extra hands when you equip it in your inventory.
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+[Access(typeof(ExtraHandsEquipmentSystem))]
+public sealed partial class ExtraHandsEquipmentComponent : Component
+{
+    /// <summary>
+    /// Dictionary relating a unique hand ID corresponding to a container slot on the attached entity to a struct containing information about the Hand itself.
+    /// </summary>
+    [DataField]
+    public Dictionary<string, Hand> Hands = new();
+}
diff --git a/Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs b/Content.Shared/Hands/EntitySystems/ExtraHandsEquipmentSystem.cs
new file mode 100644 (file)
index 0000000..4b96f89
--- /dev/null
@@ -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<ExtraHandsEquipmentComponent, GotEquippedEvent>(OnEquipped);
+        SubscribeLocalEvent<ExtraHandsEquipmentComponent, GotUnequippedEvent>(OnUnequipped);
+    }
+
+    private void OnEquipped(Entity<ExtraHandsEquipmentComponent> ent, ref GotEquippedEvent args)
+    {
+        if (!TryComp<HandsComponent>(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<ExtraHandsEquipmentComponent> ent, ref GotUnequippedEvent args)
+    {
+        if (!TryComp<HandsComponent>(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);
+        }
+    }
+}
index 876579eea55718a7a8211e4286e08d6bac39c83d..62432b8dd6b82754d534f68831edf15b20bc7a90 100644 (file)
@@ -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
index ff06b93bbf26daf5f6f7f5e3674307d7bf8dd7d0..d303aa166c5dbd89536efc876277ea4ed0e51296 100644 (file)
   - 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
index 6308570e6f956d299dfb522928c380069de8514a..164a85dc4456d79832f7ae726b4f4bfdfe0c3193 100644 (file)
@@ -30,6 +30,7 @@
   - SignallerAdvanced
   - DeviceQuantumSpinInverter
   - DeviceDesynchronizer
+  - ClothingBackpackHarmpack
 
 - type: latheRecipePack
   id: ScienceClothing
index 4beee0f9d18b0fe594171333cf28155dbe4dfb9f..f3e8891b25856641da98ee9fa9f5e8cbe26ca599 100644 (file)
@@ -75,6 +75,7 @@
   - PowerCageMedium
   - PowerCageSmall
   - TelescopicShield
+  - ClothingBackpackHarmpack
 
 - type: latheRecipePack
   id: SecurityBoards
index 606e628669583d259eba551d968ca3363fc5c134..71f815e5aa6e5210d2e5b2b49fd6be4206412b14 100644 (file)
     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
index 7ba7cea9da5ddf8045a2728a5bbd0f736b688ade..bb12a2c25f18af793ebd41ef1dc4de410e72583e 100644 (file)
   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 (file)
index 0000000..f1f9e5a
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 (file)
index 0000000..ddf8af9
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 (file)
index 0000000..6b3dfd7
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 (file)
index 0000000..224065d
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 (file)
index 0000000..37ee2d1
--- /dev/null
@@ -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
+        }
+    ]
+}