- type: entity
  name: BaseWeaponRifle
  parent: [BaseItem, BaseGunWieldable, GunMedium]
  id: BaseWeaponRifle
  description: A rooty tooty point and shooty.
  abstract: true
  components:
  # Fire added start
  - type: BloodSplatterer
    amount: 1, 3
    probability: 0.5
  # Fire added end
  - type: Sprite
  - type: Item
    size: Huge
    shape:
    - 0,0,3,2
  - type: Clothing
    sprite: Objects/Weapons/Guns/Rifles/ak.rsi
    quickEquip: false
    slots:
    - Back
    - suitStorage
  - type: AmmoCounter
  - type: GunWieldBonus # Sunrise-start
    minAngle: -20
    maxAngle: -30
  - type: Gun
    minAngle: 23
    maxAngle: 90
    angleIncrease: 1.75
    angleDecay: 15  # Sunrise-end
    fireRate: 5
    selectedMode: FullAuto
    availableModes:
      - FullAuto
      - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/batrifle.ogg
  - type: ChamberMagazineAmmoProvider
    soundRack:
      path: /Audio/Weapons/Guns/Cock/sf_rifle_cock.ogg
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineLightRifleSP
        insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineLightRifle
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: CartridgeLightRifleSP
        priority: 1
        whitelist:
          tags:
            - CartridgeLightRifle
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: StaticPrice
    price: 500
  # Sunrise start
  - type: EmitSoundOnPickup
    sound:
      collection: RiflesPickUp
  - type: EmitSoundOnDrop
    sound:
      collection: RiflesDrop
  - type: EmitSoundOnLand
    sound:
      collection: RiflesDrop
  - type: KnockbackByUserTag
    doestContain:
      Resomi:
        knockback: 0.1
      Felinid:
        knockback: 0.1
  - type: CursorOffsetRequiresWield
  - type: EyeCursorOffset
    maxOffset: 4.5
    pvsIncrease: 0.45
  # Sunrise end

- type: entity
  name: AKMS
  parent: [BaseWeaponRifle, BaseSecurityContraband]
  id: WeaponRifleAk
  description: A somewhat battered combat rifle of a design originating from old Earth. Favored by criminals, militias, and terrorists due to its famed reliability and easy-to-manufacture design. Feeds from .30 rifle magazines.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Rifles/ak.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
      - state: mag-0
        map: ["enum.GunVisualLayers.Mag"]
  - type: Gun
    soundGunshot:
      collection: ak47 # Sunrise-Edit
  - type: ChamberMagazineAmmoProvider
    soundRack:
      path: /Audio/Weapons/Guns/Cock/ltrifle_cock.ogg
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineLightRifleSP
        insertSound: /Audio/Weapons/Guns/MagIn/ltrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/ltrifle_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineLightRifle
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: CartridgeLightRifleSP
        priority: 1
        whitelist:
          tags:
            - CartridgeLightRifle
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: MagazineVisuals
    magState: mag
    steps: 1
    zeroVisible: true
  - type: Appearance

- type: entity
  name: M-90gl
  parent: [BaseWeaponRifle, BaseSyndicateContraband]
  id: WeaponRifleM90GrenadeLauncher
  description: An older bullpup carbine model, with an attached underbarrel grenade launcher. Uses .20 rifle ammo.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Rifles/carbine.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
      - state: mag-0
        map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: Objects/Weapons/Guns/Rifles/carbine.rsi
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineRifleFMJ
        insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineRifle
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: CartridgeRifleSP
        priority: 1
        whitelist:
          tags:
            - CartridgeRifle
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: MagazineVisuals
    magState: mag
    steps: 1
    zeroVisible: true
  - type: Appearance

- type: entity
  name: Lecter
  parent: [BaseWeaponRifle, BaseSecurityContraband]
  id: WeaponRifleLecter
  description: A high end military grade assault rifle. Uses .20 rifle ammo.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Rifles/lecter.rsi
    layers:
      - state: base
        map: ["enum.GunVisualLayers.Base"]
      - state: mag-0
        map: ["enum.GunVisualLayers.Mag"]
  - type: Clothing
    sprite: Objects/Weapons/Guns/Rifles/lecter.rsi
  - type: Gun
    soundGunshot:
      collection: galil # Sunrise-Edit
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineRifleSP
        insertSound: /Audio/Weapons/Guns/MagIn/ltrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/ltrifle_magout.ogg
        priority: 2
        whitelist:
          tags:
            - MagazineRifle
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: CartridgeRifleSP
        priority: 1
        whitelist:
          tags:
            - CartridgeRifle
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: MagazineVisuals
    magState: mag
    steps: 5
    zeroVisible: true
  - type: Appearance
  - type: Construction  # Sunrise-start
    graph: LecterSecurity
    node: start   # Sunrise-end

- type: entity
  name: Estoc DMR
  parent: [BaseWeaponRifle, BaseSyndicateContraband]
  id: WeaponRifleEstoc
  description: A designated marksman rifle, favored for medium-to-long range engagements. Uses .20 rifle ammo.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Rifles/estoc.rsi
    layers:
    - state: base
      map: ["enum.GunVisualLayers.Base"]
    - state: mag-0
      map: ["enum.GunVisualLayers.Mag"]
  - type: Item
    shape:
    - 0,0,4,2
  - type: Clothing
    sprite: Objects/Weapons/Guns/Rifles/estoc.rsi
  - type: Gun
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/estocshot.ogg
    minAngle: 30
    maxAngle: 43
    shotsPerBurst: 3
    selectedMode: Burst
    availableModes:
    - Burst
    - SemiAuto
    burstFireRate: 14
  - type: GunWieldBonus
    minAngle: -28
    maxAngle: -25
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        startingItem: MagazineRifle
        insertSound: /Audio/Weapons/Guns/MagIn/ltrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/ltrifle_magout.ogg
        priority: 2
        whitelist:
          tags:
          - MagazineRifle
        whitelistFailPopup: gun-magazine-whitelist-fail
      gun_chamber:
        name: Chamber
        startingItem: CartridgeRifleSP
        priority: 1
        whitelist:
          tags:
          - CartridgeRifle
  - type: SpeedModifiedOnWield
    walkModifier: 0.75
    sprintModifier: 0.75
  - type: CursorOffsetRequiresWield
  - type: EyeCursorOffset
    maxOffset: 5 # Sunrise-Edit
    pvsIncrease: 0.5 # Sunrise-Edit
  - type: ContainerContainer
    containers:
      gun_magazine: !type:ContainerSlot
      gun_chamber: !type:ContainerSlot
  - type: MagazineVisuals
    magState: mag
    steps: 1
    zeroVisible: true
  - type: Appearance

- type: entity
  name: Foam Force Astro Ace
  parent: [BaseWeaponShotgun, BaseGunWieldable]
  id: WeaponRifleFoam
  description: A premium foam rifle of the highest quality. Its plastic feels rugged, and its mechanisms sturdy.
  components:
  - type: Sprite
    sprite: Objects/Fun/Foam/foam_rifle.rsi
  - type: Clothing
    sprite: Objects/Fun/Foam/foam_rifle.rsi
  - type: Item
    sprite: Objects/Fun/Foam/foam_rifle_inhand_64x.rsi
    shape:
    - 0,0,3,0
  - type: BallisticAmmoProvider
    whitelist:
      tags:
      - BulletFoam
    capacity: 10
    proto: BulletFoam
  - type: GunRequiresWield #remove when inaccuracy on spreads is fixed
  - type: Gun
    fireRate: 2
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Effects/thunk.ogg
    soundEmpty:
      path: /Audio/Weapons/Guns/Empty/empty.ogg
    clumsyProof: true
  - type: PacifismAllowedGun
