# Monolith : Gunnery Server
- type: entity
  id: GunneryServerBase
  parent: BaseMachinePowered
  abstract: true
  name: gunnery control server
  description: Manages the remote operation of ship weapons.
  components:
  - type: Sprite
    sprite: _Mono/Structures/Machines/tele_bus.rsi
    snapCardinals: true
    layers:
    - state: icon
    - state: unlit
      shader: unshaded
      map: ["enum.PowerDeviceVisualLayers.Powered"]
  - type: ExtensionCableReceiver
  - type: Appearance
  - type: AmbientOnPowered
  - type: AmbientSound
    volume: -9
    range: 5
    sound:
      path: /Audio/Ambience/Objects/server_fans.ogg
  - type: GenericVisualizer
    visuals:
      enum.PowerDeviceVisuals.Powered:
        enum.PowerDeviceVisualLayers.Powered:
          True: { visible: true }
          False: { visible: false }
  - type: Construction # Mono
    graph: Machine
    node: machine
    containers:
      - machine_board
      - machine_parts
  - type: ContainerContainer # Mono
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
  - type: ExaminableBattery
  - type: BatterySelfRecharger
  - type: StaticPrice
    price: 100
  - type: ActivatableUI
    key: enum.PowerChargeUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
      enum.PowerChargeUiKey.Key:
        type: PowerChargeBoundUserInterface
  - type: WiresPanel
  # Low power stats by default
  - type: ApcPowerReceiver
    powerLoad: 500
  - type: PowerCharge
    windowTitle: gravity-generator-window-title
    idlePower: 50
    activePower: 500
    chargeRate: 0.05 # 20 seconds, just to save from power flickering

- type: entity
  id: GunneryServerLow
  parent: GunneryServerBase
  name: low-power gunnery control server
  components:
  - type: Machine
    board: MachineGCSLowCircuitboard
  - type: FireControlServer
    processingPower: 8

- type: entity
  id: GunneryServerMedium
  parent: GunneryServerBase
  name: medium-power gunnery control server
  components:
  - type: Machine
    board: MachineGCSMediumCircuitboard
  - type: FireControlServer
    processingPower: 14
  - type: ApcPowerReceiver
    powerLoad: 1250
  - type: PowerCharge
    idlePower: 100
    activePower: 1250
    chargeRate: 0.025 # 40 seconds

- type: entity
  id: GunneryServerHigh
  parent: GunneryServerBase
  name: high-power gunnery control server
  components:
  - type: Machine
    board: MachineGCSHighCircuitboard
  - type: FireControlServer
    processingPower: 20
  - type: ApcPowerReceiver
    powerLoad: 2500
  - type: PowerCharge
    idlePower: 500
    activePower: 2500
    chargeRate: 0.016 # ~1 minute

- type: entity
  id: GunneryServerUltra
  parent: [GunneryServerBase]
  name: ultra-high-power gunnery control server
  components:
  - type: Machine
    board: MachineGCSUltraCircuitboard
  - type: FireControlServer
    processingPower: 30
  - type: ApcPowerReceiver
    powerLoad: 5000
  - type: PowerCharge
    windowTitle: gravity-generator-window-title
    idlePower: 1000
    activePower: 5000
    chargeRate: 0.008 # ~2 minutes

# Monolith : Gunnery Computer
- type: entity
  parent: BaseComputerAiAccess
  id: ComputerGunneryConsole
  name: gunnery control console
  description: Interfaces with the gunnery control server to operate ship weapons.
  placement:
    mode: SnapgridCenter
  components:
  - type: ApcPowerReceiver
    powerLoad: 200
  - type: ExtensionCableReceiver
  - type: ActivatableUIRequiresPower
  - type: Sprite
    sprite: _Mono/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_not_rot
    - map: ["computerLayerKeyboard"]
      state: gunnery_keyboard
    - map: ["computerLayerScreen"]
      state: gunnery_screen
    - map: ["computerLayerKeys"]
      state: gunnery_keys
    - map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
      state: generic_panel_open
  - type: FireControlConsole
  - type: ActivatableUI
    key: enum.FireControlConsoleUiKey.Key
  - type: UserInterface
    interfaces:
        enum.FireControlConsoleUiKey.Key:
          type: FireControlConsoleBoundUserInterface
          requireInputValidation: false
        enum.WiresUiKey.Key:
          type: WiresBoundUserInterface
  - type: RadarConsole
    maxRange: 768 # Mono
  - type: WorldLoader
    radius: 384 # Mono
  - type: Computer
    board: GunneryControlComputerCircuitboard
  - type: PointLight
    radius: 1.5
    energy: 1.6
    color: "#ff8400"
