# base
- type: entity
  parent: [ ClothingOuterBaseMedium, RMCAllowSuitStorageClothingArmor]
  id: RMCBaseArmorNoAccessory
  abstract: true
  components:
  - type: Sprite
    state: icon # default state used by most inheritors
  - type: Item
    size: Huge
  - type: RMCDefibrillatorBlocked
    popup: cm-defib-take-off-armor
    showOnExamine: false
  - type: InteractedBlacklist
    blacklist:
      components:
      - Xeno
  - type: EmitSoundOnPickup
    sound:
      collection: RMCEquipArmor
      params:
        volume: -4
  - type: EmitSoundOnDrop
    sound:
      collection: RMCEquipArmor
      params:
        volume: -4
  - type: EmitSoundOnLand
    sound:
      collection: RMCEquipArmor
      params:
        volume: -4
  - type: Clothing
    equipSound:
      path: /Audio/_RMC14/Machines/armor_equip.ogg
  - type: MoveOrderArmor
  - type: StoreAfterFailedInteract

- type: entity
  parent: [ RMCBaseArmorNoAccessory, RMCBaseUniformAccessoryItemOuterClothing ]
  id: RMCBaseArmor
  abstract: true

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingArmor
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - RMCLighter
      - Bible
      - Gun
      - CassettePlayer
      - RMCStructuralBreacher # RuMC edit
      tags:
      - GasTank
      - Flashlight
      - DiscreteHealthAnalyzer
      - CigPack
      - Knife
      - RMCG8Pouch
      - RMCMacheteScabbard
      - RMCScabbardKatana
      #TODO Various holsters should fit here - 47 belt, 1984, m44, and flaregun
      - RMCM82FHolster
      - RMCSmartPistolHolster
      - RMCSMGHolster
      - RMCSMGPouchHolster
      - RMCGeneralPistolHolster
      - RMCGeneralRevolverHolster
      - RMCBeltHolsterM13
      - RMCXM51Holster
      - RMCDetector
      - RMCMatebaHolster
      - RMCFoldingBarricade

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingArmorVest
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - Gun
      - Stunbaton
      - BallisticAmmoProvider #Note should get all maganizes
      tags:
      - Handcuffs
      - GasTank
      - Flashlight
      - RMCMacheteScabbard
      - Binoculars
      - RMCGeneralPistolHolster
      - RMCGeneralRevolverHolster
      - RMCFoldingBarricade

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingArmorPMC
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - RMCLighter
      - Bible
      - Gun
      - BallisticAmmoProvider #Note should get all maganizes
      - Stunbaton
      - CrewMonitoringConsole
      - CassettePlayer
      tags:
      - Handcuffs
      - GasTank
      - Flashlight
      - DiscreteHealthAnalyzer
      - CigPack
      - Knife
      - RMCG8Pouch
      - Crowbar
      - RMCMacheteScabbard
      - RMCScabbardKatana
      - RMCDetector
      - RMCFoldingBarricade

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingSmartgunner
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - SmartGun
      - CassettePlayer
      tags:
      - GasTank
      - Flashlight
      - Knife
      - RMCG8Pouch
      #TODO mines
      - RMCDetector
      - RMCFoldingBarricade
      #Note should get all magazines and ignore guns
      - CMMagazineSmg
      - CMMagazinePistol
      - CMMagazineRifle
      - RMCMagazineShotgun
      - CMMagazineSniper

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingArmorMP
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - RMCLighter
      - Bible
      - BallisticAmmoProvider #Note should get all maganizes
      - Stunbaton
      - Gun
      - CassettePlayer
      tags:
      - Handcuffs
      - GasTank
      - CigPack
      - Knife
      - RMCG8Pouch
      - Binoculars
      - Grenade
      #TODO Hailer - looks like a flash and shouts a message to halt
      #TODO Various holsters go here - instead of specific ones though MP get ALL of them - any type of gun holster
      - RMCSmartPistolHolster
      - RMCSMGHolster
      - RMCSMGPouchHolster
      - RMCGeneralPistolHolster
      - RMCGeneralRevolverHolster
      - RMCBeltHolsterM13
      - RMCMatebaHolster
      - RMCCeremonialSword
      - RMCDetector
      - RMCFoldingBarricade

- type: entity
  abstract: true
  id: RMCAllowSuitStorageClothingArmorRoyal
  components:
  - type: AllowSuitStorage
    whitelist:
      components:
      - RMCLighter
      - Bible
      - BallisticAmmoProvider #Note should get all maganizes
      - Stunbaton
      - Gun
      - CassettePlayer
      tags:
      - Handcuffs
      - GasTank
      - CigPack
      - Knife
      - Grenade
      - Flashlight
      - Machete
      - RMCDetector
      - RMCFoldingBarricade

# TODO: Add separate whitelists for 'safari jacket' and 'bureau deputy jacket'

- type: entity
  parent: RMCBaseArmorNoAccessory
  id: RMCBaseMarineArmorNoAccessory
  abstract: true
  components:
  - type: Clothing
    equipDelay: 2
    unequipDelay: 2
  - type: Storage
    maxItemSize: Small
    grid:
    - 0,0,5,1 # 3 slots
  - type: ContainerContainer
    containers:
      storagebase: !type:Container
        ents: [ ]
  - type: FixedItemSizeStorage
  - type: UserInterface
    interfaces:
      enum.StorageUiKey.Key:
        type: StorageBoundUserInterface
      enum.UniformAccessoriesUi.Key:
        type: UniformAccessoryBui
  - type: IgnoreContentsSize
    items:
      tags:
      - CMMagazineRifle
      - RMCMagazineShotgun
      - CMMagazineSmg
      - CMMagazineSniper
      - CMMagazinePistol
      - RMCMagazineRevolver
      - MRE
      - PillPacket
      - PillCanister
      - CMSurgicalCase
      - RMCSyringeCase
      - RMCBoxZipties
  - type: RMCArmorSpeedTier
    speedTier: medium
  - type: RMCNameItemOnVend
    item: Armor
  - type: CMHardArmor
  - type: RMCBulkyArmor
  - type: RMCMagneticArmor
  - type: SquadArmor
    layer: Armor
    slot: OUTERCLOTHING
    rsi:
      sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: std-armor
    leaderRsi:
      sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: sql-armor
  - type: RMCStorageEjectHand
  # Removed because it breaks prototypes that inherit from it, such as the PMC body armor.
  # - type: ClothingRequireEquipped
  #   autoUnequip: true
  #   denyReason: rmc-armor-not-marine-jumpsuit
  #   whitelist:
  #     tags:
  #     - RMCUniformMarine

- type: entity
  parent: RMCBaseArmorNoAccessory
  id: RMCBaseArmorPVE
  abstract: true
  components:
  - type: Item
    heldPrefix: off
  - type: Sprite
    layers:
    - state: icon
    - map: [ "enum.WebbingVisualLayers.Base" ]
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: lamp-off
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: lamp-on
      visible: false
      map: [ "light" ]
  - type: Clothing
    equipDelay: 2
    unequipDelay: 2
    equippedPrefix: off
    clothingVisuals:
      outerClothing:
      - state: equipped-OUTERCLOTHING
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: lamp-off
  - type: RMCArmorSpeedTier
    speedTier: medium
  - type: RMCNameItemOnVend
    item: Armor
  - type: CMHardArmor
  - type: RMCBulkyArmor
  - type: RMCMagneticArmor
  - type: Appearance
  - type: ItemTogglePointLight
  - type: ToggleableVisuals
    spriteLayer: light
    clothingVisuals:
      outerClothing:
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: lamp-on
  - type: RMCSuitLight
  - type: PointLight
    enabled: false
    radius: 5
    offset: 0,-0.85
    rotation: 90
    softness: 5
    autoRot: true
    netsync: false
    color: "#FFFFFF"
    mask: /Textures/_RMC14/Effects/LightMasks/wide_ellipsis.png
  - type: PointLightRotation
    rotation: 90
  - type: HandheldLight
    addPrefix: true
    blinkingBehaviourId: blinking
    radiatingBehaviourId: radiating
    turnOffSound:
      path: /Audio/_RMC14/Handling/suitlight_crank.ogg
    turnOnSound:
      path: /Audio/_RMC14/Machines/suitlight_on.ogg
  - 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: 600
    startingCharge: 600
  - type: BatterySelfRecharger
    autoRecharge: true
    autoRechargeRate: 2
  - type: WebbingClothing
    whitelist:
      tags:
      - ArmorWebbing
  - type: Tag
    tags:
    - RMCPVEArmor


- type: entity
  parent: [ RMCBaseMarineArmorNoAccessory, RMCBaseUniformAccessoryItemOuterClothing ]
  id: RMCBaseMarineArmor
  abstract: true
  components:
  - type: UniformAccessoryHolder
    allowedCategories:
    - Patch
    - Medal
    - Armband
    - PridePin
    - Rank
    - Decor
    - Poncho
    - Mask
    - Utility
    startingAccessories: [ CMUTraumaGovernorAttachment ]

- type: entity
  parent: RMCBaseMarineArmorNoAccessory
  id: RMCBaseMarineArmorLightNoAccessory
  abstract: true
  components:
  - type: Item
    heldPrefix: off
  - type: Sprite
    layers:
    - state: icon
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: lamp-off
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: lamp-on
      visible: false
      map: [ "light" ]
  - type: Clothing
    equippedPrefix: off
    clothingVisuals:
      outerClothing:
      - state: equipped-OUTERCLOTHING
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: lamp-off
  - type: Appearance
  - type: ItemTogglePointLight
  - type: ToggleableVisuals
    spriteLayer: light
    clothingVisuals:
      outerClothing:
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: lamp-on
  - type: RMCSuitLight
  - type: PointLight
    enabled: false
    radius: 5
    offset: 0,-0.85
    rotation: 90
    softness: 5
    autoRot: true
    netsync: false
    color: "#FFFFFF"
    mask: /Textures/_RMC14/Effects/LightMasks/wide_ellipsis.png
  - type: PointLightRotation
    rotation: 90
  - type: HandheldLight
    addPrefix: true
    blinkingBehaviourId: blinking
    radiatingBehaviourId: radiating
    turnOffSound:
      path: /Audio/_RMC14/Handling/suitlight_crank.ogg
    turnOnSound:
      path: /Audio/_RMC14/Machines/suitlight_on.ogg
  - 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: 600 #lights drain 3/s but recharge of 2 makes this 1/s. Therefore 600 is 10 minutes of light.
    startingCharge: 600
  - type: BatterySelfRecharger
    autoRecharge: true
    autoRechargeRate: 2 #recharge of 2 makes total drain 1w / s so max charge is 1:1 with time. Time to fully charge should be 5 minutes. Having recharge gives light an extended flicker period which gives you some warning to return to light area.

- type: entity
  parent: [ RMCBaseMarineArmorLightNoAccessory, RMCBaseUniformAccessoryItemOuterClothing ]
  id: RMCBaseMarineArmorLight
  abstract: true
  components:
  - type: UniformAccessoryHolder
    allowedCategories:
    - Patch
    - Medal
    - Armband
    - PridePin
    - Rank
    - Decor
    - Poncho
    - Mask
    - Utility
    startingAccessories: [ CMUTraumaGovernorAttachment ]

- type: entity
  parent: RMCBaseMarineArmorLight
  id: RMCBasePMCArmorLight
  abstract: true
  components:
  - type: Sprite
    layers:
    - state: icon
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: pmc-lamp-off
    - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
      state: pmc-lamp-on
      visible: false
      map: [ "light" ]
  - type: Clothing
    equippedPrefix: off
    clothingVisuals:
      outerClothing:
      - state: equipped-OUTERCLOTHING
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: pmc-lamp-off
  - type: ToggleableVisuals
    spriteLayer: light
    clothingVisuals:
      outerClothing:
      - sprite: _RMC14/Objects/Clothing/OuterClothing/Armor/armor_overlays.rsi
        state: pmc-lamp-on
  - type: PointLight
    color: "#73e6f5"
