- type: entity
  id: BaseStructureComputerTabletop
  parent: BaseStructure
  suffix: Tabletop
  abstract: true
  components:
    - type: Physics
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeAabb
            bounds: "-0.25,-0.35,0.25,0.35"
          density: 190
          mask:
            - TabletopMachineMask
          layer:
            - TabletopMachineLayer
    - type: InteractionOutline
    - type: Rotatable
    - type: Anchorable
    - type: Construction
      graph: ComputerTabletop
      node: tabletop computer
    - type: Sprite
      sprite: _NF/Structures/Machines/computer_tabletop.rsi
      drawdepth: SmallObjects
      layers:
        - map: [ "computerLayerBody" ]
          state: computer_tabletop
        - map: [ "computerLayerKeyboard" ]
          state: generic_keyboard_tabletop
        - map: [ "computerLayerScreen" ]
          sprite: Structures/Machines/computers.rsi
          state: generic
        - map: [ "computerLayerKeys" ]
          sprite: Structures/Machines/computers.rsi
          state: generic_keys
        - map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
          sprite: Structures/Machines/computers.rsi
          state: generic_panel_open
    - type: Damageable
      damageContainer: Inorganic
      damageModifierSet: Electronic
    - type: Destructible
      thresholds:
        - trigger:
            !type:DamageTrigger
            damage: 100
          behaviors:
            - !type:PlaySoundBehavior
              sound:
                collection: GlassBreak
            - !type:ChangeConstructionNodeBehavior
              node: monitorBroken
            - !type:DoActsBehavior
              acts: ["Destruction"]
    - type: StaticPrice
      price: 100

- type: entity
  parent: BaseStructureComputerTabletop
  id: ComputerTabletopFrame
  name: computer frame
  description: A computer under construction.
  components:
  - type: Construction
    graph: ComputerTabletop
    node: frameUnsecured
    containers:
      - board
  - type: Sprite
    drawdepth: SmallObjects
    sprite: _NF/Structures/Machines/computer_tabletop.rsi
    layers:
    - state: computer_tabletop_frame
      map: [ "enum.ConstructionVisuals.Layer" ]
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ConstructionVisuals.Key:
        enum.ConstructionVisuals.Layer:
          frameUnsecured: { state: computer_tabletop_frame }
          boardUnsecured: { state: computer_board_exposed }
          missingWires: { state: computer_tabletop }
          monitorMissing: { state: computer_no_monitor }
          monitorUnsecured: { state: computer_monitor_unscrewed }
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 60
        mask:
        - Impassable
        - LowImpassable

- type: entity
  parent: ComputerBroken
  id: ComputerTabletopBroken
  suffix: Tabletop
  components:
  - type: Sprite
    drawdepth: SmallObjects
    sprite: _NF/Structures/Machines/computer_tabletop.rsi
    state: broken_tabletop
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 60
        mask:
        - Impassable
        - LowImpassable

- type: entity
  parent: BaseStructureComputerTabletop
  id: ComputerTabletop
  name: tabletop computer
  description: This is a computer that could go on a table. It's a tabletop computer. Not for use on other surfaces.
