- type: entity
  id: ResearchAndDevelopmentServer
  parent: [ BaseMachinePowered, ConstructibleMachine, StructureHealthMachineStrong ]
  name: R&D server
  description: Contains the collective knowledge of the station's scientists. Destroying it would send them back to the stone age. You don't want that do you?
  components:
  - type: Sprite
    sprite: Structures/Machines/server.rsi
    snapCardinals: true
    layers:
      - state: server-off
      - state: server-on
        visible: false
        map: ["enum.PowerDeviceVisualLayers.Powered"]
      - state: variant-research
      - state: server_o
        map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: PointLight
    enabled: false
    castShadows: false
    radius: 1.2
    energy: 3.0
    color: "#b211b2"
  - type: LitOnPowered
  - type: ResearchServer
  - type: TechnologyDatabase
    supportedDisciplines:
    - Industrial
    - Arsenal
    - Experimental
    - CivilianServices
  - type: ApcPowerReceiver
    powerLoad: 200
  - type: ExtensionCableReceiver
  - type: WiresPanel
  - type: WiresVisuals
  - type: Machine
    board: ResearchAndDevelopmentServerMachineCircuitboard
  - type: Damageable
    damageModifierSet: PlasmaMod
  - type: Destructible
    thresholds:
    - trigger: &DamageMachineStrong
        !type:DamageTrigger
        damage: 275
      behaviors:
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetPlasma1:
            min: 1
            max: 3
  - type: Appearance
  - type: GenericVisualizer
    visuals:
        enum.PowerDeviceVisuals.Powered:
          enum.PowerDeviceVisualLayers.Powered:
            True: {visible: true}
            False: {visible: false}
  - type: AmbientOnPowered
  - type: AmbientSound
    volume: -9
    range: 5
    enabled: false
    sound:
      collection: ServerFans
  - type: GuideHelp
    guides:
    - Science

- type: entity
  parent: [ BaseMachinePowered, StructureHealthMachineStrong ]
  id: BaseResearchAndDevelopmentPointSource
  name: "base R&D point source"
  # We should make this abstract once there are actual point sources.
  components:
  - type: Sprite
    sprite: Structures/Machines/rndpointsource.rsi
    layers:
    - state: rndpointsource-off
    - state: rndpointsource
      shader: unshaded
      map: ["enum.PowerDeviceVisualLayers.Powered"]
  - type: ResearchClient
  - type: ResearchPointSource
    pointspersecond: 25
    active: true
  - type: PointLight
    radius: 1.5
    energy: 3.0
    color: "#3db83b"
  - type: ActivatableUI
    key: enum.ResearchClientUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
      enum.ResearchClientUiKey.Key:
        type: ResearchClientBoundUserInterface
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.PowerDeviceVisuals.Powered:
        enum.PowerDeviceVisualLayers.Powered:
          True: {visible: true}
          False: {visible: false}
  - type: Damageable
    damageModifierSet: PlasteelMod
  - type: Destructible
    thresholds:
    - trigger: *DamageMachineStrong
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetPlasteel1:
            min: 1
            max: 5
  - type: GuideHelp
    guides:
    - Science
