# SPDX-FileCopyrightText: 2022 ChilbroBaggins <107660393+ChilbroBaggins@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Fishfish458 <47410468+Fishfish458@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2022 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2022 fishfish458 <fishfish458>
# SPDX-FileCopyrightText: 2023 EnDecc <33369477+Endecc@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 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 RatherUncreative <RatherUncreativeName@proton.me>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: sink
  id: SinkEmpty
  suffix: Empty
  description: The faucets have been tightened to the maximum possible torque but are still known to drip.
  placement:
    mode: SnapgridCenter
  components:
  - type: Clickable
  - type: InteractionOutline
  - type: Sprite
    sprite: Structures/Furniture/sink.rsi
    layers:
      - state: sink_stem
      - map: [ "enum.SolutionContainerLayers.Fill" ]
        state: sink-fill-1
        visible: false
  - type: Appearance
  - type: SolutionContainerVisuals
    maxFillLevels: 1
    fillBaseName: sink-fill-
    solutionName: drainBuffer
  - type: SolutionContainerManager
    solutions:
      drainBuffer:
        maxVol: 100
      tank:
        maxVol: 9999999 # Goobstation - No regenerating water, so lets just give it a fuck ton.
        reagents:
        - ReagentId: Water
          Quantity: 9999999
  #- type: SolutionRegeneration Goobstation - laggy
  #  solution: tank
  #  generated:
  #    reagents:
  #    - ReagentId: Water
  #      Quantity: 1
  - type: DrainableSolution
    solution: tank
  - type: ReagentTank
  - type: Drain
    autoDrain: false
  - type: DumpableSolution
    solution: drainBuffer
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 80
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 40
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:PlaySoundBehavior
            sound:
              collection: MetalBreak
  - type: AmbientSound
    enabled: false
    volume: -8
    range: 8
    sound:
      path: /Audio/Ambience/Objects/drain.ogg


- type: entity
  name: sink
  id: Sink
  parent: SinkEmpty
  suffix: Water
  components:
  - type: SolutionContainerManager
    solutions:
      drainBuffer:
        maxVol: 200
      tank:
        reagents:
        - ReagentId: Water
          Quantity: 9999999

- type: entity
  name: wide sink
  id: SinkWide
  parent: Sink
  components:
    - type: Sprite
      sprite: Structures/Furniture/sink.rsi
      layers:
        - state: sink_wide
        - map: [ "enum.SolutionContainerLayers.Fill" ]
          state: sink_wide-fill-1
          visible: false
    - type: SolutionContainerVisuals
      maxFillLevels: 1
      fillBaseName: sink_wide-fill-
      solutionName: drainBuffer

#Stemless Sink

- type: entity
  name: sink
  id: SinkStemless
  parent: SinkEmpty
  components:
  - type: Sprite
    sprite: Structures/Furniture/sink.rsi
    layers:
      - state: sink
      - map: [ "enum.SolutionContainerLayers.Fill" ]
        state: sink-fill-1
        visible: false

- type: entity
  name: sink
  id: SinkStemlessWater
  parent: SinkStemless
  suffix: Water
  components:
  - type: SolutionContainerManager
    solutions:
      drainBuffer:
        maxVol: 100
      tank:
        reagents:
        - ReagentId: Water
          Quantity: 9999999