# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Ygg01 <y.laughing.man.y@gmail.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 Easypoller <117361103+Easypoller@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Fishfish458 <47410468+Fishfish458@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jessica M <jessica@jessicamaybe.com>
# SPDX-FileCopyrightText: 2022 Kara D <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Profane McBane <profanedbane+github@gmail.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Willhelm53 <97707302+Willhelm53@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 fishfish458 <fishfish458>
# SPDX-FileCopyrightText: 2022 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Alex <129697969+Lomcastar@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Arimah <arimah42@gmail.com>
# SPDX-FileCopyrightText: 2023 CrigCrag <137215465+CrigCrag@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 EnDecc <33369477+Endecc@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2023 Lei Yunxing <lyx2020@sjtu.edu.cn>
# SPDX-FileCopyrightText: 2023 Panzer <146987057+Panzer-IV1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Sir Winters <7543955+Owai-Seek@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TNE <38938720+JustTNE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Topy <topy72.mine@gmail.com>
# SPDX-FileCopyrightText: 2023 Velcroboy <107660393+ChilbroBaggins@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lapatison <100279397+lapatison@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aexxie <codyfox.077@gmail.com>
# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CaasGit <87243814+CaasGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Debug <49997488+DebugOk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hrosts <35345601+Hrosts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ian <ignaz.k@live.de>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Joel Zimmerman <JoelZimmerman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 KISS <59531932+YuriyKiss@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ko4ergaPunk <62609550+Ko4ergaPunk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kukutis96513 <146854220+Kukutis96513@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Lye <128915833+Lyroth001@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Magnus Larsen <i.am.larsenml@gmail.com>
# SPDX-FileCopyrightText: 2024 MerrytheManokit <167581110+MerrytheManokit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MureixloI <132683811+MureixloI@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 NakataRin <45946146+NakataRin@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 OrangeMoronage9622 <whyteterry0092@gmail.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Preston Smith <92108534+thetolbean@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <psychpsyo@gmail.com>
# SPDX-FileCopyrightText: 2024 Repo <47093363+Titian3@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Stalen <33173619+stalengd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TakoDragon <69509841+BackeTako@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TsjipTsjip <19798667+TsjipTsjip@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ubaser <134914314+UbaserB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Unkn0wn_Gh0st <shadowstalkermll@gmail.com>
# SPDX-FileCopyrightText: 2024 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2024 Vero <73014819+vero5123@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Vigers Ray <60344369+VigersRay@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Yurii Kis <yurii.kis@smartteksas.com>
# SPDX-FileCopyrightText: 2024 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 brainfood1183 <113240905+brainfood1183@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 dffdff2423 <dffdff2423@gmail.com>
# SPDX-FileCopyrightText: 2024 doom <ghostrecon5123@gmail.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 foboscheshir <156405958+foboscheshir@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 osjarw <62134478+osjarw@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 shamp <140359015+shampunj@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 strO0pwafel <153459934+strO0pwafel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stroopwafel <j.o.luijkx@student.tudelft.nl>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 to4no_fix <156101927+chavonadelal@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 voidnull000 <18663194+voidnull000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 zzylex <146784470+zzylex@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Mop Bucket
- type: entity
  name: mop bucket
  id: MopBucket
  parent: [BaseStructureDynamic, StructureWheeled]
  description: Holds water and the tears of the janitor.
  components:
  - type: Clickable
  - type: Sprite
    sprite: Objects/Specific/Janitorial/janitorial.rsi
    noRot: true
    layers:
    - state: mopbucket
    - state: mopbucket_water-1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
    drawdepth: Objects
  - type: InteractionOutline
  - type: SolutionContainerManager
    solutions:
      bucket:
        maxVol: 600
  - type: Spillable
    solution: bucket
    spillDelay: 3.0
    spillWhenThrown: false
  - type: DrainableSolution
    solution: bucket
  - type: RefillableSolution
    solution: bucket
  - type: ExaminableSolution
    solution: bucket
  - type: Tag
    tags:
      - Wringer
  - type: ItemMapper
    mapLayers:
      mopbucket_shark_blue:
        whitelist:
          tags:
            - PlushieSharkBlue
      mopbucket_shark_pink:
        whitelist:
          tags:
            - PlushieSharkPink
      mopbucket_shark_grey:
        whitelist:
          tags:
            - PlushieSharkGrey
      mopbucket_carpplush:
        whitelist:
          tags:
            - PlushieCarp
      mopbucket_magicarpplush:
        whitelist:
          tags:
          - PlushieCarpMagi
      mopbucket_holocarpplush:
        whitelist:
          tags:
          - PlushieCarpHolo
    sprite: Objects/Specific/Janitorial/janitorial.rsi
  - type: Transform
    noRot: true
  - type: ItemSlots
    slots:
      item_slot:
        name: mop-bucket-slot-component-slot-name-item
        ejectVerbText: mop-bucket-slot-component-eject-verb
        whitelist:
          tags:
            - PlushieSharkBlue
            - PlushieSharkPink
            - PlushieSharkGrey
            - PlushieCarp
            - PlushieCarpHolo
            - PlushieCarpMagi
          components:
            - Rehydratable
        priority: 3 # Higher than drinking priority
  - type: ReactiveContainer
    solution: bucket
    container: item_slot
  - type: Drink
    solution: bucket
  - type: Appearance
  - type: SolutionContainerVisuals
    maxFillLevels: 3
    fillBaseName: mopbucket_water-
  - type: ContainerContainer
    containers:
      storagebase: !type:Container
        ents: []
      item_slot: !type:ContainerSlot {}
  - type: GuideHelp
    guides:
    - Janitorial
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 70
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: DnaSubstanceTrace
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 60
        mask:
        - MachineMask

- type: entity
  name: mop bucket
  id: MopBucketFull
  parent: MopBucket
  suffix: full
  components:
    - type: Sprite
      layers:
        - state: mopbucket
        - state: mopbucket_water-3
          map: [ "enum.SolutionContainerLayers.Fill" ]
    - type: SolutionContainerManager
      solutions:
        bucket:
          maxVol: 600
          reagents:
            - ReagentId: Water
              Quantity: 600

- type: entity
  parent: BaseWrappedCube
  name: mop bucket cube
  id: MopBucketCubeWrapped
  description: Unwrap this to get a mop bucket cube.
  components:
  - type: SpawnItemsOnUse
    items:
    - id: MopBucketCube
  - type: Sprite
    state: wrapper

# Janicart
- type: entity
  name: janitorial trolley
  id: JanitorialTrolley
  parent: [BaseStructureDynamic, StructureWheeled]
  description: This is the alpha and omega of sanitation.
  components:
    - type: Sprite
      noRot: true
      sprite: Objects/Specific/Janitorial/janitorial_cart.rsi
      layers:
        - state: cart
        - state: cart_water-1
          map: ["enum.SolutionContainerLayers.Fill"]
          visible: false
    - type: Rotatable
    - type: InteractionOutline
    # Removing storage until OnInteractUsing logic resolved
    #- type: Storage
    #  popup: false
    #  capacity: 80
    #  blacklist: # there is exclusive item slots for that
    #    tags:
    #      - Mop
    #      - TrashBag
    #      - Bucket
    - type: ItemSlots
      slots:
        mop_slot:
          name: janitorial-trolley-slot-component-slot-name-mop
          whitelist:
            tags:
              - Mop
          insertOnInteract: false # or it conflicts with bucket logic
          priority: 9 # Higher than bucket slot
        plunger_slot:
          name: janitorial-trolley-slot-component-slot-name-plunger
          whitelist:
            tags:
              - Plunger
        goldenplunger_slot:
          name: janitorial-trolley-slot-component-slot-name-goldenplunger
          whitelist:
            tags:
            - GoldenPlunger
          priority: 8
        wetfloorsign_slot4:
          name: janitorial-trolley-slot-component-slot-name-sign
          whitelist:
            tags:
              - WetFloorSign
          priority: 7
        wetfloorsign_slot3:
          name: janitorial-trolley-slot-component-slot-name-sign
          whitelist:
            tags:
              - WetFloorSign
          priority: 7
        wetfloorsign_slot2:
          name: janitorial-trolley-slot-component-slot-name-sign
          whitelist:
            tags:
              - WetFloorSign
          priority: 7
        wetfloorsign_slot1:
          name: janitorial-trolley-slot-component-slot-name-sign
          whitelist:
            tags:
              - WetFloorSign
          priority: 7
        lightreplacer_slot:
          name: janitorial-trolley-slot-component-slot-name-lightreplacer
          whitelist:
            components:
              - LightReplacer
          priority: 6
        spraybottle_slot:
          name: janitorial-trolley-slot-component-slot-name-spray
          whitelist:
            tags:
              - Spray
          insertOnInteract: false # or it conflicts with bucket logic
          priority: 5 # Higher than bucket slot
        bucket_slot:
          name: janitorial-trolley-slot-component-slot-name-bucket
          whitelist:
            tags:
              - Bucket
          insertOnInteract: false # or it also conflicts with bucket logic
          priority: 4 # Higher than trash bag slot
        trashbag_slot:
          name: janitorial-trolley-slot-component-slot-name-trashbag
          whitelist:
            tags:
              - TrashBag
          priority: 3 # Higher than drinking priority
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeCircle
            radius: 0.3
          density: 250
          layer:
          - MobLayer
          mask:
          - MobMask
    - type: Spillable
      solution: bucket
      spillDelay: 3.0
      spillWhenThrown: false
    - type: SolutionContainerManager
      solutions:
        bucket:
          maxVol: 800
          reagents:
            - ReagentId: Water
              Quantity: 600 # 3 quarters full at roundstart to make it more appealing
    - type: DrainableSolution
      solution: bucket
    - type: RefillableSolution
      solution: bucket
    - type: ExaminableSolution
      solution: bucket
    - type: Tag
      tags:
        - Wringer
    - type: Damageable
      damageContainer: Inorganic
      damageModifierSet: Metallic
    - type: Destructible
      thresholds:
        - trigger:
            !type:DamageTrigger
            damage: 400
          behaviors:
            - !type:DoActsBehavior
              acts: [ "Destruction" ]
        - trigger:
            !type:DamageTrigger
            damage: 200
          behaviors:
            - !type:EmptyAllContainersBehaviour
            - !type:DoActsBehavior
              acts: ["Destruction"]
            - !type:PlaySoundBehavior
              sound:
                collection: MetalBreak
    - type: ItemMapper
      mapLayers:
        cart_plunger:
          whitelist:
            tags:
              - Plunger
        cart_goldenplunger:
          whitelist:
            tags:
            - GoldenPlunger
        cart_mop:
          whitelist:
            tags:
              - MopBasic
        cart_advmop:
          whitelist:
            tags:
              - MopAdv
        cart_garbage:
          whitelist:
            tags:
              - TrashBag
        cart_replacer:
          whitelist:
            components:
              - LightReplacer
        cart_spray:
          whitelist:
            tags:
              - Spray
        cart_sign1: # this is like stack of floor signs
          minCount: 1
          whitelist:
            tags:
              - WetFloorSign
        cart_sign2:
          minCount: 2
          whitelist:
            tags:
              - WetFloorSign
        cart_sign3:
          minCount: 3
          whitelist:
            tags:
              - WetFloorSign
        cart_sign4:
          minCount: 4
          whitelist:
            tags:
              - WetFloorSign
        cart_bucket:
          whitelist:
            tags:
              - Bucket
      sprite: Objects/Specific/Janitorial/janitorial_cart.rsi
    - type: Appearance
    - type: SolutionContainerVisuals
      maxFillLevels: 3
      fillBaseName: cart_water-
    - type: UserInterface
      interfaces:
        enum.StorageUiKey.Key:
          type: StorageBoundUserInterface
    - type: Drink
      solution: bucket
    - type: ContainerContainer
      containers:
        storagebase: !type:Container
          ents: []
        mop_slot: !type:ContainerSlot {}
        trashbag_slot: !type:ContainerSlot {}
        bucket_slot: !type:ContainerSlot {}
        plunger_slot: !type:ContainerSlot {}
        goldenplunger_slot: !type:ContainerSlot {}
        wetfloorsign_slot4: !type:ContainerSlot {}
        wetfloorsign_slot3: !type:ContainerSlot {}
        wetfloorsign_slot2: !type:ContainerSlot {}
        wetfloorsign_slot1: !type:ContainerSlot {}
        lightreplacer_slot: !type:ContainerSlot {}
        spraybottle_slot:  !type:ContainerSlot {}
    - type: GuideHelp
      guides:
      - Janitorial
    - type: DnaSubstanceTrace