From e1901aa6b602516f0f7cc3f29844c77e90c77977 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:20:34 +1100 Subject: [PATCH] =?utf8?q?Revert=20"Make=20flare=20gun=20explode,=20damage?= =?utf8?q?=20and=20stun=20the=20player=20when=20used=20=E2=80=A6=20(#24679?= =?utf8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 --- .../Weapons/Ranged/Systems/GunSystem.cs | 21 ----------------- .../Weapons/Ranged/Components/GunComponent.cs | 13 ----------- Resources/Locale/en-US/weapons/ranged/gun.ftl | 1 - .../Guns/Ammunition/Cartridges/shotgun.yml | 23 +++++++++---------- .../Guns/Ammunition/Projectiles/shotgun.yml | 7 ++---- .../Objects/Weapons/Guns/flare_gun.yml | 5 ---- Resources/Prototypes/tags.yml | 3 --- 7 files changed, 13 insertions(+), 60 deletions(-) diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs index 007f30a284..756a4c9065 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs @@ -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); diff --git a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs index c3335a1ad0..8d7d548ad8 100644 --- a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs @@ -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; - /// - /// Type of ammo the gun can work with - /// - [DataField] - public List>? CompatibleAmmo; - - /// - /// Damage the gun deals when used with wrong ammo - /// - [DataField] - public DamageSpecifier? DamageOnWrongAmmo = null; - /// /// The base value for how fast the projectile moves. /// diff --git a/Resources/Locale/en-US/weapons/ranged/gun.ftl b/Resources/Locale/en-US/weapons/ranged/gun.ftl index 3fbf5f77e7..fe60f3eed1 100644 --- a/Resources/Locale/en-US/weapons/ranged/gun.ftl +++ b/Resources/Locale/en-US/weapons/ranged/gun.ftl @@ -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 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml index 3506a0b31f..b7b98ba699 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: BaseShellShotgun name: shell (.50) parent: BaseCartridge @@ -155,14 +155,13 @@ 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" diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index 774114f90b..36b1b2a99f 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: PelletShotgunSlug name: pellet (.50 slug) noSpawn: true @@ -132,10 +132,7 @@ !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 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml index 810a36105b..cfcc0a01cd 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml @@ -17,13 +17,8 @@ selectedMode: SemiAuto availableModes: - SemiAuto - compatibleAmmo: - - PelletShotgunFlare soundGunshot: path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg - damageOnWrongAmmo: - types: - Blunt: 6.0 - type: BallisticAmmoProvider whitelist: tags: diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index cf36243d9d..1d85d96a1a 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1022,9 +1022,6 @@ - type: Tag id: ShellShotgun -- type: Tag - id: PelletShotgunFlare - - type: Tag id: Shiv -- 2.52.0