- type: entity
  parent: BaseItem
  id: BoxFolderNuclearCodes
  name: nuclear code folder
  components:
  - type: Sprite
    sprite: Objects/Misc/folders.rsi
    layers:
    - state: folder-colormap
      color: "#cc2323"
    - state: folder-base
    - state: folder-stamp-inverse
      color: "#1dff00"
  - type: PhysicalComposition
    materialComposition:
      Paper: 50
  - type: SpawnItemsOnUse
    items:
    - id: NukeCodePaper
    sound:
      path: /Audio/Effects/packetrip.ogg
  - type: Appearance

- type: entity
  parent: BoxBase
  id: BoxFolderBaseEmpty
  name: folder
  description: A folder filled with top secret paperwork.
  components:
  - type: Sprite
    sprite: Objects/Misc/folders.rsi
    layers:
    - state: folder-colormap
    - state: folder-base
# RandomSpriteColor requires netsync which is currently incompatible with ItemMapper
#  - type: RandomSpriteColor
#    sprite: Objects/Misc/folders.rsi
#    state: folder-colormap
#    colors:
#      red: "#cc2323"
#      blue: "#355d99"
#      yellow: "#b38e3c"
#      white: "#e6e6e6"
#      grey: "#999999"
#      black: "#3f3f3f"
#      green: "#43bc38"
  - type: Item
    sprite: Objects/Misc/folders.rsi
    size: Small
    shape: null
  - type: Storage
    maxItemSize: Small
    grid:
    - 0,0,4,3
    whitelist:
      tags:
      - Document
  - type: ItemMapper
    mapLayers:
      folder-overlay-paper:
        whitelist:
          tags:
          - Document
  - type: PhysicalComposition
    materialComposition:
      Paper: 50
  - type: StaticPrice
    price: 15 # Weirdly this is more expensive than cardboard boxes. But if I have this any lower then I get an arbitrage testfail because the raw materials are worth ~$14.
  - type: Appearance
  - type: Tag
    tags:
    - Folder

- type: entity
  abstract: true
  id: BoxFolderFill # Include this as a parent prototype to add 0-5 random papers to a folder's inventory when spawned.
  suffix: Filled
  components:
  - type: EntityTableContainerFill
    containers:
      storagebase: !type:AllSelector
        children:
        - id: Paper
          prob: 0.5
        - id: PaperOffice
          prob: 0.4
        - id: Paper
          prob: 0.3
        - id: PaperOffice
          prob: 0.2
        - id: Paper
          prob: 0.2

- type: entity
  abstract: true
  id: BoxFolderFillThreePapers # Like BoxFolderFill, but always has exactly three sheets of standard paper; use for things that should always be consistent, e.g roundstart items
  suffix: 3 papers
  components:
  - type: EntityTableContainerFill
    containers:
      storagebase:
        id: Paper
        amount: 3

- type: entity
  parent: [BoxFolderBaseEmpty, BoxFolderFill]
  id: BoxFolderBase

- type: entity
  parent: [BoxFolderBaseEmpty, BoxFolderFillThreePapers]
  id: BoxFolderBaseThreePapers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderRedEmpty
  suffix: Red
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#cc2323"
    - state: folder-base

- type: entity
  parent: [BoxFolderRedEmpty, BoxFolderFill]
  id: BoxFolderRed
  suffix: Red, Filled

- type: entity
  parent: [BoxFolderRedEmpty, BoxFolderFillThreePapers]
  id: BoxFolderRedThreePapers
  suffix: Red, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderBlueEmpty
  suffix: Blue
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#355d99"
    - state: folder-base

- type: entity
  parent: [BoxFolderBlueEmpty, BoxFolderFill]
  id: BoxFolderBlue
  suffix: Blue, Filled

- type: entity
  parent: [BoxFolderBlueEmpty, BoxFolderFillThreePapers]
  id: BoxFolderBlueThreePapers
  suffix: Blue, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderYellowEmpty
  suffix: Yellow
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#b38e3c"
    - state: folder-base

- type: entity
  parent: [BoxFolderYellowEmpty, BoxFolderFill]
  id: BoxFolderYellow
  suffix: Yellow, Filled

- type: entity
  parent: [BoxFolderYellowEmpty, BoxFolderFillThreePapers]
  id: BoxFolderYellowThreePapers
  suffix: Yellow, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderGreyEmpty
  suffix: Grey
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#999999"
    - state: folder-base

- type: entity
  parent: [BoxFolderGreyEmpty, BoxFolderFill]
  id: BoxFolderGrey
  suffix: Grey, Filled

- type: entity
  parent: [BoxFolderGreyEmpty, BoxFolderFillThreePapers]
  id: BoxFolderGreyThreePapers
  suffix: Grey, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderBlackEmpty
  suffix: Black
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#3f3f3f"
    - state: folder-base

- type: entity
  parent: [BoxFolderBlackEmpty, BoxFolderFill]
  id: BoxFolderBlack
  suffix: Black, Filled

- type: entity
  parent: [BoxFolderBlackEmpty, BoxFolderFillThreePapers]
  id: BoxFolderBlackThreePapers
  suffix: Black, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderGreenEmpty
  suffix: Green
  components:
  - type: Sprite
    layers:
    - state: folder-colormap
      color: "#43bc38"
    - state: folder-base

- type: entity
  parent: [BoxFolderGreenEmpty, BoxFolderFill]
  id: BoxFolderGreen
  suffix: Green, Filled

- type: entity
  parent: [BoxFolderGreenEmpty, BoxFolderFillThreePapers]
  id: BoxFolderGreenThreePapers
  suffix: Green, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderWhiteEmpty
  suffix: White
  components:
  - type: Sprite
    layers:
    - state: folder-white
    - state: folder-base

- type: entity
  parent: [BoxFolderWhiteEmpty, BoxFolderFill]
  id: BoxFolderWhite
  suffix: White, Filled

- type: entity
  parent: [BoxFolderWhiteEmpty, BoxFolderFillThreePapers]
  id: BoxFolderWhiteThreePapers
  suffix: White, 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderCentComEmpty
  categories: [ DoNotMap ]
  name: CentComm folder
  description: CentComm's miserable little pile of secrets!
  components:
  - type: Sprite
    layers:
    - state: folder-centcom
    - state: folder-base

- type: entity
  parent: [BoxFolderCentComEmpty, BoxFolderFill]
  id: BoxFolderCentCom
  suffix: DO NOT MAP; Filled

- type: entity
  parent: [BoxFolderCentComEmpty, BoxFolderFillThreePapers]
  id: BoxFolderCentComThreePapers
  suffix: DO NOT MAP; 3 papers

- type: entity
  parent: BoxFolderBaseEmpty
  id: BoxFolderClipboardEmpty
  name: clipboard
  description: The weapon of choice for those on the front lines of bureaucracy.
  components:
  - type: Sprite
    sprite: Objects/Misc/clipboard.rsi
    layers:
    - state: clipboard
    - state: clipboard_paper
      map: ["clipboard_paper"]
      visible: false
    - state: clipboard_pen
      map: ["clipboard_pen"]
      visible: false
    - state: clipboard_over
  - type: ContainerContainer
    containers:
      storagebase: !type:Container
        ents: []
      pen_slot: !type:ContainerSlot {}
  - type: ItemSlots
    slots:
      pen_slot:
        name: clipboard-slot-component-slot-name-pen
        whitelist:
          tags:
          - Write
        insertOnInteract: false
  - type: Item
    sprite: Objects/Misc/clipboard.rsi
    size: Small
  - type: Clothing
    slots: [belt]
    quickEquip: false
    sprite: Objects/Misc/clipboard.rsi
  - type: PhysicalComposition
    materialComposition: # half of autolathe printing cost
      Wood: 50
      Steel: 25
  - type: Storage
    grid:
    - 0,0,5,3
  - type: ItemMapper
    mapLayers:
      clipboard_paper:
        whitelist:
          tags:
          - Document
      clipboard_pen:
        whitelist:
          tags:
          - Write
  - type: MeleeWeapon
    wideAnimationRotation: 180
    damage:
      types:
        Blunt: 6

- type: entity
  parent: [BoxFolderClipboardEmpty, BoxFolderFill]
  id: BoxFolderClipboard

- type: entity
  parent: [BoxFolderClipboardEmpty, BoxFolderFillThreePapers]
  id: BoxFolderClipboardThreePapers

- type: entity
  parent: BoxFolderClipboardEmpty
  id: BoxFolderPlasticClipboardEmpty
  name: plastic clipboard
  description: A cheap clipboard made of blue plastic. For those who aren't yet ready to wield the bureaucratic might of a proper wooden clipboard.
  components:
  - type: Sprite
    sprite: Objects/Misc/plastic_clipboard.rsi
    layers:
    - state: clipboard
    - state: clipboard_paper
      map: ["clipboard_paper"]
      visible: false
    - state: clipboard_pen
      map: ["clipboard_pen"]
      visible: false
    - state: clipboard_over
  - type: Item
    sprite: Objects/Misc/plastic_clipboard.rsi
  - type: Clothing
    sprite: Objects/Misc/plastic_clipboard.rsi
  - type: PhysicalComposition
    materialComposition: # half of autolathe printing cost
      Plastic: 50
      Steel: 25

- type: entity
  parent: [BoxFolderPlasticClipboardEmpty, BoxFolderFill]
  id: BoxFolderPlasticClipboard

- type: entity
  parent: [BoxFolderPlasticClipboardEmpty, BoxFolderFillThreePapers]
  id: BoxFolderPlasticClipboardThreePapers

- type: entity
  parent: BoxFolderClipboardEmpty
  id: BoxFolderCentComClipboardEmpty
  name: CentComm clipboard
  description: A luxurious clipboard upholstered with green velvet. Often seen carried by CentComm officials, seldom seen actually used.
  components:
  - type: Sprite
    sprite: Objects/Misc/cc-clipboard.rsi
    layers:
    - state: clipboard
    - state: clipboard_paper
      map: ["clipboard_paper"]
      visible: false
    - state: clipboard_pen
      map: ["clipboard_pen"]
      visible: false
    - state: clipboard_over
  - type: Item
    sprite: Objects/Misc/cc-clipboard.rsi
  - type: Clothing
    sprite: Objects/Misc/cc-clipboard.rsi
  - type: PhysicalComposition
    materialComposition: # same composition as regular clipboard + bit of cloth because it's "upholstered with green velvet"
      Wood: 50
      Steel: 25
      Cloth: 25

- type: entity
  parent: [BoxFolderCentComClipboardEmpty, BoxFolderFill]
  id: BoxFolderCentComClipboard

- type: entity
  parent: [BoxFolderCentComClipboardEmpty, BoxFolderFillThreePapers]
  id: BoxFolderCentComClipboardThreePapers

- type: entity
  parent: [BoxFolderClipboardEmpty, BaseGrandTheftContraband]
  id: BoxFolderQmClipboard
  name: requisition digi-board
  description: A bulky electric clipboard, filled with shipping orders and financing details. With so many compromising documents, you ought to keep this safe.
  components:
  - type: Sprite
    sprite: Objects/Misc/qm_clipboard.rsi
    layers:
    - state: qm_clipboard
    - state: qm_clipboard_paper
      map: ["qm_clipboard_paper"]
      visible: false
    - state: qm_clipboard_pen
      map: ["qm_clipboard_pen"]
      visible: false
    - state: qm_clipboard_over
  - type: ItemSlots
    slots:
      pen_slot:
        name: clipboard-slot-component-slot-name-pen
        whitelist:
          tags:
          - Write
        insertOnInteract: true
  - type: Item
    sprite: Objects/Misc/qm_clipboard.rsi
    size: Normal
  - type: Clothing
    sprite: Objects/Misc/qm_clipboard.rsi
  - type: Storage
    grid:
    - 0,0,4,3
    quickInsert: true
  - type: ItemMapper
    mapLayers:
      qm_clipboard_paper:
        whitelist:
          tags:
          - Document
      qm_clipboard_pen:
        whitelist:
          tags:
          - Write
  - type: CargoOrderConsole
    removeLimitAccess: [ "Quartermaster" ]
  - type: ActivatableUI
    verbText: qm-clipboard-computer-verb-text
    key: enum.CargoConsoleUiKey.Orders
  - type: UserInterface
    interfaces:
      enum.CargoConsoleUiKey.Orders:
        type: CargoOrderConsoleBoundUserInterface
      enum.StorageUiKey.Key:
        type: StorageBoundUserInterface
  - type: MeleeWeapon
    damage:
      types:
        Blunt: 10
  - type: Tag
    tags:
    - Folder
    - HighRiskItem
  - type: StealTarget
    stealGroup: BoxFolderQmClipboard
