# SPDX-FileCopyrightText: 2023 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Morb <14136326+Morb0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: FatExtractor
  parent: BaseMachinePowered
  name: lipid extractor
  description: Safely and efficiently extracts excess fat from a subject.
  components:
  - type: FatExtractor
    processSound:
      path: /Audio/Machines/microwave_loop.ogg
      params:
        loop: true
        maxDistance: 5
  - type: Sprite
    sprite: Structures/Machines/fat_sucker.rsi
    snapCardinals: true
    layers:
    - state: fat
      map: ["enum.StorageVisualLayers.Base"]
    - state: fat_door_off
      map: ["enum.StorageVisualLayers.Door"]
    - state: fat_red
      shader: unshaded
      map: ["enum.PowerDeviceVisualLayers.Powered"]
    - state: fat_green
      shader: unshaded
      visible: false
      map: ["enum.FatExtractorVisualLayers.Light"]
    - state: fat_panel
      visible: false
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
    - state: fat_stack #cash cash cash
      visible: false
      map: ["enum.FatExtractorVisualLayers.Stack"]
    - state: fat_smoke
      visible: false
      map: ["enum.FatExtractorVisualLayers.Smoke"]
  - type: Lock
    breakOnAccessBreaker: false
  - type: GenericVisualizer
    visuals:
      enum.StorageVisuals.Open:
        enum.StorageVisualLayers.Door:
          True: { visible: false }
          False: { visible: true }
      enum.FatExtractorVisuals.Processing:
        enum.StorageVisualLayers.Door:
          True: { state: fat_door_on }
          False: { state: fat_door_off }
        enum.FatExtractorVisualLayers.Smoke:
          True: { visible: true }
          False: { visible: false }
        enum.FatExtractorVisualLayers.Stack:
          True: { visible: true }
          False: { visible: false }
        enum.FatExtractorVisualLayers.Light:
          True: { visible: true }
          False: { visible: false }
      enum.PowerDeviceVisuals.Powered:
        enum.FatExtractorVisualLayers.Light:
          False: { visible: false }
        enum.PowerDeviceVisualLayers.Powered:
          True: { visible: true }
          False: { visible: false }
      enum.StorageVisuals.HasContents:
        enum.PowerDeviceVisualLayers.Powered:
          True: { state: fat_yellow }
          False: { state: fat_red }
      enum.WiresVisuals.MaintenancePanelState:
        enum.WiresVisualLayers.MaintenancePanel:
          True: { visible: true }
          False: { visible: false }
  - type: Construction
    graph: Machine
    node: machine
    containers:
    - machine_board
    - machine_parts
    - entity_storage
  - type: EmptyOnMachineDeconstruct
    containers:
     - entity_storage
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: StructuralMetallicStrong
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalGlassBreak
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Machine
    board: FatExtractorMachineCircuitboard
  - type: WiresPanel
  - type: Appearance
  - type: Speech
    speechVerb: Robotic
  - type: Vocalizer
    hideChat: true
  - type: VocalizerRequiresPower
  - type: DatasetVocalizer
    dataset: FatExtractorFacts
  - type: StaticPrice
    price: 1000
  - type: ResistLocker
  - type: EntityStorage
    capacity: 1
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      entity_storage: !type:Container