- type: entity
  parent: [ CMBaseWeaponRifle, RMCBaseWeaponMagazineVisuals ]
  name: M41A MK2 pulse rifle
  id: RMCWeaponRifleM54C
  description: The standard issue rifle of the UA. Commonly carried by most combat personnel. Uses 10x24mm caseless ammunition.
  components:
  - type: Sprite
    sprite: _AU14/Weapons/Guns/USCM/m41mk2.rsi
    layers:
    - state: base
      map: [ "enum.GunVisualLayers.Base" ]
    - state: mag-0
      map: [ "enum.GunVisualLayers.Mag" ]
  - type: Clothing
    sprite: _AU14/Weapons/Guns/USCM/m41mk2.rsi
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: RMCLoreExaminable
    content: rmc-lore-examinable-m54c-mk2
  - type: Gun
    selectedMode: FullAuto
    availableModes:
    - SemiAuto
    - Burst
    - FullAuto
    soundGunshot:
      collection: AU14M41FireSound
  - type: RMCSelectiveFire
    baseFireModes:
    - SemiAuto
    - Burst
    - FullAuto
    recoilUnwielded: 4
    scatterWielded: 6
    scatterUnwielded: 20
    baseFireRate: 4
    burstScatterMult: 1
  - type: RMCWeaponAccuracy
    accuracyMultiplier: 1.3
    accuracyMultiplierUnwielded: 0.65
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - CMMagazineRifleM54C
          - CMMagazineRifleM54CAP
          - CMMagazineRifleM54CExt
          - RMCMagazineRifleM54CIncendiary
          - RMCMagazineRifleM54CHEAP
          - RMCMagazineRifleM54CWP
  - type: GunDamageModifier
    multiplier: 1.1
  - type: AttachableHolder
    slots:
      rmc-aslot-barrel:
        whitelist:
          tags:
          - RMCAttachmentBarrelCharger
          - RMCAttachmentExtendedBarrel
          - RMCAttachmentExtendedCompensator
          - RMCAttachmentSuppressor
          - RMCM5Bayonet
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
          - RMCAttachmentS5RedDotSight
          - RMCAttachmentS6ReflexSight
          - RMCAttachmentS84xTelescopicScope
          - RMCAttachmentS42xTelescopicMiniscope
      rmc-aslot-stock:
        startingAttachable: RMCAttachmentM54CStockCollapsible
        whitelist:
          tags:
          - RMCAttachmentM54CStockSolid
          - RMCAttachmentM54CStockCollapsible
      rmc-aslot-underbarrel:
        startingAttachable: RMCAttachmentU1GrenadeLauncher
        whitelist:
          tags:
          - RMCAttachmentAngledGrip
          - RMCAttachmentBipod
          - RMCAttachmentFlashlightGrip
          - RMCAttachmentGyroscopicStabilizer
          - RMCAttachmentLaserSight
          - RMCAttachmentU1GrenadeLauncher
          - RMCAttachmentU7UnderbarrelShotgun
          - RMCAttachmentVerticalGrip
          - RMCAttachmentExtinguisher
          - RMCAttachmentFlamer
  - type: AttachableHolderVisuals
    offsets:
      rmc-aslot-barrel: 0.75, 0.03
      rmc-aslot-rail: -0.07, 0.18
      rmc-aslot-stock: -0.78, -0.03
      rmc-aslot-underbarrel: 0.349, -0.37
  - type: ItemCamouflage
    camouflageVariations: { }
  - type: Tag
    tags:
    - RMCWeaponRifleM54CMK2

- type: entity
  parent: RMCWeaponRifleM54C
  id: RMCWeaponRifleM54CStripped
  suffix: Stripped, Filled
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: CMMagazineRifleM54C
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - CMMagazineRifleM54C
          - CMMagazineRifleM54CAP
          - CMMagazineRifleM54CExt
          - RMCMagazineRifleM54CIncendiary
          - RMCMagazineRifleM54CHEAP
  - type: AttachableHolder
    slots:
      rmc-aslot-barrel:
        whitelist:
          tags:
          - RMCAttachmentBarrelCharger
          - RMCAttachmentExtendedBarrel
          - RMCAttachmentSuppressor
          - RMCM5Bayonet
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
          - RMCAttachmentS5RedDotSight
          - RMCAttachmentS6ReflexSight
          - RMCAttachmentS84xTelescopicScope
          - RMCAttachmentS42xTelescopicMiniscope
      rmc-aslot-stock:
        whitelist:
          tags:
          - RMCAttachmentM54CStockSolid
          - RMCAttachmentM54CStockCollapsible
      rmc-aslot-underbarrel:
        whitelist:
          tags:
          - RMCAttachmentAngledGrip
          - RMCAttachmentBipod
          - RMCAttachmentFlashlightGrip
          - RMCAttachmentGyroscopicStabilizer
          - RMCAttachmentLaserSight
          - RMCAttachmentU1GrenadeLauncher
          - RMCAttachmentU7UnderbarrelShotgun
          - RMCAttachmentVerticalGrip
          - RMCAttachmentExtinguisher
          - RMCAttachmentFlamer

- type: entity
  parent: RMCWeaponRifleM54C
  id: RMCWeaponRifleM54CSemiStripped
  suffix: No UGL, Filled
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: CMMagazineRifleM54C
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - CMMagazineRifleM54C
          - CMMagazineRifleM54CAP
          - CMMagazineRifleM54CExt
          - RMCMagazineRifleM54CIncendiary
          - RMCMagazineRifleM54CHEAP
  - type: AttachableHolder
    slots:
      rmc-aslot-barrel:
        whitelist:
          tags:
          - RMCAttachmentBarrelCharger
          - RMCAttachmentExtendedBarrel
          - RMCAttachmentSuppressor
          - RMCM5Bayonet
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
          - RMCAttachmentS5RedDotSight
          - RMCAttachmentS6ReflexSight
          - RMCAttachmentS84xTelescopicScope
          - RMCAttachmentS42xTelescopicMiniscope
      rmc-aslot-stock:
        startingAttachable: RMCAttachmentM54CStockCollapsible
        whitelist:
          tags:
          - RMCAttachmentM54CStockSolid
          - RMCAttachmentM54CStockCollapsible
      rmc-aslot-underbarrel:
        whitelist:
          tags:
          - RMCAttachmentAngledGrip
          - RMCAttachmentBipod
          - RMCAttachmentFlashlightGrip
          - RMCAttachmentGyroscopicStabilizer
          - RMCAttachmentLaserSight
          - RMCAttachmentU1GrenadeLauncher
          - RMCAttachmentU7UnderbarrelShotgun
          - RMCAttachmentVerticalGrip
          - RMCAttachmentExtinguisher
          - RMCAttachmentFlamer

- type: entity
  parent: RMCWeaponRifleM54C
  id: RMCWeaponRifleM54CFilled
  suffix: Filled
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: CMMagazineRifleM54C
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - CMMagazineRifleM54C
          - CMMagazineRifleM54CAP
          - CMMagazineRifleM54CExt
          - RMCMagazineRifleM54CIncendiary
          - RMCMagazineRifleM54CHEAP

- type: entity
  parent: RMCWeaponRifleM54CSemiStripped
  id: RMCWeaponRifleM54CWhiteNoLock
  description: A M41A Mk2 with a Weyland-Yutani logo imprinted on the reciever. Used primarily by Weyland-Yutani's corporate security forces, and comes equipped with a drab corproate white paint job.
  suffix: Corporate, No UGL, No ID lock
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Rifles/m54c/snow.rsi
    layers:
    - state: base
      map: [ "enum.GunVisualLayers.Base" ]
    - state: mag-0
      map: [ "enum.GunVisualLayers.Mag" ]
  - type: Clothing
    sprite: _RMC14/Objects/Weapons/Guns/Rifles/m54c/snow.rsi
  - type: ItemCamouflage
    camouflageVariations: { }
  - type: AttachableHolder
    slots:
      rmc-aslot-barrel:
        whitelist:
          tags:
          - RMCAttachmentBarrelCharger
          - RMCAttachmentExtendedBarrel
          - RMCAttachmentSuppressor
          - RMCM5Bayonet
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
          - RMCAttachmentS5RedDotSight
          - RMCAttachmentS6ReflexSight
          - RMCAttachmentS84xTelescopicScope
          - RMCAttachmentS42xTelescopicMiniscope
      rmc-aslot-stock:
        startingAttachable: RMCAttachmentM54CStockCollapsibleWhite
        whitelist:
          tags:
          - RMCAttachmentM54CStockSolid
          - RMCAttachmentM54CStockCollapsible
      rmc-aslot-underbarrel:
        whitelist:
          tags:
          - RMCAttachmentAngledGrip
          - RMCAttachmentBipod
          - RMCAttachmentFlashlightGrip
          - RMCAttachmentGyroscopicStabilizer
          - RMCAttachmentLaserSight
          - RMCAttachmentU1GrenadeLauncher
          - RMCAttachmentU7UnderbarrelShotgun
          - RMCAttachmentVerticalGrip
          - RMCAttachmentExtinguisher
          - RMCAttachmentFlamer

- type: entity
  parent: RMCWeaponRifleM54CWhite
  id: RMCWeaponRifleM54CWhiteCommando
  description: A Weston-Yamada creation, this M54C MK2 comes equipped in corporate white. Uses 10x24mm caseless ammunition.
  suffix: Commando
  components:
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: CMMagazineRifleM54CAP
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - CMMagazineRifleM54C
          - CMMagazineRifleM54CAP
          - CMMagazineRifleM54CExt
          - RMCMagazineRifleM54CIncendiary
          - RMCMagazineRifleM54CHEAP
  - type: AttachableHolder
    slots:
      rmc-aslot-barrel:
        whitelist:
          tags:
          - RMCAttachmentBarrelCharger
          - RMCAttachmentExtendedBarrel
          - RMCAttachmentExtendedCompensator
          - RMCAttachmentSuppressor
          - RMCM5Bayonet
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
          - RMCAttachmentS5RedDotSight
          - RMCAttachmentS6ReflexSight
          - RMCAttachmentS84xTelescopicScope
          - RMCAttachmentS42xTelescopicMiniscope
      rmc-aslot-stock:
        startingAttachable: RMCAttachmentM54CStockCollapsibleWhite
        whitelist:
          tags:
          - RMCAttachmentM54CStockSolid
          - RMCAttachmentM54CStockCollapsible
      rmc-aslot-underbarrel:
        startingAttachable: RMCAttachmentLaserSight
        whitelist:
          tags:
          - RMCAttachmentAngledGrip
          - RMCAttachmentBipod
          - RMCAttachmentFlashlightGrip
          - RMCAttachmentGyroscopicStabilizer
          - RMCAttachmentLaserSight
          - RMCAttachmentU1GrenadeLauncher
          - RMCAttachmentU7UnderbarrelShotgun
          - RMCAttachmentVerticalGrip
          - RMCAttachmentExtinguisher
          - RMCAttachmentFlamer

- type: entity
  parent: RMCWeaponRifleM54CWhiteNoLock
  id: RMCWeaponRifleM54CWhite
  suffix: Has ID Lock
  components:
  - type: GunIDLock

- type: entity
  parent: CMMagazineRifleBase
  id: CMMagazineRifleM54C
  name: "M41A MK2 magazine (10x24mm)"
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - CMMagazineRifleM54C
  - type: BallisticAmmoProvider
    mayTransfer: True
    whitelist:
      tags:
      - CMCartridgeRifle10x24mm
    proto: CMCartridgeRifle10x24mm
    capacity: 40
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54c.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Appearance
  - type: RefillableByBulletBox
    bulletType: RMCBoxBulletsRifle

- type: entity
  parent: CMMagazineRifleM54C
  id: CMMagazineRifleM54CAP
  name: "M41A MK2 AP magazine (10x24mm)"
  suffix: AP
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - CMMagazineRifleM54CAP
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - CMCartridgeRifle10x24mmAP
    proto: CMCartridgeRifle10x24mmAP
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54c.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: ammo_band
      color: "#1F951F"
  - type: RefillableByBulletBox
    bulletType: RMCBoxBulletsRifleAP
  - type: RMCLoreExaminable
    content: rmc-lore-examinable-m54c-ap-magazine

- type: entity
  parent: CMMagazineRifleM54C
  id: RMCMagazineRifleM54CIncendiary
  name: "M41A MK2 Incendiary magazine (10x24mm)"
  suffix: Incendiary
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - RMCMagazineRifleM54CIncendiary
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - RMCCartridgeRifle10x24mmIncendiary
    proto: RMCCartridgeRifle10x24mmIncendiary
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54c.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: ammo_band
      color: "#771A10"
#  - type: RefillableByBulletBox no bullet box for it yet
#    bulletType: RMCBoxBulletsRifleAP

- type: entity
  parent: CMMagazineRifleM54C
  id: RMCMagazineRifleM54CHEAP
  name: "M41A MK2 HEAP magazine (10x24mm)"
  suffix: HEAP
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - CMMagazineRifleM54CAP
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - RMCCartridgeRifle10x24mmHEAP
    proto: RMCCartridgeRifle10x24mmHEAP
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54c.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: ammo_band
      color: "#9C9A19"
  - type: RefillableByBulletBox
    bulletType: null

- type: entity
  parent: RMCMagazineRifleM54CHEAP
  id: RMCMagazineRifleM54CHEAPEmpty
  suffix: HEAP, Empty
  components:
  - type: BallisticAmmoProvider
    proto: null

- type: entity
  parent: CMMagazineRifleM54C
  id: RMCMagazineRifleM54CWP
  name: "M41A MK2 WP magazine (10x24mm)"
  suffix: WP
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - CMMagazineRifleM54CAP
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - RMCCartridgeRifle10x24mmWP
    proto: RMCCartridgeRifle10x24mmWP
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54c.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
    - state: ammo_band
      color: "#6365E6"
#  - type: RefillableByBulletBox
#    bulletType: RMCBoxBulletsRifleAP

- type: entity
  parent: CMMagazineRifleM54C
  id: CMMagazineRifleM54CExt
  name: "M41A MK2 extended magazine (10x24mm)"
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - CMMagazineRifleM54CExt
  - type: BallisticAmmoProvider
    mayTransfer: True
    whitelist:
      tags:
      - CMCartridgeRifle10x24mm
    proto: CMCartridgeRifle10x24mm
    capacity: 60
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Ammunition/Magazines/m54ce.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: MagazineVisuals
    magState: mag
    steps: 2
    zeroVisible: false
  - type: Appearance

- type: entity
  parent: CMBaseCartridgeRifle
  id: CMCartridgeRifle10x24mm
  name: cartridge (10x24mm)
  description: A 10x24mm cartridge. Fits in 10x24mm magazines.
  components:
  - type: Tag
    tags:
    - Cartridge
    - CMCartridgeRifle10x24mm
  - type: CartridgeAmmo
    proto: BulletRifle10x24mm

- type: entity
  parent: CMCartridgeRifle10x24mm
  id: CMCartridgeRifle10x24mmAP
  name: AP cartridge (10x24mm)
  description: An armor piercing 10x24mm cartridge. Fits in 10x24mm AP magazines.
  components:
  - type: Tag
    tags:
    - Cartridge
    - CMCartridgeRifle10x24mmAP
  - type: CartridgeAmmo
    proto: BulletRifle10x24mmAP

- type: entity
  parent: CMCartridgeRifle10x24mm
  id: RMCCartridgeRifle10x24mmIncendiary
  name: AP cartridge (10x24mm)
  description: An armor piercing 10x24mm cartridge. Fits in 10x24mm AP magazines.
  components:
  - type: Tag
    tags:
    - Cartridge
    - RMCCartridgeRifle10x24mmIncendiary
  - type: CartridgeAmmo
    proto: RMCBulletRifle10x24mmIncendiary

- type: entity
  parent: CMCartridgeRifle10x24mm
  id: RMCCartridgeRifle10x24mmHEAP
  name: HEAP cartridge (10x24mm)
  description: An armor piercing 10x24mm cartridge. Fits in 10x24mm HEAP magazines.
  components:
  - type: Tag
    tags:
    - Cartridge
    - RMCCartridgeRifle10x24mmHEAP
  - type: CartridgeAmmo
    proto: RMCBulletRifle10x24mmHEAP

- type: entity
  parent: CMCartridgeRifle10x24mm
  id: RMCCartridgeRifle10x24mmWP
  name: WP cartridge (10x24mm)
  description: An armor piercing wall-penetrating 10x24mm cartridge. Fits in 10x24mm WP magazines.
  components:
  - type: Tag
    tags:
    - Cartridge
    - RMCCartridgeRifle10x24mmWP
  - type: CartridgeAmmo
    proto: RMCBulletRifle10x24mmWP

- type: entity
  parent: RMCBaseBullet
  id: BulletRifle10x24mm
  categories: [ HideSpawnMenu ]
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 40
  - type: RMCProjectileDamageFalloff
    thresholds:
    - range: 24
      falloff: 9999
      ignoreModifiers: true
    - range: 7
      falloff: 4
  - type: CMArmorPiercing
    amount: 5
  - type: RMCProjectileAccuracy
    accuracy: 105
    thresholds:
    - range: 16
      falloff: 10

- type: entity
  parent: BulletRifle10x24mm
  id: BulletRifle10x24mmAP
  categories: [ HideSpawnMenu ]
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 30
  - type: CMArmorPiercing
    amount: 40

- type: entity
  parent: BulletRifle10x24mm
  id: RMCBulletRifle10x24mmWP
  categories: [ HideSpawnMenu ]
  components:
  - type: Projectile
    deleteOnCollide: false
    damage:
      types:
        Piercing: 30
  - type: CMArmorPiercing
    amount: 40
  - type: RMCPenetratingProjectile
  - type: TimedDespawn #Otherwise your game goes all laggy from too many projectiles still flying after going beyond 0 damage
    lifetime: 0.2

- type: entity
  parent: BulletRifle10x24mm
  id: RMCBulletRifle10x24mmIncendiary
  categories: [ HideSpawnMenu ]
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 33
  - type: CMArmorPiercing
    amount: 5
  - type: IgniteOnProjectileHit

- type: entity
  parent: BulletRifle10x24mm
  id: RMCBulletRifle10x24mmHEAP
  categories: [ HideSpawnMenu ]
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 55
  - type: RMCProjectileDamageFalloff
    thresholds:
    - range: 24
      falloff: 9999
      ignoreModifiers: true
    - range: 7
      falloff: 4
  - type: CMArmorPiercing
    amount: 40

- type: Tag
  id: RMCWeaponRifleM54CMK2

- type: Tag
  id: CMMagazineRifleM54C

- type: Tag
  id: CMMagazineRifleM54CAP

- type: Tag
  id: RMCMagazineRifleM54CIncendiary

- type: Tag
  id: RMCMagazineRifleM54CHEAP

- type: Tag
  id: RMCMagazineRifleM54CWP

- type: Tag
  id: CMMagazineRifleM54CExt

- type: Tag
  id: CMCartridgeRifle10x24mm

- type: Tag
  id: CMCartridgeRifle10x24mmAP

- type: Tag
  id: RMCCartridgeRifle10x24mmIncendiary

- type: Tag
  id: RMCCartridgeRifle10x24mmHEAP

- type: Tag
  id: RMCCartridgeRifle10x24mmWP
