# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.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: 2021 BulletGrade <66234359+BulletGrade@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Myctai <108953437+Myctai@users.noreply.github.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: 2022 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Jackal298 <129199891+Jackal298@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TaralGit <76408146+TaralGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Boaz1111 <149967078+Boaz1111@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fenn <162015305+TooSillyFennec@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@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 Ignaz "Ian" Kraft <ignaz.k@live.de>
# SPDX-FileCopyrightText: 2025 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseMagazinePistol
  name: pistol magazine (.35 auto)
  parent: [ BaseItem, BaseSecurityContraband ]
  abstract: true
  components:
  - type: Tag
    tags:
      - MagazinePistol
  - type: BallisticAmmoProvider
    mayTransfer: true
    whitelist:
      tags:
        - CartridgePistol
    capacity: 12 # Goobstation
  - type: Item
    size: Small
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: Sprite
    sprite: Objects/Weapons/Guns/Ammunition/Magazine/Pistol/pistol_mag.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: mag
    steps: 6
    zeroVisible: false
  - type: Appearance

- type: entity
  id: BaseMagazinePistolHighCapacity
  name: machine pistol magazine (.35 auto)
  parent: BaseItem
  abstract: true
  components:
  - type: Tag
    tags:
      - MagazinePistolHighCapacity
  - type: BallisticAmmoProvider
    mayTransfer: true
    whitelist:
      tags:
        - CartridgePistol
    capacity: 16
  - type: Item
    size: Small
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: Sprite
    sprite: Objects/Weapons/Guns/Ammunition/Magazine/Pistol/pistol_high_capacity_mag.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: mag
    steps: 6
    zeroVisible: false
  - type: Appearance

- type: entity
  id: BaseMagazinePistolSubMachineGun  # Yeah it's weird but it's pistol caliber
  name: SMG magazine (.35 auto)
  parent: [ BaseItem, BaseSecurityContraband ]
  abstract: true
  components:
  - type: Tag
    tags:
      - MagazinePistolSubMachineGun
  - type: BallisticAmmoProvider
    mayTransfer: true
    whitelist:
      tags:
        - CartridgePistol
    capacity: 30
  - type: Item
    size: Small
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: Sprite
    sprite: Objects/Weapons/Guns/Ammunition/Magazine/Pistol/smg_mag.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: mag
    steps: 6
    zeroVisible: false
  - type: Appearance

- type: entity
  id: MagazinePistolSubMachineGunTopMounted
  name: WT550 magazine (.35 auto top-mounted)
  parent: [ BaseItem, BaseSecurityContraband ]
  description: Unconventional 30-round top feeding magazine for the WT550 SMG. Intended to hold general-purpose kinetic ammunition.
  components:
  - type: Tag
    tags:
      - MagazinePistolSubMachineGunTopMounted
  - type: BallisticAmmoProvider
    mayTransfer: true
    proto: CartridgePistol
    whitelist:
      tags:
      - CartridgePistol
  - type: Sprite
    sprite: Objects/Weapons/Guns/Ammunition/Magazine/Pistol/smg_mag_top_mounted.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
      - state: mag-unshaded-1
        map: ["enum.GunVisualLayers.MagUnshaded"]
        shader: unshaded
  - type: MagazineVisuals
    magState: mag
    steps: 6
    zeroVisible: false
  - type: Appearance
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container

- type: entity
  id: MagazinePistolSubMachineGunTopMountedEmpty
  name: WT550 magazine (.35 auto top-mounted any)
  parent: MagazinePistolSubMachineGunTopMounted
  description: Unconventional 30-round top feeding magazine for the WT550 SMG.
  components:
  - type: BallisticAmmoProvider
    proto: null

- type: entity
  id: MagazinePistol
  name: pistol magazine (.35 auto)
  parent: BaseMagazinePistol
  description: 12-round single-stack magazine for pistols. Intended to hold general-purpose kinetic ammunition. #goobstation
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistol
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolEmpty
  name: pistol magazine (.35 auto any)
  suffix: empty
  parent: MagazinePistol
  description: 12-round single-stack magazine for pistols. #goobstation
  components:
  - type: BallisticAmmoProvider
    proto: null
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolIncendiary
  name: pistol magazine (.35 auto incendiary)
  parent: MagazinePistol
  description: 12-round single-stack magazine for pistols. Intended to hold self-igniting incendiary ammunition. #goobstation
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolIncendiary
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#ff6e52"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#ff6e52"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#ff6e52"

- type: entity
  id: MagazinePistolPractice
  name: pistol magazine (.35 auto practice)
  parent: BaseMagazinePistol
  description: 12-round single-stack magazine for pistols. Intended to hold non-harmful chalk ammunition. #goobstation
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolPractice
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#dbdbdb"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#dbdbdb"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#dbdbdb"

- type: entity
  id: MagazinePistolUranium
  name: pistol magazine (.35 auto uranium)
  parent: BaseMagazinePistol
  description: 12-round single-stack magazine for pistols. Intended to hold exotic uranium-core ammunition. #goobstation
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolUranium
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#00cd42"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#00cd42"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#00cd42"

- type: entity
  id: MagazinePistolHighCapacityEmpty
  name: machine pistol magazine (.35 auto any)
  suffix: empty
  parent: BaseMagazinePistolHighCapacity
  components:
  - type: BallisticAmmoProvider
    proto: null
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolHighCapacity
  name: machine pistol magazine (.35 auto)
  parent: BaseMagazinePistolHighCapacity
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistol
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolHighCapacityPractice
  name: machine pistol magazine (.35 auto practice)
  parent: BaseMagazinePistolHighCapacity
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistol
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#dbdbdb"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#dbdbdb"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#dbdbdb"

- type: entity
  id: MagazinePistolHighCapacityRubber
  name: machine pistol magazine (.35 auto rubber)
  parent: BaseMagazinePistolHighCapacity
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistol
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]

- type: entity
  id: MagazinePistolSubMachineGun
  name: SMG magazine (.35 auto)
  parent: BaseMagazinePistolSubMachineGun
  description: 30-round double-stack magazine for submachine guns. Intended to hold general-purpose kinetic ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistol
    whitelist:
      tags:
        - CartridgePistol
    soundInsert:
      path: /Audio/Weapons/Guns/MagIn/bullet_insert.ogg
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolSubMachineGunEmpty
  name: SMG magazine (.35 auto any)
  suffix: empty
  parent: BaseMagazinePistolSubMachineGun
  description: 30-round double-stack magazine for submachine guns.
  components:
  - type: BallisticAmmoProvider
    proto: null
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      right:
      - state: inhand-right-mag

- type: entity
  id: MagazinePistolSubMachineGunPractice
  name: SMG magazine (.35 auto practice)
  parent: BaseMagazinePistolSubMachineGun
  description: 30-round double-stack magazine for submachine guns. Intended to hold non-harmful chalk ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolPractice
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#dbdbdb"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#dbdbdb"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#dbdbdb"

- type: entity
  id: MagazinePistolSubMachineGunUranium
  name: SMG magazine (.35 auto uranium)
  parent: BaseMagazinePistolSubMachineGun
  description: 30-round double-stack magazine for submachine guns. Intended to hold exotic uranium-core ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolUranium
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#00cd42"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#00cd42"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#00cd42"

- type: entity
  parent: BaseMagazinePistolSubMachineGun
  id: MagazinePistolSubMachineGunIncendiary
  name: SMG magazine (.35 auto incendiary)
  description: 30-round double-stack magazine for submachine guns. Intended to hold self-igniting incendiary ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgePistolIncendiary
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: stripe
      color: "#ff6e52"
  - type: Item
    inhandVisuals:
      left:
      - state: inhand-left-mag
      - state: inhand-left-stripe
        color: "#ff6e52"
      right:
      - state: inhand-right-mag
      - state: inhand-right-stripe
        color: "#ff6e52"

