1
0
Taislin 6 сар өмнө
parent
commit
732c2cbefb

+ 6 - 0
Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs

@@ -57,4 +57,10 @@ public sealed partial class BallisticAmmoProviderComponent : Component
     /// </summary>
     [DataField]
     public TimeSpan FillDelay = TimeSpan.FromSeconds(0.5);
+
+    /// <summary>
+    /// Goobstation - is ammo automatically ejected after each shot
+    /// </summary>
+    [DataField]
+    public bool AutoCycle = true;
 }

+ 11 - 0
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs

@@ -249,6 +249,8 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
                 entity = component.Entities[^1];
 
                 args.Ammo.Add((entity, EnsureShootable(entity)));
+                if (!component.AutoCycle) //  Goobstation - do not remove spent ammo from the gun it doesn't autocycle
+                    break;
                 component.Entities.RemoveAt(component.Entities.Count - 1);
                 DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
                 Containers.Remove(entity, component.Container);
@@ -259,6 +261,15 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
                 DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.UnspawnedCount));
                 entity = Spawn(component.Proto, args.Coordinates);
                 args.Ammo.Add((entity, EnsureShootable(entity)));
+
+                // Goobstation - put spent ammo back in the gun if it doesn't autocycle
+                if (!component.AutoCycle)
+                {
+                    component.Entities.Add(entity);
+                    Containers.Insert(entity, component.Container);
+                    DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
+                }
+                // Goobstation - end
             }
         }
 

+ 59 - 0
Resources/Prototypes/Civ14/Entities/Objects/Guns/entities_boltaction.yml

@@ -0,0 +1,59 @@
+- type: entity
+  name: bolt-action rifle
+  parent: BaseItem
+  id: BaseWeaponBoltAction
+  description: A bolt-action rifle.
+  abstract: true
+  components:
+    - type: Sprite
+      sprite: Civ14/Weapons/Guns/mosin.rsi
+      layers:
+        - state: icon
+          map: ["enum.GunVisualLayers.Base"]
+        - state: mag-0
+          map: ["enum.GunVisualLayers.Mag"]
+    - type: STWeight
+      self: 5
+    - type: Item
+      size: Large
+      shape:
+        - 0,0,7,1
+    - type: Clothing
+      sprite: Civ14/Weapons/Guns/mosin.rsi
+      quickEquip: false
+      slots:
+        - Back
+    - type: AmmoCounter
+    - type: BallisticAmmoProvider
+      autoCycle: false
+      capacity: 5
+      proto: civ13_caliber_a762x54
+      whitelist:
+        tags:
+          - civ13_caliber_a762x54
+    - type: ContainerContainer
+      containers:
+        ballistic-ammo: !type:Container
+          ents: []
+    - type: Gun
+      selectedMode: SemiAuto
+      availableModes:
+        - SemiAuto
+      soundGunshot:
+        path: /Audio/Weapons/Guns/Fire/Mosin.ogg
+      projectileSpeed: 50
+      minAngle: 50
+      maxAngle: 80
+      angleIncrease: 5
+      angleDecay: 25
+      fireRate: 0.3
+    - type: Wieldable
+    - type: GunWieldBonus
+      minAngle: -50
+      maxAngle: -50
+
+- type: entity
+  name: Mosin-Nagant M91/30
+  parent: BaseWeaponBoltAction
+  id: GunMosinNagant
+  description: An imperial Russian bolt-action rifle.

+ 1 - 1
Resources/Prototypes/Civ14/StatusIcon/faction.yml

@@ -167,7 +167,7 @@
       - ShowEnglishFactionIcons
   icon:
     sprite: /Textures/Interface/Misc/civ_hud_countries.rsi
-    state: fr_basic
+    state: fr1_basic
 
 - type: factionIcon
   id: Ger0Faction

BIN
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/equipped-BACKPACK.png


BIN
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/inhand-left.png


BIN
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/inhand-right.png


+ 40 - 32
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/meta.json

@@ -1,35 +1,43 @@
 {
-  "version": 1,
-  "license": "AGPL-3.0",
-  "copyright": "Exported from https://github.com/civ13/civ13",
-  "size": {
-    "x": 32,
-    "y": 32
-  },
-  "states": [
-    {
-      "name": "mag-0",
-      "directions": 1
+    "version": 1,
+    "license": "AGPL-3.0",
+    "copyright": "Exported from https://github.com/civ13/civ13",
+    "size": {
+        "x": 32,
+        "y": 32
     },
-    {
-      "name": "equipped-BACKPACK",
-      "directions": 4
-    },
-    {
-      "name": "icon",
-      "directions": 1
-    },
-    {
-      "name": "inhand-left",
-      "directions": 4
-    },
-    {
-      "name": "inhand-right",
-      "directions": 4
-    },
-    {
-      "name": "bolt-open",
-      "directions": 1
-    }
-  ]
+    "states": [
+        {
+            "name": "mag-0",
+            "directions": 1
+        },
+        {
+            "name": "equipped-BACKPACK",
+            "directions": 4
+        },
+        {
+            "name": "icon",
+            "directions": 1
+        },
+        {
+            "name": "inhand-left",
+            "directions": 4
+        },
+        {
+            "name": "inhand-right",
+            "directions": 4
+        },
+        {
+            "name": "wielded-inhand-left",
+            "directions": 4
+        },
+        {
+            "name": "wielded-inhand-right",
+            "directions": 4
+        },
+        {
+            "name": "bolt-open",
+            "directions": 1
+        }
+    ]
 }

BIN
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/wielded-inhand-left.png


BIN
Resources/Textures/Civ14/Weapons/Guns/mosin.rsi/wielded-inhand-right.png


BIN
Resources/Textures/Interface/Misc/civ_hud_countries.rsi/fr1_basic.png


+ 4 - 0
Resources/Textures/Interface/Misc/civ_hud_countries.rsi/meta.json

@@ -67,6 +67,10 @@
             "name": "fr_basic",
             "directions": 1
         },
+        {
+            "name": "fr1_basic",
+            "directions": 1
+        },
         {
             "name": "ger0_basic",
             "directions": 1