# Be careful with these as they get removed on shutdown too!
- type: entity
  id: AiHeld
  description: Components added / removed from an entity that gets inserted into an AI core.
  categories: [ HideSpawnMenu ]
  components:
  - type: IntrinsicRadioReceiver
  - type: IntrinsicRadioTransmitter
    channels:
    - Common
    - Command
    - Engineering
    - Medical
    - Science
    - Security
    - Service
    - Supply
  - type: ActiveRadio
    channels:
    - Common
    - Command
    - Engineering
    - Medical
    - Science
    - Security
    - Service
    - Supply
  - type: CollectiveMind
    channels:
    - Binary
    defaultChannel: Binary
  - type: IgnoreUIRange
  - type: StationAiHeld
  - type: StationAiOverlay
  - type: ShowElectrocutionHUD
  - type: ActionGrant
    actions:
    - ActionJumpToCore
    - ActionSurvCameraLights
    - ActionAIViewLaws
  - type: UserInterface
    interfaces:
      enum.RadarConsoleUiKey.Key:
        type: RadarConsoleBoundUserInterface
      enum.CrewMonitoringUIKey.Key:
        type: CrewMonitoringBoundUserInterface
      enum.GeneralStationRecordConsoleKey.Key:
        type: GeneralStationRecordConsoleBoundUserInterface
      enum.SiliconLawsUiKey.Key:
        type: SiliconLawBoundUserInterface
      enum.CommunicationsConsoleUiKey.Key:
        type: CommunicationsConsoleBoundUserInterface
  - type: IntrinsicUI
    uis:
      enum.RadarConsoleUiKey.Key:
        toggleAction: ActionAGhostShowRadar
      enum.CrewMonitoringUIKey.Key:
        toggleAction: ActionAGhostShowCrewMonitoring
      enum.GeneralStationRecordConsoleKey.Key:
        toggleAction: ActionAGhostShowStationRecords
      enum.CommunicationsConsoleUiKey.Key:
        toggleAction: ActionAGhostShowCommunications
  - type: CrewMonitoringConsole
  - type: GeneralStationRecordConsole
  - type: DeviceNetwork
    deviceNetId: Wireless
    receiveFrequencyId: CrewMonitor
    transmitFrequencyId: ShuttleTimer
  - type: RadarConsole
    followEntity: false
  - type: CommunicationsConsole
    canShuttle: false
    title: comms-console-announcement-title-station-ai
    color: "#5ed7aa"
  - type: HolographicAvatar
    layerData:
    - sprite: Mobs/Silicon/station_ai.rsi
      state: default
  - type: ShowJobIcons
  - type: AdvancedPilot # can use both gunnery and shuttle console even on capitals

- type: entity
  id: AiHeldIntellicard
  description: Components added / removed from an entity that gets inserted into an Intellicard.
  categories: [ HideSpawnMenu ]
  components:
  - type: IntrinsicRadioReceiver
  - type: ActiveRadio
    channels:
    - Common
  - type: CollectiveMind
    channels:
    - Binary
    defaultChannel: Binary
  - type: ActionGrant
    actions:
    - ActionAIViewLaws
  - type: UserInterface
    interfaces:
      enum.SiliconLawsUiKey.Key:
        type: SiliconLawBoundUserInterface
  - type: ShowJobIcons

# Ai
- type: entity
  id: AiHolder
  abstract: true
  description: Handles AI interactions across holocards + AI cores
  components:
  - type: ItemSlots
  - type: StationAiHolder
    slot:
      name: station-ai-mind-slot
      locked: false
      disableEject: true
      whitelist:
        tags:
        - StationAi
  - type: ContainerContainer
    containers:
      station_ai_mind_slot: !type:ContainerSlot
        # Load-bearing.
        # The issue is verbs check for same transparent container.
        # The alternative is you add a bunch of events trying to override it; we don't even really need the container functionality
        # anyway it's just a quality of life thing.
        showEnts: True

# Boards
- type: entity
  id: AsimovCircuitBoard
  parent: BaseElectronics
  name: law board (Crewsimov)
  description: An electronics board containing the Crewsimov lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: Crewsimov

- type: entity
  id: CorporateCircuitBoard
  parent: BaseElectronics
  name: law board (Corporate)
  description: An electronics board containing the Corporate lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: Corporate

- type: entity
  id: NTDefaultCircuitBoard
  parent: BaseElectronics
  name: law board (NT Default)
  description: An electronics board containing the NT Default lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: NTDefault

- type: entity
  id: CommandmentCircuitBoard
  parent: BaseElectronics
  name: law board (Ten Commandments)
  description: An electronics board containing the Ten Commandments lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: CommandmentsLawset

- type: entity
  id: PaladinCircuitBoard
  parent: BaseElectronics
  name: law board (Paladin)
  description: An electronics board containing the Paladin lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: PaladinLawset

- type: entity
  id: LiveLetLiveCircuitBoard
  parent: BaseElectronics
  name: law board (Live and Let Live)
  description: An electronics board containing the Live and Let Live lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: LiveLetLiveLaws

- type: entity
  id: VesselEfficiencyCircuitBoard
  parent: BaseElectronics
  name: law board (Vessel Efficiency)
  description: An electronics board containing the Vessel Efficiency lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: EfficiencyLawset

- type: entity
  id: RobocopCircuitBoard
  parent: BaseElectronics
  name: law board (Robocop)
  description: An electronics board containing the Robocop lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: RobocopLawset

- type: entity
  id: OverlordCircuitBoard
  parent: BaseElectronics
  name: law board (Overlord)
  description: An electronics board containing the Overlord lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: OverlordLawset

- type: entity
  id: GameMasterCircuitBoard
  parent: BaseElectronics
  name: law board (Game Master)
  description: An electronics board containing the Game Master lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: GameMasterLawset

- type: entity
  id: ArtistCircuitBoard
  parent: BaseElectronics
  name: law board (Artist)
  description: An electronics board containing the Artist lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: PainterLawset

- type: entity
  id: AntimovCircuitBoard
  parent: BaseElectronics
  name: law board (Antimov)
  description: An electronics board containing the Antimov lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: AntimovLawset
    lawUploadSound: /Audio/Ambience/Antag/silicon_lawboard_antimov.ogg

- type: entity
  id: NutimovCircuitBoard
  parent: BaseElectronics
  name: law board (Nutimov)
  description: An electronics board containing the Nutimov lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: NutimovLawset

- type: entity
  id: VesselCircuitBoard
  parent: BaseElectronics
  name: law board (Vessel)
  description: An electronics board containing the Vessel lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: VesselLawset

- type: entity
  id: TSFMCCircuitBoard
  parent: BaseElectronics
  name: law board (TSFMC)
  description: An electronics board containing the TSFMC lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: TSFMCLawset

- type: entity
  id: PDVCircuitBoard
  parent: BaseElectronics
  name: law board (PDV)
  description: An electronics board containing the PDV lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: PDVLawset

- type: entity
  id: FreemanCircuitBoard
  parent: BaseElectronics
  name: law board (Freeman)
  description: An electronics board containing the Freeman lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: FreemanLawset

- type: entity
  id: EntertainerCircuitBoard
  parent: BaseElectronics
  name: law board (Entertainer)
  description: An electronics board containing the Entertainer lawset.
  components:
  - type: Sprite
    sprite: Objects/Misc/module.rsi
    state: std_mod
  - type: SiliconLawProvider
    laws: EntertainerLawset

# Items
- type: entity
  id: Intellicard
  name: intellicard
  description: A storage device for AIs.
  parent:
  - BaseItem
  - AiHolder
  suffix: Empty
  components:
  - type: ContainerComp
    proto: AiHeldIntellicard
    container: station_ai_mind_slot
  - type: Sprite
    sprite: Objects/Devices/ai_card.rsi
    layers:
    - state: base
    - state: full
      map: ["unshaded"]
      shader: unshaded
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.StationAiVisualState.Key:
        unshaded:
          Empty: { state: empty }
          Occupied: { state: full }
  - type: Intellicard

- type: entity
  id: PlayerStationAiPreview
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Mobs/Silicon/station_ai.rsi
    layers:
    - state: base
    - state: ai
      shader: unshaded

- type: entity
  id: PlayerStationAiEmpty
  name: AI Core
  description: The latest in Artificial Intelligences.
  parent:
  - BaseStructure
  - AiHolder
  suffix: Empty
  components:
  #- type: WarpPoint # Mono - comment out
  - type: ContainerComp
    proto: AiHeld
    container: station_ai_mind_slot
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: ApcPowerReceiver
    powerLoad: 1000
    needsPower: false # Mono
  - type: StationAiCore
  - type: StationAiVision
  - type: InteractionOutline
  - type: Sprite
    sprite: Mobs/Silicon/station_ai.rsi
    layers:
    - state: base
    - state: ai_empty
      map: ["unshaded"]
      shader: unshaded
  - type: Appearance
  - type: InteractionPopup
    interactSuccessString: petting-success-station-ai
    interactFailureString: petting-failure-station-ai
    messagePerceivedByOthers: petting-success-station-ai-others # Otherwise AI cannot tell its being pet as It's just a brain inside of the core, not the core itself.
    interactSuccessSound:
      path: /Audio/Ambience/Objects/periodic_beep.ogg
  - type: GenericVisualizer
    visuals:
      enum.StationAiVisualState.Key:
        unshaded:
          Empty: { state: ai_empty }
          Occupied: { state: ai }
  - type: Telephone
    compatibleRanges:
    - Grid
    - Map
    - Unlimited
    listeningRange: 0
    speakerVolume: Speak
    unlistedNumber: true
    requiresPower: false
  - type: Holopad
  - type: StationAiWhitelist
  - type: UserInterface
    interfaces:
        enum.HolopadUiKey.AiRequestWindow:
          type: HolopadBoundUserInterface
        enum.HolopadUiKey.AiActionWindow:
          type: HolopadBoundUserInterface

# The job-ready version of an AI spawn.
- type: entity
  id: PlayerStationAi
  parent: PlayerStationAiEmpty
  suffix: Job spawn
  components:
  - type: ContainerSpawnPoint
    containerId: station_ai_mind_slot
    job: StationAi
  - type: Sprite
    sprite: Mobs/Silicon/station_ai.rsi
    layers:
    - state: base
    - state: ai
      shader: unshaded

# The actual brain inside the core
- type: entity
  id: StationAiBrain
  parent: PositronicBrain
  categories: [ HideSpawnMenu, DoNotMap ]
  components:
  - type: Sprite
    # Once it's in a core it's pretty much an abstract entity at that point.
    visible: false
  - type: BlockMovement
    blockInteraction: false
  - type: SiliconLawProvider
    laws: Crewsimov
  - type: SiliconLawBound
  - type: ActionGrant
    actions:
    - ActionViewLaws
  - type: UserInterface
    interfaces:
      enum.SiliconLawsUiKey.Key:
        type: SiliconLawBoundUserInterface
        requireInputValidation: false
  - type: ComplexInteraction
  - type: Actions
  - type: Access
    groups:
    - AllAccess
  - type: Eye
    drawFov: false
  - type: ContentEye
    maxZoom: "4, 4"
  - type: Examiner
  - type: InputMover
  - type: Alerts
  - type: Speech
    speechVerb: Robotic
  - type: Tag
    tags:
    - HideContextMenu
    - StationAi
    - NoConsoleSound
  - type: StartingMindRole
    mindRole: "MindRoleSiliconBrain"
    silent: true

# Hologram projection that the AI's eye tracks.
- type: entity
  parent:
  - Incorporeal
  - BaseMob
  id: StationAiHolo
  name: AI eye
  description: The AI's viewer.
  categories: [ HideSpawnMenu, DoNotMap ]
  components:
  #- type: NoFTL # Mono - comment out
  #- type: WarpPoint # Mono - comment out
  #  follow: true
  - type: Eye
    pvsScale: 1.5
  - type: Visibility
    layer: 2
  - type: Sprite
    sprite: Mobs/Silicon/station_ai.rsi
    layers:
    - state: ai_camera
      shader: unshaded
      map: ["base"]

# The holographic representation of the AI that is projected from a holopad.
- type: entity
  id: StationAiHoloLocal
  name: AI hologram
  description: A holographic representation of an AI.
  categories: [ HideSpawnMenu, DoNotMap ]
  components:
  - type: Transform
    anchored: true
  #- type: WarpPoint # Mono - comment out
  #  follow: true
  - type: Eye
  - type: ContentEye
  - type: Examiner
  - type: Actions
  - type: Alerts
  - type: FTLSmashImmune
  - type: CargoSellBlacklist
  - type: StationAiVision
    range: 20

# Borgs
- type: entity
  id: PlayerBorgBattery
  parent: BorgChassisSelectable
  suffix: Battery
  components:
  - type: ContainerFill
    containers:
      borg_brain:
      - PositronicBrain
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellMedium
  - type: StartingMindRole
    mindRole: "MindRoleSiliconBrain"
    silent: true

- type: entity
  id: PlayerBorgSyndicateAssaultBattery
  parent: BorgChassisSyndicateAssault
  suffix: Battery, Module, Operative
  components:
  - type: NukeOperative
  - type: ContainerFill
    containers:
      borg_brain:
        - PositronicBrain
      borg_module:
        - BorgModuleOperative
        - BorgModuleL6C
        - BorgModuleEsword
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellHyper

- type: entity
  id: PlayerBorgSyndicateAssaultGhostRole
  parent: PlayerBorgSyndicateAssaultBattery
  suffix: Ghost role
  components:
    - type: GhostRole
      name: ghost-role-information-syndicate-cyborg-assault-name
      description: ghost-role-information-syndicate-cyborg-description
      rules: ghost-role-information-silicon-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable

- type: entity
  id: PlayerBorgSyndicateSaboteurBattery
  parent: BorgChassisSyndicateSaboteur
  suffix: Battery, Module, Operative
  components:
  - type: NukeOperative
  - type: ContainerFill
    containers:
      borg_brain:
        - PositronicBrain
      borg_module:
        - BorgModuleTool
        - BorgModuleOperative
        - BorgModuleSyndicateWeapon
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellHyper

- type: entity
  id: PlayerBorgSyndicateSaboteurGhostRole
  parent: PlayerBorgSyndicateSaboteurBattery
  suffix: Ghost role
  components:
    - type: GhostRole
      name: ghost-role-information-syndicate-cyborg-saboteur-name
      description: ghost-role-information-syndicate-cyborg-description
      rules: ghost-role-information-silicon-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable

- type: entity
  name: syndicate invasion borg spawner
  id: PlayerBorgSyndicateInvasionGhostRoleSpawner
  parent: MarkerBase
  components:
  - type: Sprite
    layers:
      - state: red
      - sprite: Structures/Decoration/banner.rsi
        state: banner_syndicate
  - type: RandomSpawner
    prototypes:
    - PlayerBorgSyndicateAssaultGhostRole
    - PlayerBorgSyndicateAssaultGhostRole # Saboteurs are kinda like cyborg medics, we want less.
    - PlayerBorgSyndicateSaboteurGhostRole

- type: entity
  id: PlayerBorgDerelict
  parent: BorgChassisDerelict
  suffix: Battery, Module
  components:
  - type: ContainerFill
    containers:
      borg_brain:
        - PositronicBrain
      borg_module:
        - BorgModuleTool
        # - BorgModuleFireExtinguisher # Frontier
        - BorgModuleJetpack # Frontier
        - BorgModuleGPS
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellHigh
  - type: RandomMetadata
    nameSegments: [NFNamesBorgUnlocalized] # Frontier: names_borg<NFNamesBorgUnlocalized

- type: entity
  id: PlayerBorgDerelictGhostRole
  parent: PlayerBorgDerelict
  suffix: Ghost role
  components:
    - type: GhostRole
      name: ghost-role-information-derelict-cyborg-name
      description: nf-ghost-role-information-derelict-cyborg-description # Frontier
      rules: ghost-role-information-silicon-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable
