# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Campbell Suter <znix@znix.xyz>
# SPDX-FileCopyrightText: 2020 ComicIronic <comicironic@gmail.com>
# SPDX-FileCopyrightText: 2020 F77F <66768086+F77F@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Hugal31 <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Swept <jamesurquhartwebb@gmail.com>
# SPDX-FileCopyrightText: 2020 Vince <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 ancientpower <ancientpowerer@gmail.com>
# SPDX-FileCopyrightText: 2020 ancientpower <evafleck@gmail.com>
# SPDX-FileCopyrightText: 2020 scuffedjays <yetanotherscuffed@gmail.com>
# SPDX-FileCopyrightText: 2020 silicons <2003111+silicons@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 zumorica <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Acruid <shatter66@gmail.com>
# SPDX-FileCopyrightText: 2021 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2021 Alex Evgrashin <evgrashin.adl@gmail.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Remie Richards <remierichards@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: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 adamsong <adamsong@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 crazybrain23 <44417085+crazybrain23@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2024 12rabbits <53499656+12rabbits@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 AutoOtter <joshuademorris@gmail.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DieselMohawk <gavin.drinka@gmail.com>
# SPDX-FileCopyrightText: 2024 Dimastra <65184747+Dimastra@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Dimastra <dimastra@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JIPDawg <51352440+JIPDawg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JIPDawg <JIPDawg93@gmail.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 MisterMecky <mrmecky@hotmail.com>
# SPDX-FileCopyrightText: 2024 Moomoobeef <62638182+Moomoobeef@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Partmedia <kevinz5000@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PopGamer46 <yt1popgamer@gmail.com>
# SPDX-FileCopyrightText: 2024 PursuitInAshes <pursuitinashes@gmail.com>
# SPDX-FileCopyrightText: 2024 QueerNB <176353696+QueerNB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 RumiTiger <154005209+RumiTiger@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Saphire Lattice <lattice@saphi.re>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Spessmann <156740760+Spessmann@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Unisol <1929445+Unisol@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 coolboy911 <85909253+coolboy911@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 lunarcomets <140772713+lunarcomets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 osjarw <oskariwjarvinen@gmail.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stellar-novas <stellar_novas@riseup.net>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 BombasterDS <deniskaporoshok@gmail.com>
# SPDX-FileCopyrightText: 2025 BombasterDS2 <shvalovdenis.workmail@gmail.com>
# SPDX-FileCopyrightText: 2025 DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 DrSmugleaf <drsmugleaf@gmail.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ichaie <167008606+Ichaie@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ilya246 <ilyukarno@gmail.com>
# SPDX-FileCopyrightText: 2025 JORJ949 <159719201+JORJ949@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 John Willis <143434770+CerberusWolfie@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 MortalBaguette <169563638+MortalBaguette@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Panela <107573283+AgentePanela@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 Poips <Hanakohashbrown@gmail.com>
# SPDX-FileCopyrightText: 2025 PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Rinary <72972221+Rinary1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
# SPDX-FileCopyrightText: 2025 Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 blobadoodle <me@bloba.dev>
# SPDX-FileCopyrightText: 2025 coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2025 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <linebarrelerenthusiast@gmail.com>
# SPDX-FileCopyrightText: 2025 kamkoi <poiiiple1@gmail.com>
# SPDX-FileCopyrightText: 2025 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 shibe <95730644+shibechef@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 tetra <169831122+Foralemes@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: Incorporeal
  save: false
  abstract: true
  description: Mobs without physical bodies
  components:
  - type: Sprite
    noRot: true
    overrideContainerOcclusion: true # Always show up regardless of where they're contained.
    drawdepth: Ghosts
  - type: FTLSmashImmune
  - type: CargoSellBlacklist
  - type: MovementSpeedModifier
    baseSprintSpeed: 12
    baseWalkSpeed: 8
  - type: MovementIgnoreGravity
  - type: Physics
    bodyType: KinematicController
    bodyStatus: InAir
  - type: CanMoveInAir
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        density: 15
        layer:
        - GhostImpassable

# shared parent between aghosts, replay spectators and normal observers
- type: entity
  parent:
  - Incorporeal
  - BaseMob
  id: MobObserverBase
  abstract: true
  name: observer
  description: Boo!
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Mobs/Ghosts/ghost_human.rsi
    color: "#fff8"
    layers:
    - state: animated
      shader: unshaded
  - type: ContentEye
    maxZoom: 1.44,1.44
  - type: Eye
    drawFov: false
    visMask:
      - Ghost
      - Normal
      - CosmicCultMonument # DeltaV - Cosmic Cult
      - Abductor # Shitmed - Starlight Abductors
  - type: Input
    context: "ghost"
  - type: Examiner
    skipChecks: true
  - type: Ghost
  - type: GhostHearing
  - type: ShowElectrocutionHUD
  - type: IntrinsicRadioReceiver
  - type: ActiveRadio
    receiveAllChannels: true
    globalReceive: true
  - type: Tag
    tags:
    - BypassInteractionRangeChecks
  - type: PointLight
    netsync: false
    radius: 6
    castShadows: false
    enabled: false
  - type: Speech #Goobstation - Dead chat verbs
    speechVerb: Dead
  - type: GhostColor
  - type: CollectiveMind
    hearAll: true
    seeAllNames: true
  - type: LanguageSpeaker # Einstein Engines - Languages
  - type: UniversalLanguageSpeaker # Einstein Engines - Languages
  - type: UserInterface
    interfaces:
      enum.RevivalContractUiKey.Key: # Goobstation - Devil
        type: RevivalContractBoundUserInterface
        requireInputValidation: false
  - type: Sprinter # Goob Change

# proto for player ghosts specifically
- type: entity
  parent: MobObserverBase
  id: MobObserver
  components:
  - type: Spectral
  - type: Tag
    tags:
    - AllowGhostShownByEvent
  # <Goobstation>
  - type: UserInterface
    interfaces:
      enum.RadarConsoleUiKey.Key:
        type: RadarConsoleBoundUserInterface
  - type: IntrinsicUI
    uis:
      enum.RadarConsoleUiKey.Key:
        toggleAction: ActionGhostShowRadar
  - type: RadarConsole
    followEntity: true
  # </Goobstation>


# Goobstation
- type: entity
  id: ActionGhostShowRadar
  name: Mass Scanner Interface
  description: View a Mass Scanner Interface.
  components:
  - type: Action
    icon: { sprite: Interface/Actions/actions_ai.rsi, state: mass_scanner }
    iconOn: Interface/Actions/actions_ai.rsi/mass_scanner.png
    keywords: [ "AI", "console", "interface" ]
    priority: 10
    checkCanInteract: false
  - type: InstantAction
    event: !type:ToggleIntrinsicUIEvent { key: enum.RadarConsoleUiKey.Key }

- type: entity
  parent: BaseMentalAction
  id: ActionGhostBoo
  name: Boo!
  description: Scare your crew members because of boredom!
  components:
  - type: Action
    icon: Interface/Actions/scream.png
    checkCanInteract: false
    startDelay: true
    useDelay: 120
  - type: InstantAction
    event: !type:BooActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionToggleLighting
  name: Toggle Lighting
  description: Toggle light rendering to better observe dark areas.
  components:
  - type: Action
    icon: Interface/VerbIcons/light.svg.192dpi.png
    clientExclusive: true
    checkCanInteract: false
    raiseOnUser: true # Goobstation
  - type: InstantAction
    event: !type:ToggleLightingActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionToggleFov
  name: Toggle FoV
  description: Toggles field-of-view in order to see what players see.
  components:
  - type: Action
    icon: Interface/VerbIcons/vv.svg.192dpi.png
    clientExclusive: true
    checkCanInteract: false
    raiseOnUser: true # Goobstation
  - type: InstantAction
    event: !type:ToggleFoVActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionToggleGhosts
  name: Toggle Ghosts
  description: Toggle the visibility of other ghosts.
  components:
  - type: Action
    icon: { sprite: Mobs/Ghosts/ghost_human.rsi, state: icon }
    clientExclusive: true
    checkCanInteract: false
    raiseOnUser: true # Goobstation
  - type: InstantAction
    event: !type:ToggleGhostsActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionToggleGhostHearing
  name: Toggle Ghost Hearing
  description: Toggle between hearing all messages and hearing only radio & nearby messages.
  components:
  - type: Action
    icon:
      sprite: Clothing/Ears/Headsets/base.rsi
      state: icon
    iconOn: Interface/Actions/ghostHearingToggled.png
  - type: InstantAction
    event: !type:ToggleGhostHearingActionEvent
