# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Jackson Lewis <inquisitivepenguin@protonmail.com>
# SPDX-FileCopyrightText: 2020 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2020 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2020 V�ctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 py01 <60152240+collinlunn@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 py01 <pyronetics01@gmail.com>
# SPDX-FileCopyrightText: 2021 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Paul <ritter.paul1+git@googlemail.com>
# SPDX-FileCopyrightText: 2021 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2022 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Ranger6012 <102882503+Ranger6012@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 ScalyChimp <72841710+scaly-chimp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Scribbles0 <91828755+Scribbles0@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 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 ZeroDayDaemon <60460608+ZeroDayDaemon@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 AJCM <AJCM@tutanota.com>
# SPDX-FileCopyrightText: 2023 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2023 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TaralGit <76408146+TaralGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 and_a <and_a@DESKTOP-RJENGIR>
# SPDX-FileCopyrightText: 2023 brainfood1183 <113240905+brainfood1183@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lapatison <100279397+lapatison@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 liltenhead <104418166+liltenhead@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 vanx <61917534+Vaaankas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 BeeRobynn <166929042+BeeRobynn@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CatMagic <135462166+CatMagic1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hmeister <nathan.springfredfoxbon4@gmail.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 S1rFl0 <49481675+S1rFl0@users.noreply.github.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 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 John <35928781+sporkyz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 K-Dynamic <20566341+K-Dynamic@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 PunishedJoe <PunishedJoeseph@proton.me>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ted Lukin <66275205+pheenty@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
# SPDX-FileCopyrightText: 2025 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: BaseWeaponShotgun
  parent: BaseItem
  id: BaseWeaponShotgun
  description: A rooty tooty point and shooty.
  abstract: true
  components:
  - type: Sprite
    layers:
    - state: icon
      map: [ "enum.GunVisualLayers.Base" ]
  - type: Item
    # If you update this also update the bulldog's size.
    size: Large
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/db_shotgun.rsi
    quickEquip: false
    slots:
    - Back
    - suitStorage
  - type: AmmoCounter
  - type: Gun
    fireRate: 2
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/shotgun.ogg
    soundEmpty:
      path: /Audio/Weapons/Guns/Empty/empty.ogg
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - ShellShotgun
    capacity: 7
    proto: ShellShotgun
    soundInsert:
      path: /Audio/Weapons/Guns/MagIn/shotgun_insert.ogg
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
        ents: []
  - type: StaticPrice
    price: 500
  # Goobstation edit start
  - type: EmitSoundOnPickup
    sound:
      collection: ShotgunsPickUp
  - type: EmitSoundOnDrop
    sound:
      collection: ShotgunsDrop
  - type: EmitSoundOnLand
    sound:
      collection: ShotgunsDrop
  - type: RestrictGunshotsByUserTag
    doesntContain:
    - Oni
    messages:
    - oni-cannot-shoot-guns-1
    - oni-cannot-shoot-guns-2
    - oni-cannot-shoot-guns-3
  # Goobstation edit end
  - type: AltFireMelee # Goobstation V
    attackType: Heavy
  - type: MeleeWeapon
    damage:
      types:
       Blunt: 12
    angle: 0
    wideAnimationRotation: 90 # -90 if it takes bayonets (hits with muzzle) 90 if not (hits with butt)
    soundHit:
      collection: MetalThud # Goobstation ^

- type: entity
  name: Bulldog
  # Don't parent to BaseWeaponShotgun because it differs significantly
  parent: [BaseItem, BaseGunWieldable, BaseSyndicateContraband]
  id: WeaponShotgunBulldog
  description: An automatic magazine-fed shotgun for close-quarters combat. Kicks like a mule on steroids. Uses 12 Gauge shotgun shells. # Goob edit
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/bulldog.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    size: Large
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/bulldog.rsi
    quickEquip: false
    slots:
    - Back
    - suitStorage
  - type: AmmoCounter
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 3 # Goobstation edit
    selectedMode: FullAuto
    availableModes:
    - FullAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/shotgun.ogg
    soundEmpty:
      path: /Audio/Weapons/Guns/Empty/empty.ogg
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineShotgun
        priority: 2
        whitelist:
          tags:
          - MagazineShotgun
        whitelistFailPopup: gun-magazine-whitelist-fail
        insertSound: /Audio/Weapons/Guns/MagIn/smg_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/smg_magout.ogg
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: MagazineAmmoProvider
  - type: MagazineVisuals
    magState: mag
    steps: 1
    zeroVisible: true
  - type: Appearance
  - type: StaticPrice
    price: 5000
  - type: RestrictGunshotsByUserTag # Goobstation
    doesntContain:
    - Oni
    messages:
    - oni-cannot-shoot-guns-1
    - oni-cannot-shoot-guns-2
    - oni-cannot-shoot-guns-3

- type: entity
  name: double-barreled shotgun
  parent: [BaseWeaponShotgun, BaseGunWieldable, BaseSecurityBartenderZookeeperContraband]
  id: WeaponShotgunDoubleBarreled
  description: An immortal classic. Uses 12 Gauge shotgun shells.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/db_shotgun.rsi
  - type: Item
    size: Normal
    shape:
    - 0,0,4,0
    sprite: Objects/Weapons/Guns/Shotguns/db_shotgun_inhands_64x.rsi
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 3
  - type: GunSpreadModifier
    spread: 0.6
  - type: BallisticAmmoProvider
    capacity: 2
  - type: Construction
    graph: ShotgunSawn
    node: start
    deconstructionTarget: null

- type: entity
  name: double-barreled shotgun
  parent: WeaponShotgunDoubleBarreled
  id: WeaponShotgunDoubleBarreledRubber
  suffix: Non-Lethal
  components:
  - type: BallisticAmmoProvider
    proto: ShellShotgunBeanbag

- type: entity
  name: Enforcer
  parent: [BaseWeaponShotgun, BaseGunWieldable, BaseSecurityContraband]
  id: WeaponShotgunEnforcer
  description: A premium semi-automatic shotgun, and the pride of all security forces. Uses 12 Gauge shotgun shells. # Goob edit
  components: # intend for Enforcer to have wider choke for semi-auto function
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/enforcer.rsi
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/enforcer.rsi
  - type: Item
    sprite: Objects/Weapons/Guns/Shotguns/enforcer_inhands_64x.rsi
    shape: # Goobstation
    - 0,0,4,1
  - type: BallisticAmmoProvider
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 1.7 # Goobstation

- type: entity
  parent: WeaponShotgunEnforcer
  id: WeaponShotgunEnforcerRubber
  suffix: Non-Lethal
  components:
  - type: BallisticAmmoProvider
    proto: ShellShotgunBeanbag

- type: entity
  name: Kammerer
  parent: [BaseWeaponShotgun, BaseGunWieldable, BaseSecurityContraband]
  id: WeaponShotgunKammerer
  description: An old yet faithful design, and a favorite among irregular forces of many worlds. Uses 12 Gauge shotgun shells. # Goob edit
  components: # intend for Kammerer to have tighter choke for slower fire rate and/or manual cycling
  - type: Item
    size: Normal
    shape:
    - 0,0,4,0
    sprite: Objects/Weapons/Guns/Shotguns/pump_inhands_64x.rsi
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    # fireRate: 1 # goob
  - type: GunSpreadModifier
    spread: 0.6
  - type: Tag
    tags:
    - WeaponShotgunKammerer
  - type: BallisticAmmoProvider # Goobstation
    autoCycle: false

- type: entity
  name: sawn-off shotgun
  parent: [ BaseWeaponShotgun, BaseSecurityBartenderContraband ]
  id: WeaponShotgunSawn
  description: Groovy! Uses 12 Gauge shotgun shells. # Goob edit
  components: # needs to be super inaccurate because you don't need to wield it
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/sawn.rsi
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/sawn.rsi
  - type: Item
    size: Small
    shape: # Goobstation
    - 0,0,2,0
    sprite: Objects/Weapons/Guns/Shotguns/sawn_inhands_64x.rsi
  - type: Gun
    fireRate: 3
  - type: GunSpreadModifier
    spread: 1.4
  - type: BallisticAmmoProvider
    capacity: 2
  - type: Construction
    graph: ShotgunSawn
    node: shotgunsawn
    deconstructionTarget: null

- type: entity
  name: sawn-off shotgun
  parent: WeaponShotgunSawn
  id: WeaponShotgunSawnEmpty
  suffix: Empty
  components:
  - type: BallisticAmmoProvider
    proto: null
  - type: Construction
    graph: ShotgunSawn
    node: shotgunsawn
    deconstructionTarget: null

- type: entity
  name: handmade pistol
  parent: [BaseWeaponShotgun, BaseMinorContraband]
  id: WeaponShotgunHandmade
  description: Looks unreliable. Uses 12 Gauge shotgun shells. # Goob edit
  components:
  - type: Item
    size: Small
    storedRotation: 90
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/hm_pistol.rsi
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/hm_pistol.rsi
  - type: Gun
    fireRate: 4
  - type: BallisticAmmoProvider
    capacity: 1
  - type: Construction
    graph: ShotgunSawn
    node: shotgunsawn
    deconstructionTarget: null
  - type: StaticPrice
    price: 0

- type: entity
  name: blunderbuss
  parent: [BaseWeaponShotgun, BaseGunWieldable, BaseMinorContraband]
  id: WeaponShotgunBlunderbuss
  suffix: Pirate
  description: Deadly at close range.
  components:
  - type: Item
    size: Normal
    shape:
    - 0,0,4,0
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/blunderbuss.rsi
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 2
  - type: BallisticAmmoProvider
    capacity: 1
  - type: StaticPrice
    price: 0

- type: entity
  name: improvised shotgun
  parent: [BaseWeaponShotgun, BaseGunWieldable, BaseMinorContraband]
  id: WeaponShotgunImprovised
  description: A shitty, hand-made shotgun that uses 12 Gauge shotgun shells. It can only hold one round in the chamber. # Goob edit
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shotguns/improvised_shotgun.rsi
  - type: Clothing
    sprite: Objects/Weapons/Guns/Shotguns/improvised_shotgun.rsi
  - type: Item
    size: Normal
    shape:
    - 0,0,4,0
    sprite: Objects/Weapons/Guns/Shotguns/improvised_shotgun_inhands_64x.rsi
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 4 #No reason to stifle the firerate since you have to manually reload every time anyways.
  - type: BallisticAmmoProvider
    capacity: 1
    proto: null
  - type: Construction
    graph: ImprovisedShotgunGraph
    node: shotgun
  - type: StaticPrice
    price: 20
  - type: Tag
    tags:
    - ImprovisedShotgun # Goobstation

- type: entity
  name: improvised shotgun
  parent: WeaponShotgunImprovised
  suffix: Loaded
  id: WeaponShotgunImprovisedLoaded
  components:
  - type: BallisticAmmoProvider
    proto: ShellShotgunImprovised
