- type: entity
  abstract: true
  parent: RMCAttachableBase
  id: RMCUnderAttachmentBase
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentAngledGrip # angledgrip
  name: angled grip
  description: "An angled foregrip that improves weapon ergonomics resulting in faster wielding time.
    However, it also increases weapon size."
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    state: angledgrip
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentAngledGrip
  - type: AttachableSizeMods
    modifiers:
    - size: 1
  - type: AttachableWieldDelayMods
    modifiers:
    - delay: -0.4

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: RMCAttachmentBipod
  name: bipod
  description: "A simple set of telescopic poles to keep a weapon stabilized during firing.
    When properly placed, greatly increases accuracy, fire-rate and reduces recoil, but when not deployed also increases weapon size and slows fire-rate."
  components:
  - type: Sprite
    state: bipod
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentBipod
  - type: AttachableToggleable
    activateOnMove: false
    heldOnlyActivate: true
    userOnly: true
    doInterrupt: true
    attachedOnly: true
    breakOnMove: true
    breakOnFullRotate: true
    breakOnDrop: true
    slowOnBreak: true
    doAfter: 1.5
    deactivateDoAfter: 0
    doAfterNeedHand: false
    instantToggle: Brace
    useDelay: 0.5
    activatePopupText: attachable-popup-activate-deploy-on-ground
    deactivatePopupText: attachable-popup-deactivate-retract
    activateSound:
      path: /Audio/_RMC14/Attachable/bipod_toggle.ogg
      params:
        volume: -3
    deactivateSound:
      path: /Audio/_RMC14/Attachable/bipod_toggle.ogg
      params:
        volume: -3
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: bipod
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: bipod-on
    actionName: Deploy Bipod
    actionDesc: Deploy the bipod and get into a firing position.
  - type: AttachableVisuals
    showActive: true
  - type: AttachableTemporarySpeedMods
    alteration: Interrupted
  - type: AttachableSizeMods
    modifiers:
    - size: 2
  - type: AttachableWieldDelayMods
    modifiers:
    - delay: 0.4
  - type: AttachableWeaponMeleeMods
    modifiers:
    - bonusDamage:
        types:
          Blunt: -10
  - type: AttachableWeaponRangedMods
    fireModeMods:
    - conditions:
        activeOnly: true
        whitelist:
          tags:
          - RMCGunBipodFullAuto
      extraFireModes: FullAuto
      setFireMode: FullAuto
    modifiers:
    - conditions:
        inactiveOnly: true
      fireDelayFlat: 0.25
    - conditions:
        wieldedOnly: true
        inactiveOnly: true
      accuracyAddMult: -0.25
      scatterFlat: 2
      recoilFlat: 1
      fireDelayFlat: 0.06
    - conditions:
        wieldedOnly: true
        activeOnly: true
      scatterFlat: -1
      recoilFlat: -2
    - conditions:
        activeOnly: true
      accuracyAddMult: 0.25
      burstScatterAddMult: -3
      fireDelayFlat: -0.09
    - conditions:
        activeOnly: true
        whitelist:
          tags:
          - CMM96SSniperRifle
      fireDelayFlat: -0.4
    - conditions:
        activeOnly: true
        whitelist:
          tags:
          - RMCWeaponLMGM60
      fireDelayFlat: -0.060
    # RuMC edit start
    - conditions:
        activeOnly: true
        whitelist:
          tags:
          - AU14WeaponRifleKramerLSW
      fireDelayFlat: 0.0568
    # RuMC edit end

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentBurstFireAssembly # burstfire_assembly
  name: burst fire assembly
  description: A small angled piece of fine machinery that increases the burst count on some weapons.
  components:
  - type: Sprite
    state: rapidfire
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentBurstFireAssembly
  - type: AttachableWeaponRangedMods
    fireModeMods:
    - extraFireModes: Burst
    modifiers:
    - conditions:
        blacklist:
          tags:
          - RMCWeaponPistolL14
      shotsPerBurstFlat: 2
    - conditions:
        wieldedOnly: true
      accuracyAddMult: -0.15
    - conditions:
        unwieldedOnly: true
      accuracyAddMult: -0.20

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentGyroscopicStabilizer
  name: gyroscopic stabilizer
  description: A set of weights and balances to stabilize the weapon when fired with one hand. Decreases firing speed.
  components:
  - type: Sprite
    state: gyro
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentGyroscopicStabilizer
  - type: AttachableWeaponRangedMods
    modifiers:
    - fireDelayFlat: 0.25
    - conditions:
        wieldedOnly: true
      scatterFlat: -2
      burstScatterAddMult: -2
    - conditions:
        unwieldedOnly: true
      scatterFlat: -10
    - conditions:
        unwieldedOnly: true
        whitelist:
          tags:
          - RMCWeaponShotgun
      accuracyAddMult: 0.55
    - conditions:
        unwieldedOnly: true
        blacklist:
          tags:
          - RMCWeaponShotgun
      accuracyAddMult: 0.15

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentLaserSight
  name: laser sight
  description: A laser sight that attaches to the underside of most weapons. Increases accuracy and decreases scatter, especially while one-handed.
  components:
  - type: Sprite
    state: lasersight
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentLaserSight
  - type: AttachableWeaponRangedMods
    modifiers:
    - conditions:
        wieldedOnly: true
      accuracyAddMult: 0.05
      scatterFlat: -2
    - conditions:
        unwieldedOnly: true
      accuracyAddMult: 0.05
      scatterFlat: -4
  - type: RMCLoreExaminable
    content: rmc-lore-examinable-laser-sight

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentMicroLaserSight
  name: micro laser sight
  description: A compact, high-precision laser sight engineered exclusively for the M13 Auto Pistol. Offers exceptional accuracy gains by interfacing directly with the weapon's internal targeting systems.
  components:
  - type: Sprite
    state: lasersight_micro
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentMicroLaserSight
  - type: AttachableWeaponRangedMods
    modifiers:
    - conditions:
        wieldedOnly: true
      accuracyAddMult: 0.05
      scatterFlat: -1
    - conditions:
        unwieldedOnly: true
      accuracyAddMult: 0.05
      scatterFlat: -2

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: RMCAttachmentUnderbarrelFlareGun
  name: M82-F underbarrel flare gun
  description: A compact underbarrel flare gun. Fires a single flare to signal or illuminate.
  components:
  - type: Sprite
    state: flaregun
  - type: Item
    size: Normal
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentUnderbarrelFlareGun
  - type: Gun
    projectileSpeed: 25
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg
  - type: RMCAmmoEject
    containerID: ballistic-ammo
    ejectSound:
      collection: CMShotgunLoad
      params:
        variation: 0.2
  - type: RMCSelectiveFire
    scatterWielded: 0
    scatterUnwielded: 0
    baseFireRate: 10
    burstScatterMult: 0
  - type: ShootAtFixedPoint
    maxFixedRange: 15
    autoAimClosestObstacle: true
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - Flare
      - RMCFlare
      - RMCFlareL96
      - RMCFlareCAS
      - AU14FlareRMC
    capacity: 1
    proto: CMFlare
    soundInsert:
      collection: CMShotgunLoad
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
        ents: [ ]
  - type: RMCWeaponAccuracy
    accuracyMultiplier: 1
    accuracyMultiplierUnwielded: 0.5
  - type: GunPointBlank
  - type: GunIFF
    enabled: true
  - type: GunIgnorePrediction
  - 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 underbarrel flare gun
    actionDesc: Switch to using the underbarrel flare gun.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flaregun
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flaregun-on
  - type: AttachableVisuals
    offset: -0.17, 0.22
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/shotgun_mouse.rsi
      state: all

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentMiniFlamethrower
  name: underbarrel flamethrower # TODO RMC14 intensity toggle
  description: A weapon-mounted refillable flamethrower attachment. It has a secondary setting for a more intense flame with far less propulsion ability and heavy fuel usage.
  components:
  - type: Sprite
    state: flamethrower
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentFlamer
  - type: Item
    size: Normal
  - type: Gun
    cameraRecoilScalar: 0
    fireRate: 0.333
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot:
      collection: RMCFlamerShoot
  - type: SolutionContainerManager
    solutions:
      rmc_flamer_tank:
        maxVol: 40
        reagents:
        - ReagentId: RMCNapalmUT
          Quantity: 40
  - type: RMCFlamerAmmoProvider
  - type: RMCFlamerTank
    maxIntensity: 10
    maxDuration: 10
    reagentWhitelist:
    - RMCNapalmUT
    - WeldingFuel
  - 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 # TODO RMC14
      params:
        volume: -2
    actionName: Switch to the mini flamethrower.
    actionDesc: Switch to using the mini flamethrower.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flamethrower
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flamethrower-on
  - type: AttachableVisuals
    offset: -0.125, 0.245
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/flamer_mouse.rsi
      state: all
  - type: RMCFlushableSolution
    solution: rmc_flamer_tank
    flushTime: 1.5
  - type: NoMixingReagents

- type: entity
  parent: RMCUnderAttachmentBase
  id: CMAttachmentXMVESG1FlamerNozzle
  name: XM-VESG-1 flamer nozzle
  description: A special nozzle designed to alter flamethrowers to be used in a more offense orientated manner. As the inside of the nozzle is coated in a special gel and resin substance that takes the fuel that passes through and hardens it. Upon exiting the barrel, a cluster of burning gel is projected instead of a stream of burning naphtha.
  components:
  - type: Sprite
    state: flamer_nozzle
  - type: RMCLoreExaminable
    content: rmc-lore-examinable-xm-vesg-1-flamer-nozzle

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: RMCAttachmentU7UnderbarrelShotgun
  name: U7 underbarrel shotgun
  description: An AEGIS U7 tactical shotgun. Attaches to the underbarrel of most weapons. Only capable of loading up to five buckshot shells. Specialized for breaching into buildings.
  components:
  - type: Sprite
    state: masterkey
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentU7UnderbarrelShotgun
  - 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: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: masterkey
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: masterkey-on
  - type: AttachableVisuals
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/shotgun_mouse.rsi
      state: all

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentUnderbarrelExtinguisher
  name: HME-12 underbarrel extinguisher
  description: A Taiho-Technologies HME-12 underbarrel extinguisher. Attaches to the underbarrel of most weapons. Point at flame before applying pressure.
  components:
  - type: Sprite
    state: extinguisher
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentExtinguisher
  - type: Item
    size: Normal
  - type: Gun
    cameraRecoilScalar: 0
    fireRate: 0.5
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot:
      collection: RMCFlamerShoot
  - type: SolutionContainerManager
    solutions:
      spray:
        maxVol: 60
        reagents:
        - ReagentId: Water
          Quantity: 60
  - type: AttachableToggleable
    userOnly: true
    attachedOnly: true
    supercedeHolder: true
    wieldedUseOnly: false
    activatePopupText: attachable-popup-switch-to-generic
    deactivatePopupText: attachable-popup-switch-from-generic
    activateSound:
      path: /Audio/_RMC14/Attachable/gun_u7_activate.ogg # TODO RMC14
      params:
        volume: -2
    actionName: Switch to the underbarrel extinguisher.
    actionDesc: Switch to using the underbarrel extinguisher.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: extinguisher
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: extinguisher-on
  - type: AttachableVisuals
    offset: 0.061, 0.028
  - type: RMCSprayAmmoProvider
  - type: Spray
    transferAmount: 5
    sprayedPrototype: RMCExtinguisherSpray
    vaporAmount: 3
    sprayDistance: 5
    sprayVelocity: 5
    pushbackAmount: 0
    spraySound:
      path: /Audio/Effects/extinguish.ogg
  - type: RefillableSolution
    solution: spray
  - type: SolutionTransfer
    maxTransferAmount: 60
    transferAmount: 60
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/shotgun_mouse.rsi
      state: all

- type: entity
  parent: RMCAttachmentUnderbarrelExtinguisher
  id: RMCAttachmentUnderbarrelExtinguisherSpec
  name: HME-88B underbarrel extinguisher
  description: An experimental Taiho-Technologies HME-88B underbarrel extinguisher integrated with a select few gun models. It is capable of putting out the strongest of flames. Point at flame before applying pressure.
  components:
  - type: Spray
    sprayedPrototype: RMCExtinguisherSpraySpec
  - type: SolutionContainerManager
    solutions:
      spray:
        maxVol: 500
        reagents:
        - ReagentId: Water
          Quantity: 500
  - type: SolutionTransfer
    maxTransferAmount: 500
    transferAmount: 500

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: RMCAttachmentU1GrenadeLauncher
  name: U1 grenade launcher
  description: A weapon-mounted, reloadable grenade launcher.
  components:
  - type: Sprite
    layers:
    - state: grenade
      map: [ "enum.BreechVisuals.Open" ]
  - type: Item
    size: Normal
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
        ents: []
  - type: RMCAmmoEject
    containerID: ballistic-ammo
    ejectSound:
      path: /Audio/_RMC14/Weapons/Guns/Reload/grenade_insert.ogg
  - type: AmmoCounter
  - type: Gun
    projectileSpeed: 20
    soundGunshot:
      path: /Audio/_RMC14/Weapons/Guns/Gunshots/gun_ugl.ogg
    resetOnHandSelected: false
  - type: RMCSelectiveFire
    baseFireRate: 0.417
  - type: GunIgnorePrediction
  - type: GunIFF
    enabled: true
  - type: BallisticAmmoProvider
    cycleable: false
    whitelist:
      tags:
      - RMCGrenadeM40
      - RMCAirburstGrenade
    capacity: 3
    soundInsert:
      path: /Audio/_RMC14/Weapons/Guns/Reload/grenade_insert.ogg
      params:
        volume: -2
  - type: OnShootTriggerAmmoTimer
    delay: 1.5
    beepInterval: 2
    initialBeepDelay: 0
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    timerStart: enum.TimerStartMode.OnHitGround
  - type: ShootAtFixedPoint
    shootArcProj: true
    maxFixedRange: 7
  - type: UniqueAction
  - type: BreechLoaded
    needOpenClose: true
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.BreechVisuals.Open:
        enum.BreechVisuals.Open:
          True: { state: grenade-open }
          False: { state: grenade }
  - type: AttachableToggleable
    userOnly: true
    attachedOnly: true
    supercedeHolder: true
    wieldedUseOnly: true
    activatePopupText: attachable-popup-switch-to-generic
    deactivatePopupText: attachable-popup-switch-from-generic
    actionName: Switch to the U1 Grenade Launcher
    actionDesc: Switch to using the underbarrel grenade launcher.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade-on
  - type: AttachableVisuals
    offset: 0.08, 0.06
    redrawOnAppearanceChange: true
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentU1GrenadeLauncher
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/explosive_mouse.rsi
      state: all

- type: entity
  parent: RMCAttachmentU1GrenadeLauncher
  id: RMCAttachmentMK1GrenadeLauncher
  name: MK1 underslung grenade launcher
  description: An older version of the classic underslung grenade launcher. Can store five grenades, but fires them slower.
  components:
  - type: Sprite
    layers:
      - state: grenade-mk1
        map: [ "enum.BreechVisuals.Open" ]
  - type: Item
    size: Normal
  - type: BallisticAmmoProvider
    capacity: 5
  - type: ShootAtFixedPoint
    maxFixedRange: 10
  - type: RMCSelectiveFire
    baseFireRate: 0.334
  - type: GenericVisualizer
    visuals:
      enum.BreechVisuals.Open:
        enum.BreechVisuals.Open:
          True: { state: grenade-mk1-open }
          False: { state: grenade-mk1 }
  - type: AttachableToggleable
    actionName: Switch to the MK1 Underslung Grenade Launcher
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade-mk1
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade-mk1-on
  - type: AttachableVisuals
    offset: -0.01, 0.285
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentMK1GrenadeLauncher
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/explosive_mouse.rsi
      state: all

- type: entity
  parent: RMCAttachmentU1GrenadeLauncher
  id: RMCAttachmentM203GrenadeLauncher
  name: M203 grenade launcher
  description: An antique underbarrel grenade launcher. Adopted in 1969 for the M16, it was made obsolete centuries ago; how its ended up here is a mystery to you. Holds only one propriatary 40mm grenade, does not have modern IFF systems, it won't pass through your friends.
  components:
  - type: Sprite
    layers:
      - state: grenade-m203
        map: [ "enum.BreechVisuals.Open" ]
  - type: GunIFF
    enabled: false
  - type: BallisticAmmoProvider
    capacity: 1
  - type: ShootAtFixedPoint
    maxFixedRange: 10
  - type: RMCSelectiveFire
    baseFireRate: 0.334
  - type: GenericVisualizer
    visuals:
      enum.BreechVisuals.Open:
        enum.BreechVisuals.Open:
          True: { state: grenade-m203-open }
          False: { state: grenade-m203 }
  - type: AttachableToggleable
    actionName: Switch to the MK1 Underslung Grenade Launcher
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade-m203
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: grenade-m203-on
  - type: AttachableVisuals
    offset: -0.1, 0.218
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentM203GrenadeLauncher
  - type: WieldedCrosshair
    rsi:
      sprite: _RMC14/Interface/MousePointer/explosive_mouse.rsi
      state: all

- type: entity
  parent: RMCUnderAttachmentBase
  id: RMCAttachmentVerticalGrip # verticalgrip
  name: vertical grip
  description: "A vertical foregrip that offers better accuracy, less recoil, and less scatter, especially during burst fire.
    However, it also increases weapon size."
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    state: verticalgrip
  - type: AttachableVisuals
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentVerticalGrip
  - type: AttachableSizeMods
    modifiers:
    - size: 1
  - type: AttachableWeaponRangedMods
    modifiers:
    - conditions:
        wieldedOnly: true
      accuracyAddMult: 0.15
      recoilFlat: -1
      scatterFlat: -2
      burstScatterAddMult: -2
    - conditions:
        unwieldedOnly: true
      accuracyAddMult: -0.15
      scatterFlat: 2

- type: entity
  parent: [ RMCUnderAttachmentBase, RMCAttachableToggleableBase ]
  id: RMCAttachmentFlashlightGrip # flashlight/grip
  name: underbarrel flashlight grip
  description: Holy smokes RO man, they put a grip on a flashlight! Reduces recoil and scatter by a tiny amount. Works as a light source. # Boosts accuracy by a tiny amount.
  components:
  - type: ItemTogglePointLight
  - type: ToggleableVisuals
    spriteLayer: light
  - type: PointLight
    enabled: false
    radius: 5
    softness: 5
    autoRot: true
    netsync: false
  - type: HandheldLight
    addPrefix: false
    blinkingBehaviourId: blinking
    radiatingBehaviourId: radiating
  - type: NoHandsInteractionBlocked
  - type: LightBehaviour
    behaviours:
    - !type:FadeBehaviour
      id: radiating
      interpolate: Linear
      maxDuration: 2.0
      startValue: 3.0
      endValue: 2.0
      isLooped: true
      property: Radius
      enabled: false
      reverseWhenFinished: true
    - !type:PulseBehaviour
      id: blinking
      interpolate: Nearest
      maxDuration: 1.0
      minValue: 0.1
      maxValue: 2.0
      isLooped: true
      property: Radius
      enabled: false
  - type: Battery
    maxCharge: 10
    startingCharge: 10
  - type: BatterySelfRecharger
    autoRecharge: true
    autoRechargeRate: 3
  - type: Sprite
    layers:
    - state: flashgrip
    - state: flashgrip-on
      shader: unshaded
      visible: false
      map: [ "light" ]
  - type: Item
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
  - type: Appearance
  - type: AttachableToggleable
    attachedOnly: true
    useDelay: 1.0
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flashgrip
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: flashgrip-on
    actionName: Activate Underbarrel Flashlight Grip
    actionDesc: Can be toggled on and off. A better light source than standard M3 pattern armor lights.
  - type: AttachableVisuals
    showActive: true
  - type: AttachableToggleableSimpleActivate
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentFlashlightGrip
    - Flashlight
  - type: AttachableWeaponRangedMods
    modifiers:
    - conditions:
        wieldedOnly: true
      accuracyAddMult: 0.05
      recoilFlat: -1
      scatterFlat: -2

- type: entity
  parent: RMCAttachmentFlashlightGrip
  id: RMCAttachmentLaserLightModule
  name: MK80 laser-light module
  description: A Laser-Light module for the MK80 Service Pistol which is currently undergoing limited field testing as part of the marines' next generation pistol program. All MK80 pistols come equipped with the module.
  suffix: DO NOT MAP
  components:
  - type: Sprite
    layers:
    - state: laserlight
    - state: laserlight-on
      shader: unshaded
      visible: false
      map: [ "light" ]
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentLaserLightModule
    - Flashlight
  - type: AttachableToggleable
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: laserlight
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/under.rsi
      state: laserlight-on
    actionName: Activate Laser-Light Module
    actionDesc: Can be toggled on and off. A better light source than standard M3 pattern armor lights.
  - type: AttachableWeaponRangedMods
    modifiers:
    - accuracyAddMult: 0.05
    - conditions:
        wieldedOnly: true
      recoilFlat: -1
      scatterFlat: -2
    - conditions:
        unwieldedOnly: true
      scatterFlat: -4

- type: entity
  parent: RMCAttachmentBipod
  id: RMCAttachmentL91Bipod
  categories: [ HideSpawnMenu ]
  name: "L91 SWS integrated bipod"
  description: "Blimey! This should be bolted to your rifle, you twat - put it back on and get back to it, mate!"
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    state: bipod-l91
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentL91Bipod
  - type: AttachableToggleable
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: bipod-l91
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: bipod-l91-on
    actionName: Deploy Bipod
    actionDesc: Deploy the bipod and get into a firing position.
  - type: AttachableWeaponMeleeMods
    modifiers:
    - bonusDamage:
        types:
          Blunt: 0
  - type: AttachableWieldDelayMods
    modifiers:
    - delay: 0.2
  - type: AttachableWeaponRangedMods
    modifiers:
    - conditions:
        wieldedOnly: true
        activeOnly: true
      accuracyAddMult: 0.25
      burstScatterAddMult: -1.16
      scatterFlat: -4

- type: entity
  parent: RMCAttachmentU1GrenadeLauncher
  id: RMCAttachmentL90GL
  name: L90U3 grenade launcher
  description: A grenade launcher designed specifically for L90 pattern rifles. Holds three 30mm grenades.
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    layers:
    - state: grenade-l90
      map: [ "enum.BreechVisuals.Open" ]
  - type: GenericVisualizer
    visuals:
      enum.BreechVisuals.Open:
        enum.BreechVisuals.Open:
          True: { state: grenade-l90-open }
          False: { state: grenade-l90 }
  - type: AttachableToggleable
    actionName: Switch to the L90U3 Grenade Launcher
    actionDesc: Switch to using the underbarrel grenade launcher.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: grenade-l90
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: grenade-l90-on
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentL90GL

- type: entity
  parent: RMCAttachmentU7UnderbarrelShotgun
  id: RMCAttachmentL90UBS
  name: L90U1 underbarrel shotgun
  description: An underbarrel shotgun designed specifically for L90 pattern rifles, capable of loading up to five buckshot shells.
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    state: ubs-l90
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentL90UBS
  - type: AttachableToggleable
    actionName: Switch to the L90U1 underbarrel shotgun
    actionDesc: Switch to using the underbarrel shotgun.
    icon:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: ubs-l90
    iconActive:
      sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
      state: ubs-l90-on

- type: entity
  parent: RMCAttachableBase
  id: RMCAttachmentL88Grip
  name: L88 integrated foregrip
  description: Oi, you bloody galah! Put this back on your rifle and get back to it!
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Weapons/Guns/Attachments/rmc_under.rsi
    state: l88grip
  - type: AttachableVisuals
    suffix: ""
  - type: Tag
    tags:
    - RMCAttachmentUnderbarrel
    - RMCAttachmentL88Grip

- type: Tag
  id: RMCAttachmentUnderbarrel

- type: Tag
  id: RMCAttachmentAngledGrip

- type: Tag
  id: RMCAttachmentBipod

- type: Tag
  id: RMCGunBipodFullAuto

- type: Tag
  id: RMCAttachmentBurstFireAssembly

- type: Tag
  id: RMCAttachmentGyroscopicStabilizer

- type: Tag
  id: RMCAttachmentLaserSight

- type: Tag
  id: RMCAttachmentMicroLaserSight

- type: Tag
  id: RMCAttachmentU7UnderbarrelShotgun

- type: Tag
  id: RMCAttachmentU1GrenadeLauncher

- type: Tag
  id: RMCAttachmentMK1GrenadeLauncher

- type: Tag
  id: RMCAttachmentM203GrenadeLauncher

- type: Tag
  id: RMCAttachmentVerticalGrip

- type: Tag
  id: RMCAttachmentFlashlightGrip

- type: Tag
  id: RMCAttachmentLaserLightModule

- type: Tag
  id: RMCAttachmentFlamer

- type: Tag
  id: RMCAttachmentExtinguisher

- type: Tag
  id: RMCAttachmentL90GL

- type: Tag
  id: RMCAttachmentL90UBS

- type: Tag
  id: RMCAttachmentL91Bipod

- type: Tag
  id: RMCAttachmentL88Grip

- type: Tag
  id: RMCAttachmentUnderbarrelFlareGun
