]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Revert "Make flare gun explode, damage and stun the player when used … (#24679)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Mon, 29 Jan 2024 00:20:34 +0000 (11:20 +1100)
committerGitHub <noreply@github.com>
Mon, 29 Jan 2024 00:20:34 +0000 (11:20 +1100)
* Revert "Make flare gun explode, damage and stun the player when used with the wrong ammo (#22349)"

This reverts commit e301378114b245fa6927372f83c19868cb90b13c.

# Conflicts:
# Content.Shared/Weapons/Ranged/Components/GunComponent.cs
# Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
# Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml

* Fix revert conflicts

* Update Content.Shared/Weapons/Ranged/Components/GunComponent.cs

Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Content.Shared/Weapons/Ranged/Components/GunComponent.cs
Resources/Locale/en-US/weapons/ranged/gun.ftl
Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml
Resources/Prototypes/tags.yml

index 007f30a28454d185827a2eb53e9dedb0d4206cdd..756a4c906566ed9c25436778c58a0b6609027c04 100644 (file)
@@ -130,27 +130,6 @@ public sealed partial class GunSystem : SharedGunSystem
                 case CartridgeAmmoComponent cartridge:
                     if (!cartridge.Spent)
                     {
-                        if (gun.CompatibleAmmo != null &&
-                            !gun.CompatibleAmmo.Exists(ammoAllowed => ammoAllowed.Equals(cartridge.Prototype))
-                            && user != null)
-                        {
-                            if (gun.DamageOnWrongAmmo != null)
-                                Damageable.TryChangeDamage(user, gun.DamageOnWrongAmmo, origin: user);
-                            _stun.TryParalyze(user.Value, TimeSpan.FromSeconds(3f), true);
-
-                            Audio.PlayPvs(new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg"), gunUid);
-
-                            PopupSystem.PopupEntity(Loc.GetString("gun-component-wrong-ammo"), user.Value);
-                            _adminLogger.Add(LogType.EntityDelete, LogImpact.Medium, $"Shot wrong ammo by {ToPrettyString(user.Value)} deleted {ToPrettyString(gunUid)}");
-                            userImpulse = false;
-
-                            SetCartridgeSpent(ent!.Value, cartridge, true);
-                            MuzzleFlash(gunUid, cartridge, user);
-                            Del(gunUid);
-                            if (cartridge.DeleteOnSpawn)
-                                Del(ent.Value);
-                            return;
-                        }
                         if (cartridge.Count > 1)
                         {
                             var ev = new GunGetAmmoSpreadEvent(cartridge.Spread);
index c3335a1ad061da86bf6d5c71b8fe3775264e4832..8d7d548ad8fc42b6c29448413e9a0497b16ee785 100644 (file)
@@ -5,7 +5,6 @@ using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
-using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Weapons.Ranged.Components;
@@ -180,18 +179,6 @@ public sealed partial class GunComponent : Component
     [DataField]
     public bool ResetOnHandSelected = true;
 
-    /// <summary>
-    /// Type of ammo the gun can work with
-    /// </summary>
-    [DataField]
-    public List<ProtoId<TagPrototype>>? CompatibleAmmo;
-
-    /// <summary>
-    /// Damage the gun deals when used with wrong ammo
-    /// </summary>
-    [DataField]
-    public DamageSpecifier? DamageOnWrongAmmo = null;
-
     /// <summary>
     /// The base value for how fast the projectile moves.
     /// </summary>
index 3fbf5f77e767330ca8d35057b96dd5221003383a..fe60f3eed1d9d77526b8cb17868c5cd8e9d25543 100644 (file)
@@ -6,7 +6,6 @@ gun-selected-mode = Selected {$mode}
 gun-disabled = You can't use guns!
 gun-clumsy = The gun blows up in your face!
 gun-set-fire-mode = Set to {$mode}
-gun-component-wrong-ammo = Wrong ammo!
 
 # SelectiveFire
 gun-SemiAuto = semi-auto
index 3506a0b31ff2226558786cf673b96653a4afb89a..b7b98ba6991d328b6154e1c8353cf21832c3b2ff 100644 (file)
@@ -1,4 +1,4 @@
-- type: entity
+- type: entity
   id: BaseShellShotgun
   name: shell (.50)
   parent: BaseCartridge
   name: uranium shotgun shell
   parent: BaseShellShotgun
   components:
-  - type: Sprite
-    layers:
-      - state: depleted-uranium
-        map: [ "enum.AmmoVisualLayers.Base" ]
-  - type: CartridgeAmmo
-    count: 5
-    spread: 6
-    proto: PelletShotgunUranium
-  - type: SpentAmmoVisuals
-    state: "depleted-uranium"
-
+    - type: Sprite
+      layers:
+        - state: depleted-uranium
+          map: [ "enum.AmmoVisualLayers.Base" ]
+    - type: CartridgeAmmo
+      count: 5
+      spread: 6
+      proto: PelletShotgunUranium
+    - type: SpentAmmoVisuals
+      state: "depleted-uranium"
index 774114f90b2fd3b03e26e3beb06dd3af1c54a5b7..36b1b2a99f100b6293c167da2819b587b21c1099 100644 (file)
@@ -1,4 +1,4 @@
-- type: entity
+- type: entity
   id: PelletShotgunSlug
   name: pellet (.50 slug)
   noSpawn: true
           !type:PhysShapeAabb
           bounds: "-0.1,-0.1,0.1,0.1"
         mask:
-        - BulletImpassable
-  - type: Tag
-    tags:
-    - PelletShotgunFlare
+          - BulletImpassable
   - type: Sprite
     sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi
     state: buckshot-flare
index 810a36105bd0639b7795cef057b430e33a194092..cfcc0a01cd1f26d486af1c3a1e6287a723e3b296 100644 (file)
     selectedMode: SemiAuto
     availableModes:
       - SemiAuto
-    compatibleAmmo:
-      - PelletShotgunFlare
     soundGunshot:
       path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg
-    damageOnWrongAmmo:
-      types:
-        Blunt: 6.0
   - type: BallisticAmmoProvider
     whitelist:
       tags:
index cf36243d9dd10e3f0a193df9f6d4fa3328c44bf4..1d85d96a1a6a338f5883a76bf72a98c3062f71df 100644 (file)
 - type: Tag
   id: ShellShotgun
 
-- type: Tag
-  id: PelletShotgunFlare
-
 - type: Tag
   id: Shiv