# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2023 Julian Giebel <juliangiebel@live.de>
# SPDX-FileCopyrightText: 2023 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 Boaz1111 <149967078+Boaz1111@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Dakamakat <52600490+dakamakat@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hannah Giovanna Dawson <karakkaraz@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: MachineArtifactAnalyzer
  parent: [ BaseMachinePowered, SmallConstructibleMachine ]
  name: artifact analyzer
  description: A platform capable of performing analysis on various types of artifacts.
  components:
  - type: Sprite
    noRot: true
    sprite: Structures/Machines/artifact_analyzer.rsi
    drawdepth: HighFloorObjects
    layers:
    - state: icon
    - state: unshaded
      shader: unshaded
      map: ["enum.PowerDeviceVisualLayers.Powered"]
  - type: Physics
    bodyType: Static
    canCollide: true
  - type: AmbientSound
    enabled: false
    sound:
      path: /Audio/Machines/scan_loop.ogg
    range: 5
    volume: -8
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.35,-0.35,0.35,0.35"
        mask:
        - Impassable
        - HighImpassable
        - MidImpassable
      fix2:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.35,-0.35,0.35,0.35"
        density: 190
        mask:
        - MachineMask
        layer:
        - Impassable
        - MidImpassable
        - LowImpassable
        - BulletImpassable
        hard: False
  - type: Transform
    anchored: true
  - type: ApcPowerReceiver
    powerLoad: 12000
    needsPower: false #only turns on when scanning
  - type: ArtifactAnalyzer
  - type: ItemPlacer
    whitelist:
      components:
      - XenoArtifact
  - type: DeviceNetwork
    deviceNetId: Wired
    receiveFrequencyId: BasicDevice
  - type: DeviceList
  - type: DeviceLinkSink
    ports:
      - ArtifactAnalyzerReceiver
  - type: Machine
    board: ArtifactAnalyzerMachineCircuitboard
  - type: PointLight
    radius: 1.5
    energy: 1.6
    color: "#b53ca1"
  - type: GuideHelp
    guides:
    - Xenoarchaeology
  - type: LitOnPowered
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.PowerDeviceVisuals.Powered:
        enum.PowerDeviceVisualLayers.Powered:
          True: { visible: true }
          False: { visible: false }

- type: entity
  id: MachineArtifactCrusher
  parent: [ ConstructibleMachine, BaseMachinePowered ]
  name: artifact crusher
  description: Best not to let your fingers get stuck...
  components:
  - type: ArtifactCrusher
    crushingWhitelist:
      components:
      - XenoArtifact
    crushingDamage:
      types:
        Blunt: 10
  - type: Machine
    board: ArtifactCrusherMachineCircuitboard
  - type: WiresPanel
  - type: Sprite
    sprite: Structures/Machines/artifact_crusher.rsi
    offset: 0,0.5
    noRot: true
    layers:
    - state: base
      map: ["enum.StorageVisualLayers.Base"]
    - state: door-closed
      map: ["enum.StorageVisualLayers.Door"]
    - state: piston
      map: ["pistonlayer"]
    - state: glass
    - state: lights
      map: ["enum.PowerDeviceVisualLayers.Powered"]
      shader: unshaded
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.45
        density: 50
        mask:
        - HighImpassable
        layer:
        - HighImpassable
  - type: EntityStorage
    capacity: 1
    whitelist:
      components:
      - XenoArtifact
      tags:
      - CanPilot # People
      - VimPilot # Pets
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ArtifactCrusherVisuals.Crushing:
        pistonlayer:
          True: {state: piston-push}
          False: {state: piston}
      enum.PowerDeviceVisuals.Powered:
        enum.PowerDeviceVisualLayers.Powered:
          True: { visible: true }
          False: { visible: false }
  - type: EntityStorageVisuals
    stateDoorClosed: door-closed
    openDrawDepth: 0
    closedDrawDepth: 4
  - type: Construction
    containers:
    - machine_board
    - machine_parts
    - entity_storage
    - output_container
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      entity_storage: !type:Container
      output_container: !type:Container