# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Nairod <110078045+Nairodian@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2022 T-Stalker <43253663+DogZeroX@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 T-Stalker <le0nel_1van@hotmail.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2023 MendaxxDev <153332064+MendaxxDev@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hmeister <nathan.springfredfoxbon4@gmail.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <slambamactionman@gmail.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 vanx <#vanxxxx>
# SPDX-FileCopyrightText: 2024 vanx <61917534+Vaaankas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: flare gun
  parent: BaseItem
  id: WeaponFlareGun
  description: A compact, single-shot pistol that fires shotgun shells. Comes with a safety feature that prevents the user from fitting lethal shells inside.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
  - type: Item
    size: Small
    sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
  - type: ItemSlots
    slots:
      gun_chamber:
        name: Chamber
        startingItem: ShellShotgunFlare
        priority: 1
        whitelist:
          tags: ## TODO: Add a risk of the gun blowing up if using non-light shotgun shells, and then re-enable them.
            ## - ShellShotgun
            - ShellShotgunLight
  - type: ContainerContainer
    containers:
      gun_chamber: !type:ContainerSlot
  - type: ChamberMagazineAmmoProvider
    autoCycle: false
    boltClosed: false
    canRack: false
    soundBoltClosed: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
    soundBoltOpened: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
    soundRack: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
    quickEquip: false
    slots:
    - Belt
    - suitStorage
  - type: Appearance
  - type: Gun
    fireRate: 8
    selectedMode: SemiAuto
    availableModes:
      - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg
  # Goobstation edit start
  - type: EmitSoundOnPickup
    sound:
      path: /Audio/_Goobstation/Items/handling/gun_pickup.ogg
      params:
        volume: -8
  - type: EmitSoundOnDrop
    sound:
      path: /Audio/_Goobstation/Items/handling/gun_drop.ogg
      params:
        volume: -8
  - type: EmitSoundOnLand
    sound:
      path: /Audio/_Goobstation/Items/handling/gun_drop.ogg
      params:
        volume: -8
  - type: RestrictGunshotsByUserTag
    doesntContain:
    - Oni
    messages:
    - oni-cannot-shoot-guns-1
    - oni-cannot-shoot-guns-2
    - oni-cannot-shoot-guns-3
  # Goobstation edit end

- type: entity
  name: security shell gun
  parent: [WeaponFlareGun, BaseSecurityContraband]
  id: WeaponFlareGunSecurity
  description: A modified flare gun originally designed to be used by security to launch non-lethal shotgun shells, however it can also fire lethal shells without risk.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/flaregun_security.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
  - type: Item
    size: Small
    sprite: Objects/Weapons/Guns/Shotguns/flaregun_security.rsi
  - type: ItemSlots
    slots:
      gun_chamber:
        name: Chamber
        priority: 1
        whitelist:
          tags:
            - ShellShotgun
  - type: Tag
    tags:
    - Sidearm
