# - type: entity
#   name: makarov
#   parent: [BaseWeaponPistol] # , BaseSovietContraband
#   id: WeaponPistolMakarov
#   description: A cheap and cumbersome pistol, with a dot on the rear sight indicating the direction in which it tends to misfire, as this model does not shoot straight. Uses .35 auto ammo.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/makarov.rsi
#   - type: Gun
#     minAngle: 1
#     maxAngle: 30
#     angleIncrease: 9
#     angleDecay: 10
#     fireRate: 3
#     availableModes:
#     - SemiAuto
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/makarov.ogg
#       params:
#         variation: 0.05
#   - type: ItemSlots
#     slots:
#       gun_magazine:
#         name: Magazine
#         startingItem: MagazinePistolSP
#         insertSound: /Audio/Weapons/Guns/MagIn/pistol_magin.ogg
#         ejectSound: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
#         priority: 2
#         whitelist:
#           tags:
#             - MagazinePistol
#             - MagazinePistolHighCapacitySP
#         whitelistFailPopup: gun-magazine-whitelist-fail
#       gun_chamber:
#         name: Chamber
#         startingItem: CartridgePistolSP
#         priority: 1
#         whitelist:
#           tags:
#             - CartridgePistol
#   - type: ContainerContainer
#     containers:
#       gun_magazine: !type:ContainerSlot
#       gun_chamber: !type:ContainerSlot
#   - type: StaticPrice
#     price: 150

- type: entity
  id: WeaponPistolMk58Nonlethal
  parent: [WeaponPistolMk58, BaseSecurityContraband]
  suffix: Non-lethal
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazinePistolRubber
        insertSound: /Audio/Weapons/Guns/MagIn/pistol_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazinePistol
      gun_chamber:
        name: Chamber
        startingItem: CartridgePistolRubber
        priority: 1
        whitelist:
          tags:
            - CartridgePistol

- type: entity
  name: N1984
  parent: [ WeaponPistolN1984, BaseSecurityContraband ]
  id: WeaponPistolN1984Nonlethal
  suffix: Non-lethal
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineMagnumRubber
        insertSound: /Audio/Weapons/Guns/MagIn/pistol_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineMagnum
      gun_chamber:
        name: Chamber
        startingItem: CartridgeMagnumRubber
        priority: 1
        whitelist:
          tags:
            - CartridgeMagnum

- type: entity
  name: golden mk 58
  parent: [ WeaponPistolMk58, BaseSecurityContraband ]
  id: WeaponPistolGoldenMk58
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/golden_mk58.rsi
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/golden_mk58.rsi

# - type: entity
#   name: enforcer
#   parent: [ BaseWeaponPistol, BaseSecurityContraband ]
#   id: WeaponPistolEnforcer
#   description: A pistol of modern design.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/enforcer.rsi
#   - type: Gun
#     fireRate: 6
#     availableModes:
#     - SemiAuto
#   - type: ChamberMagazineAmmoProvider
#     availablePrefixes:
#     - ""
#     - redgrip
#     - red
#     - tangrip
#     - green
#     - black
#     - tan
#     - grey
#     - greengrip

# - type: entity
#   name: Due Process
#   parent: [BaseWeaponPistol, BaseSecurityContraband]
#   id: WeaponPistolDP
#   description: A pistol that packs a punch for brig defense, just as NanoTransen intended.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/dp.rsi
#   - type: Clothing
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/dp.rsi
#   - type: Gun
#     fireRate: 5
#     availableModes:
#     - SemiAuto
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/dp.ogg
#   - type: ItemSlots
#     slots:
#       gun_magazine:
#         name: Magazine
#         startingItem: MagazinePistol40SP
#         insertSound: /Audio/Weapons/Guns/MagIn/pistol_magin.ogg
#         ejectSound: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
#         priority: 2
#         whitelist:
#           tags:
#             - MagazinePistolDP
#         whitelistFailPopup: gun-magazine-whitelist-fail
#       gun_chamber:
#         name: Chamber
#         startingItem: CartridgePistol40SP
#         priority: 1
#         whitelist:
#           tags:
#             - CartridgePistolDP

# - type: entity
#   name: sp-8t
#   parent: [WeaponPistolDP, BaseSecurityContraband]
#   id: WeaponPistolSP8T
#   components:
#   - type: Gun
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/sp8t.ogg
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/sp8t.rsi
#   - type: ChamberMagazineAmmoProvider
#     availablePrefixes:
#     - ""
#     - dust

# - type: entity
#   name: sp-8ar
#   parent: [WeaponPistolDP, BaseSecurityContraband]
#   id: WeaponPistolSP8AR
#   components:
#   - type: Gun
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/sp8ar.ogg
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/sp8ar.rsi
#   - type: ChamberMagazineAmmoProvider
#     availablePrefixes:
#     - ""

# - type: entity
#   name: stechkin pistol #Fix
#   parent: [WeaponPistolMk58, BaseSecurityContraband]
#   id: WeaponPistolStechkin
#   description: A small, easily concealable 10mm handgun. Has a threaded barrel for suppressors.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/stechkin.rsi
#   - type: Clothing
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/stechkin.rsi
#   - type: Gun
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/1suppres.ogg

# - type: entity
#   name: Stechkin APS
#   parent: [WeaponPistolMk58] #, BaseSovietContraband
#   id: WeaponPistolAPS
#   description: A high quality firearm issued to SNKVD elites and high ranking officials. It's half pistol, half closing argument.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/aps.rsi
#   - type: Clothing
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/aps.rsi
#   - type: Gun
#     selectedMode: Burst
#     shotsPerBurst: 3
#     availableModes:
#     - Burst
#     - SemiAuto
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/1suppres.ogg

# - type: entity
#   name: m1911
#   parent: [WeaponPistolN1984, BaseSecurityContraband]
#   id: WeaponPistolM1911
#   description: A classic .45 handgun with a small magazine capacity.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/m1911.rsi
#   - type: Clothing
#     sprite: _Starlight/Objects/Weapons/Guns/Pistols/m1911.rsi
#   - type: Gun
#     minAngle: 1
#     maxAngle: 20
#     angleIncrease: 8
#     angleDecay: 7
#     fireRate: 7
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/colt.ogg

- type: entity
  name: makeshift pistol
  parent: [BaseWeaponPistol, BaseMinorContraband]
  id: WeaponPistolMakeshiftCrafted
  description: Little more than a space eoka. Very unreliable.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/makeshift_pistol_crafted.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/makeshift_pistol_crafted.rsi
  - type: Gun
    fireRate: 5 #Each bullet is manually loaded, no reason to impose a firerate limit.
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/mk58.ogg
  - type: ChamberMagazineAmmoProvider
    soundRack:
      path: /Audio/Weapons/Guns/Cock/pistol_cock.ogg
  - type: ItemSlots
    slots:
      gun_chamber:
        name: Chamber
        startingItem: null
        priority: 1
        whitelist:
          tags:
            - CartridgePistol
            - CartridgePistolImprovised
  - type: Construction
    graph: MakeshiftPistolCraftedGraph
    node: shotgun
  - type: WeaponDismantleOnShoot
    dismantleChance: 0.20
    selfDamage:
      types:
        Blunt: 6
        Heat: 6
    items:
      - id: ModularBarrel
        launchAngle: 0
        prob: 1
      - id: ModularReceiver
        launchAngle: 90
        prob: 0.10
      - id: RifleStock
        launchAngle: 180
        prob: 0.80

- type: entity
  name: improvised pistol
  parent: [BaseWeaponSniper, BaseMinorContraband]
  id: WeaponPistolImprovised
  description: A cobbled together pistol with an internal magazine. More reliable, but still liable to blow up in your face.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/improvised_pistol.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/improvised_pistol.rsi
  - type: Gun
    pump: false
    fireRate: 3
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/mk58.ogg
    minAngle: 1
    maxAngle: 30
    angleIncrease: 12
    angleDecay: 4
  - type: BallisticAmmoProvider
    capacity: 5
    proto: null
    whitelist:
      tags:
      - CartridgePistol
      - CartridgePistolImprovised
  - type: Item
    size: Small #Magazine location makes it bigger but should still fit in a pocket. (This basically serves to keep people from putting it in a boot/stacking them as easily)
    shape:
    - 0,0,1,0
    - 0,1,1,1
  - type: Construction
    graph: ImprovisedPistolGraph
    node: shotgun
  - type: WeaponDismantleOnShoot
    dismantleChance: 0.10
    selfDamage:
      types:
        Blunt: 6
        Heat: 6
    items:
      - id: ModularBarrel
        launchAngle: 0
        prob: 1
      - id: ModularReceiver
        launchAngle: 90
        prob: 0.10
      - id: SheetSteel1
        launchAngle: 67
        prob: 0.20
      - id: SheetSteel1
        launchAngle: 87
        prob: 0.20
      - id: SheetSteel1
        launchAngle: 270
        prob: 0.20
      - id: RifleStock
        launchAngle: 180
        prob: 0.80

- type: entity
  name: forged pistol
  parent: [BaseWeaponPistol, BaseMinorContraband]
  id: WeaponPistolForged
  description: A reliable magazine-fed pistol made by the best tider blacksmiths.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/forged_pistol.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/Pistols/forged_pistol.rsi
  - type: MagazineVisuals
    magState: mag
    steps: 3
    zeroVisible: true
  - type: Item
    size: Small
    shape:
    - 0,0,1,0
    - 0,1,1,1
  - type: Gun
    fireRate: 4
    minAngle: 1
    maxAngle: 20
    angleIncrease: 8
    angleDecay: 9
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/mk58.ogg
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: null
        whitelist:
          tags:
            - MagazinePistolImprovised
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: null
        priority: 1
        whitelist:
          tags:
            - CartridgePistol
            - CartridgePistolImprovised
