# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.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 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 Moomoobeef <62638182+Moomoobeef@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# 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 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: BaseItem
  id: BaseMagazineBoxCaselessRifle
  name: ammunition box (9.5mm HP) # Goob edit
  components:
  # Goobstation edit start
  - type: EmitSoundOnPickup
    sound:
      path: /Audio/_Goobstation/Items/handling/ammobox_pickup.ogg
  - type: EmitSoundOnDrop
    sound:
      path: /Audio/_Goobstation/Items/handling/ammobox_drop.ogg
  - type: EmitSoundOnLand
    sound:
      path: /Audio/_Goobstation/Items/handling/ammobox_drop.ogg
  # Goobstation edit end
  - type: BallisticAmmoProvider
    mayTransfer: true
    whitelist:
      tags:
        - CartridgeCaselessRifle
    proto: CartridgeCaselessRifle
    capacity: 60
  - type: Item
    size: Small
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: Sprite
    sprite: Objects/Weapons/Guns/Ammunition/Boxes/caseless_rifle.rsi
  - type: MagazineVisuals
    magState: mag
    steps: 4
    zeroVisible: false
  - type: Appearance

# Boxes
- type: entity
  parent: BaseMagazineBoxCaselessRifle
  id: MagazineBoxCaselessRifle10x24
  name: ammunition box (9.5mm HP) # Goob edit
  components:
  - type: BallisticAmmoProvider
    capacity: 200
    proto: CartridgeCaselessRifle
  - type: Sprite
    layers:
    - state: base-10x24
      map: ["enum.GunVisualLayers.Base"]
    - state: mag10-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: mag10
    steps: 4
    zeroVisible: false
  - type: Appearance

- type: entity
  parent: BaseMagazineBoxCaselessRifle
  id: MagazineBoxCaselessRifleBig
  name: ammunition box (9.5mm HP) # Goob edit
  components:
  - type: BallisticAmmoProvider
    capacity: 200
    proto: CartridgeCaselessRifle
  - type: Sprite
    layers:
    - state: base-b
      map: ["enum.GunVisualLayers.Base"]
    - state: magb-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: magb
    steps: 4
    zeroVisible: false
  - type: Appearance

- type: entity
  parent: BaseMagazineBoxCaselessRifle
  id: MagazineBoxCaselessRifle
  name: ammunition box (9.5mm HP)
  description: A cardboard box of 9.5mm caseless rounds. Intended to hold general-purpose kinetic ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgeCaselessRifle
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]

- type: entity
  parent: BaseMagazineBoxCaselessRifle
  id: MagazineBoxCaselessRiflePractice
  name: ammunition box (9.5mm practice)
  description: A cardboard box of 9.5mm caseless rounds. Intended to hold non-harmful chalk ammunition.
  components:
  - type: BallisticAmmoProvider
    proto: CartridgeCaselessRiflePractice
  - type: Sprite
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: practice
