# SPDX-FileCopyrightText: 2020 Remie Richards <remierichards@gmail.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Acruid <shatter66@gmail.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Paul <ritter.paul1+git@googlemail.com>
# SPDX-FileCopyrightText: 2021 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2021 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Veritius <veritiusgaming@gmail.com>
# SPDX-FileCopyrightText: 2022 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: Morgue
  name: morgue
  description: Used to store bodies until someone fetches them. Includes a high-tech alert system for false-positives!
  placement:
    mode: SnapgridCenter
  components:
  - type: Pullable
  - type: Anchorable
  - type: Sprite
    sprite: Structures/Storage/morgue.rsi
    layers:
    - state: morgue_closed
      map: ["enum.MorgueVisualLayers.Base"]
    - state: morgue_tray
      offset: 0, -1
      visible: false
      map: ["enum.StorageVisualLayers.Door"]
    - state: morgue_nomob_light
      visible: false
      map: ["enum.MorgueVisualLayers.Light"]
      shader: unshaded
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.5,0.5"
        density: 1000
        mask:
        - MachineMask
        layer:
        - HalfWallLayer
  - type: EntityStorage
    isCollidableWhenOpen: true
    showContents: false
    capacity: 1
    enteringOffset: 0, -1
    closeSound:
      path: /Audio/Items/deconstruct.ogg
    openSound:
      path: /Audio/Items/deconstruct.ogg
  - type: EntityStorageLayingDownOverride
  - type: Morgue
  - type: ContainerContainer
    containers:
      entity_storage: !type:Container
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.StorageVisuals.Open:
        # basic open.close layer:
        enum.MorgueVisualLayers.Base:
          True: { state: morgue_open}
          False: { state: morgue_closed}
        # show/hide morgue tray:
        enum.StorageVisualLayers.Door:
          True: { visible: true}
          False: { visible: false}
      enum.MorgueVisuals.Contents:
        # toggle contents light indicator:
        enum.MorgueVisualLayers.Light:
          Empty: {visible: false}
          HasContents: {visible: true, state: morgue_nomob_light}
          HasMob: {visible: true, state: morgue_nosoul_light}
          HasSoul: {visible: true, state: morgue_soul_light}
  - type: Transform
    anchored: true
  - type: AntiRottingContainer
  - type: StaticPrice
    price: 200

- type: entity
  id: Crematorium
  name: crematorium
  description: A human incinerator. Works well on barbecue nights.
  placement:
    mode: SnapgridCenter
  components:
  - type: Sprite
    sprite: Structures/Storage/morgue.rsi
    layers:
    - state: crema_closed
      map: ["enum.CrematoriumVisualLayers.Base", "enum.StorageVisualLayers.Base"]
    - state: crema_tray
      offset: 0, -1
      map: ["enum.StorageVisualLayers.Door"]
    - state: crema_contents_light
      visible: false
      map: ["enum.CrematoriumVisualLayers.LightContent"]
      shader: unshaded
    - state: crema_active_light
      visible: false
      map: ["enum.CrematoriumVisualLayers.LightBurning"]
      shader: unshaded
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.5,0.5"
        density: 190
        mask:
        - MachineMask
        layer:
        - MachineLayer
  - type: EntityStorage
    isCollidableWhenOpen: true
    showContents: false
    capacity: 1
    enteringOffset: 0, -1
    closeSound:
      path: /Audio/Items/deconstruct.ogg
    openSound:
      path: /Audio/Items/deconstruct.ogg
  - type: EntityStorageLayingDownOverride
  - type: Crematorium
  - type: ContainerContainer
    containers:
      entity_storage: !type:Container
  - type: Appearance
  - type: EntityStorageVisuals
    stateBaseClosed: crema_closed
    stateBaseOpen: crema_open
    stateDoorOpen: crema_tray
  - type: GenericVisualizer
    visuals:
      enum.CrematoriumVisuals.Burning:
        enum.CrematoriumVisualLayers.LightBurning:
          True: { visible: true }
          False: { visible: false }
      enum.StorageVisuals.HasContents:
        enum.CrematoriumVisualLayers.LightContent:
          True: { visible: true }
          False: { visible: false }
  - type: Transform
    anchored: true