- type: entity
  name: SP-91-RC
  parent: [WeaponSubMachineGunDrozdMk2, BaseSecurityContraband]
  id: WeaponSubMachineGunSP91RC
  description: Compact submachine gun designed for riot control.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/sp91rc.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Wieldable
    unwieldOnUse: false
  - type: GunWieldBonus
    minAngle: -19
    maxAngle: -16
  - type: Gun
    fireRate: 13
    selectedMode: Burst
    shotsPerBurst: 5
    availableModes:
      - Burst
    soundGunshot:
      path: /Audio/_Starlight/Weapons/Guns/Gunshots/1sp_91.ogg
  - type: MagazineVisuals
    magState: mag
    steps: 5
    zeroVisible: true
  - type: Appearance
  - type: ChamberMagazineAmmoProvider
    autoEject: true

# - type: entity #Sunrise-TODO: Add Uzi to NukeOps
#   name: Type U3 Uzi
#   parent: [BaseWeaponSubMachineGun, BaseMajorContraband]
#   id: WeaponSubMachineGunUzi
#   description: Lightweight submachine gun with a 32-round magazine that has single or 4 round firing modes.
#   components:
#   - type: Sprite
#     sprite: _Starlight/Objects/Weapons/Guns/SMGs/uzi.rsi
#     layers:
#     - state: base
#       map: ["enum.GunVisualLayers.Base"]
#     - state: mag-0
#       map: ["enum.GunVisualLayers.Mag"]
#   - type: Gun
#     fireRate: 12
#     selectedMode: FullAuto
#     shotsPerBurst: 4
#     availableModes:
#     - SemiAuto
#     - Burst
#     - FullAuto
#     soundGunshot:
#       path: /Audio/_Starlight/Weapons/Guns/Gunshots/uzi.ogg
#   - type: MagazineVisuals
#     magState: mag
#     steps: 1
#     zeroVisible: true
#   - type: Appearance
#   - type: ChamberMagazineAmmoProvider
#     autoEject: true
#   - type: ItemSlots
#     slots:
#       gun_magazine:
#         name: Magazine
#         startingItem: MagazinePistolSubMachineGunUzi
#         insertSound: /Audio/Weapons/Guns/MagIn/smg_magin.ogg
#         ejectSound: /Audio/Weapons/Guns/MagOut/smg_magout.ogg
#         priority: 2
#         whitelist:
#           tags:
#             - MagazineSMGUzi
#         whitelistFailPopup: gun-magazine-whitelist-fail
#       gun_chamber:
#         name: Chamber
#         startingItem: CartridgePistolSP
#         priority: 1
#         whitelist:
#           tags:
#             - CartridgePistol

- type: entity
  name: makeshift SMG
  parent: [BaseWeaponSubMachineGun, BaseMinorContraband]
  id: WeaponSubMachineGunMakeshift
  description: Held together with cloth and dreams, it rattles ominously with every shot.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/makeshift_smg.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/makeshift_smg.rsi
  - type: Item
    size: Normal
  - type: Gun
    fireRate: 9
    minAngle: 32
    angleIncrease: 3
    maxAngle: 64
    selectedMode: FullAuto
    availableModes:
      - FullAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/smg.ogg
  - type: MagazineVisuals
    magState: mag
    steps: 1
    zeroVisible: true
  - type: Appearance
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: null
        insertSound: /Audio/Weapons/Guns/MagIn/smg_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/smg_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineSMGImprovised
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: null
        priority: 1
        whitelist:
          tags:
            - CartridgePistolImprovised
  - type: Construction
    graph: MakeshiftSMGGraph
    node: shotgun
  - type: WeaponDismantleOnShoot
    dismantleChance: 0.03 #Very low to account for automatic weapon fire, if entire mag is shot 3/10 SMGs will survive
    selfDamage:
      types:
        Blunt: 5
        Heat: 5
    items:
      - id: ModularBarrel
        launchAngle: 0
        prob: 1
      - id: ModularReceiver
        launchAngle: 90
        prob: 0.30
      - id: RifleStock
        launchAngle: 180
        prob: 0.80
      - id: MagazinePistolSubMachineGunImprovised
        launchAngle: 190
        prob: 1

- type: entity
  name: improvised SMG
  parent: WeaponSubMachineGunMakeshift
  id: WeaponSubMachineGunImprovised
  description: It's tightly held together by cloth, steel and determination.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/improvised_smg.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/makeshift_smg.rsi
  - type: Item
    size: Large
  - type: Wieldable
    unwieldOnUse: false
  - type: GunWieldBonus
    minAngle: -5
    maxAngle: -10
  - type: Gun
    fireRate: 7
    minAngle: 16
    angleIncrease: 3
    maxAngle: 32
  - type: Appearance
  - type: Construction
    graph: ImprovisedSMGGraph
    node: shotgun
  - type: WeaponDismantleOnShoot
    dismantleChance: 0.01
    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 SMG
  parent: WeaponSubMachineGunImprovised
  id: WeaponSubMachineGunForged
  description: The best a tider could get, steel and plasteel welded together for a pretty decent SMG, though the heavy bolt on it does slow the shooting down.
  components:
  - type: Sprite
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/forged_smg.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: _Starlight/Objects/Weapons/Guns/SMGs/forged_smg.rsi
  - type: Wieldable
    unwieldOnUse: false
  - type: GunWieldBonus
    minAngle: -10
    maxAngle: -15
  - type: Gun
    fireRate: 5
    minAngle: 16
    angleIncrease: 3
    maxAngle: 32
  - type: Appearance
  - type: WeaponDismantleOnShoot
    dismantleChance: 0
