- type: entity
  parent: CMBaseWeaponRifle
  name: M20a Pulse Rifle
  id: AUWeaponRifleM20A
  description: More commonly known as the Harrington Rifle, a past designation of the USCMC and the phased out predecessor of the M41A Pulse Rifle. More commonly seen in the hands of territorial guard or in colony armories for emergencies.
  suffix: Filled
  components:
  - type: Sprite
    sprite: _AU14/Weapons/Guns/UACG/m20a38x32.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
      shader: unshaded
  - type: Item
    sprite: _AU14/Weapons/Guns/UACG/m20a.rsi
    size: Large
  - type: Clothing
    sprite: _AU14/Weapons/Guns/UACG/m20a.rsi
  - type: Gun
    shotsPerBurst: 3
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    - Burst
    soundGunshot:
      collection: AU14M41FireSound
  - type: RMCSelectiveFire
    baseFireModes:
    - SemiAuto
    - Burst
    recoilUnwielded: 4
    scatterWielded: 6
    scatterUnwielded: 20
    baseFireRate: 3.5
    burstScatterMult: 1
    modifiers:
      Burst:
        fireDelay: 0.1665
        maxScatterModifier: 10
        useBurstScatterMult: true
        unwieldedScatterMultiplier: 2
        shotsToMaxScatter: 6
  - type: MagazineAmmoProvider
    autoEject: false
    soundAutoEject: null
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: AU14MagazineRifleM20A
        insertSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_reload.ogg
        ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m41_unload.ogg
        priority: 2
        whitelist:
          tags:
          - AU14MagazineRifleM20A
  - type: GunDamageModifier
    multiplier: 1.4
  - type: RMCWeaponAccuracy
    accuracyMultiplier: 1.3
    accuracyMultiplierUnwielded: 0.65
  - type: AttachableHolder
    slots:
      rmc-aslot-rail:
        whitelist:
          tags:
          - RMCAttachmentRailFlashlight
          - RMCAttachmentMagneticHarness
      rmc-aslot-underbarrel:
        locked: true
        startingAttachable: AU14AttachmentM20AUnderbarrelShotgun
        whitelist:
          tags:
          - AU14AttachmentM20AUnderbarrelShotgun
  - type: AttachableHolderVisuals
    offsets:
      rmc-aslot-barrel: 0.75, 0.03
      rmc-aslot-rail: -0.21, 0.13
      rmc-aslot-stock: -0.78, 0.0325
      rmc-aslot-underbarrel: 0.28, -0.343

- type: entity
  parent: CMMagazineRifleBase
  id: AU14MagazineRifleM20A
  name: "M20a Magazine (10x24mm)"
  components:
  - type: Tag
    tags:
    - CMMagazineRifle
    - AU14MagazineRifleM20A
  - type: BallisticAmmoProvider
    mayTransfer: True
    whitelist:
      tags:
      - AU14CartridgeRifleM20A
      - CMCartridgeRifle10x24mm
    proto: AU14CartridgeRifleM20A
    capacity: 40
  - type: Sprite
    sprite: _AU14/Weapons/Guns/Ammo/Magazines/m20amag.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-1
      map: ["enum.GunVisualLayers.Mag"]
  - type: Appearance

- type: entity
  parent: CMBaseCartridgeRifle
  id: AU14CartridgeRifleM20A
  name: Cartridge (10x24mm)
  description: A 10x24mm rifle cartridge
  components:
  - type: Tag
    tags:
    - Cartridge
    - AU14CartridgeRifleM20A
  - type: CartridgeAmmo
    proto: BulletRifleAR10

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

- type: Tag
  id: AU14MagazineRifleM20A

- type: Tag
  id: AU14CartridgeRifleM20A

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: AU14AttachmentM20AUnderbarrelShotgun
  name: M20A underbarrel shotgun
  components:
  - type: Sprite
    state: masterkeygone
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - AU14AttachmentM20AUnderbarrelShotgun
  - type: Item
    size: Normal
  - type: Gun
    soundGunshot:
      path: /Audio/_RMC14/Weapons/Guns/Gunshots/gun_shotgun_u7.ogg
      params:
        volume: -2
  - type: RMCSelectiveFire
    baseFireRate: 0.476
  - type: GunDamageModifier
    multiplier: 0.85
  - type: RMCExtraProjectilesDamageMods
    damageMultiplier: 0.36
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: RMCAmmoEject
    containerID: ballistic-ammo
    ejectSound: /Audio/_RMC14/Weapons/Guns/Reload/m42a2.ogg
  - type: BallisticAmmoProvider
    cycleable: false
    whitelist:
      tags:
      - RMCShellShotgunBuckshot
    capacity: 5
    proto: CMShellShotgunBuckshot
    soundInsert:
      path: /Audio/_RMC14/Weapons/Guns/Reload/m42a2.ogg
  - type: GunDamageMultipliers
    multipliers:
      Turf: 5
      Breaching: 10.8
  - type: UseDelay
  - type: RMCWeaponAccuracy
  - type: GunPointBlank
  - type: AttachableToggleable
    userOnly: true
    attachedOnly: true
    supercedeHolder: true
    wieldedUseOnly: true
    activatePopupText: attachable-popup-switch-to-generic
    deactivatePopupText: attachable-popup-switch-from-generic
    activateSound:
      path: /Audio/_RMC14/Attachable/gun_u7_activate.ogg
      params:
        volume: -2
    actionName: Switch to the U7 underbarrel shotgun
    actionDesc: Switch to using the underbarrel shotgun.
    icon:
      sprite: _AU14/Weapons/Guns/Attachments/under.rsi
      state: masterkeyicon
    iconActive:
      sprite: _AU14/Weapons/Guns/Attachments/under.rsi
      state: masterkey-on
  - type: AttachableVisuals
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/shotgun_mouse.rsi
      state: all

- type: Tag
  id: AU14AttachmentM20AUnderbarrelShotgun
