- 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
  - 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

# proto for player ghosts specifically
- type: entity
  parent: MobObserverBase
  id: MobObserver
  components:
  - type: Spectral
  - type: Tag
    tags:
    - AllowGhostShownByEvent

- 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
  - 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
  - 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
  - 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
