# SPDX-FileCopyrightText: 2021 Julian Giebel <j.giebel@netrocks.info>
# SPDX-FileCopyrightText: 2021 Julian Giebel <juliangiebel@live.de>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Moony <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 LittleNyanCat <littlenyancat204@gmail.com>
# SPDX-FileCopyrightText: 2024 MendaxxDev <153332064+MendaxxDev@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 ActiveMammmoth <140334666+ActiveMammmoth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 ActiveMammmoth <kmcsmooth@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 keronshb <54602815+keronshb@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseStructureComputer
  id: BaseComputer
  name: computer
  placement:
    mode: SnapgridCenter
  components:
  - type: Animateable
  - type: MeleeSound
    soundGroups:
      Brute:
        collection: GlassSmash
  - type: Construction
    graph: Computer
    node: computer
    containers:
      - board
  - type: Computer
  - type: ApcPowerReceiver
    powerLoad: 200
  - type: ExtensionCableReceiver
  - type: ActivatableUIRequiresPower
  - type: Sprite
    sprite: Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: generic
    - map: ["computerLayerKeys"]
      state: generic_keys
    - map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
      state: generic_panel_open
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ComputerVisuals.Powered:
        computerLayerScreen:
          True: { visible: true, shader: unshaded }
          False: { visible: false }
        computerLayerKeys:
          True: { visible: true, shader: unshaded }
          False: { visible: true, shader: shaded }
      enum.WiresVisuals.MaintenancePanelState:
        enum.WiresVisualLayers.MaintenancePanel:
          True: { visible: false }
          False: { visible: true }
  - type: LitOnPowered
  - type: PointLight
    radius: 1.5
    energy: 1.6
    enabled: false
    mask: /Textures/Effects/LightMasks/cone.png
    autoRot: true
    offset: "0, 0.4" # shine from the top, not bottom of the computer
    castShadows: false
  - type: EmitSoundOnUIOpen
    sound:
      collection: Keyboard
      params:
        volume: -1
        variation: 0.10
        pitch: 1.10  # low pitch keyboard sounds feel kinda weird
    blacklist:
      tags:
      - NoConsoleSound
  - type: ContainerContainer
    containers:
      board: !type:Container
        ents: []
  - type: LightningTarget
    priority: 1
  - type: RequireProjectileTarget
  - type: Electrified
    enabled: false
    usesApcPower: true
  - type: WiresPanel
  - type: WiresVisuals
  - type: Wires
    boardName: wires-board-name-computer
    layoutId: Computer
  - type: SpamEmitSound # Goobstation - random lathe sounds
    minInterval: 45
    maxInterval: 120
    sound:
      collection: MonoComputerSFX
      params:
        volume: -12 # Ambient
        maxDistance: 10
        variation: 0.05
  - type: SpamEmitSoundRequirePower # Goobstation
  - type: InteractedBlacklist # Goobstation - xenos too stupid to use computer
    blacklist:
      components:
      - Xenomorph
  # Einstein Engines - Language begin
  - type: LanguageSpeaker
  - type: LanguageKnowledge
    speaks:
    - TauCetiBasic
    understands:
    - TauCetiBasic
  # Einstein Engines - Language end
#
#     This is overwritten by children, so needs to be defined there
#  - type: UserInterface
#    interfaces:
#      enum.WiresUiKey.Key:
#        type: WiresBoundUserInterface

- type: entity
  parent: BaseComputer
  id: BaseComputerAiAccess
  components:
  - type: StationAiWhitelist
  - type: Wires
    boardName: wires-board-name-computer
    layoutId: ComputerAi
