- type: entity
  name: shipyard console
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, BaseComputer]
  id: ComputerShipyardBase
  description: Used to purchase and sell shuttles
  abstract: true
  components:
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard
    - map: ["computerLayerKeys"]
      state: telesci_key
  - type: ShipyardConsole
    targetIdSlot:
      name: id-card-console-target-id
      ejectSound: /Audio/Machines/id_swipe.ogg
      insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
      ejectOnBreak: true
      swap: true
      whitelist:
        components:
        - IdCard
        - ShipyardVoucher
    newAccessLevels: [Captain]
  - type: ActivatableUI
    singleUser: true
    key: enum.ShipyardConsoleUiKey.Shipyard
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Shipyard:
        type: ShipyardConsoleBoundUserInterface
  - type: ItemSlots
  - type: ContainerContainer
    containers:
      board: !type:Container
      ShipyardConsole-targetId: !type:ContainerSlot
  - type: Computer
    board: Null

# Concrete consoles
- type: entity
  parent: ComputerShipyardBase
  id: ComputerShipyard
  components:
  - type: ShipyardConsole
    newJobTitle: job-name-captain

- type: entity
  id: ComputerShipyardSecurity
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyardBase]
  name: security shipyard console
  description: Used to enlist into Nanotrasen Security Forces
  components:
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_security
    - map: ["computerLayerKeys"]
      state: telesci_key
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Security
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Security:
        type: ShipyardConsoleBoundUserInterface
  - type: ShipyardConsole
    shipyardChannel: Nfsd
    newAccessLevels: [Captain, Security, Brig]

- type: entity
  id: ComputerShipyardNfsd
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyardBase]
  name: NFSD shipyard console
  description: Used to buy NFSD patrol vessels.
  components:
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_nfsd
    - map: ["computerLayerKeys"]
      state: telesci_key
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Security
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Security:
        type: ShipyardConsoleBoundUserInterface
  - type: ShipyardConsole
    shipyardChannel: Nfsd
    newAccessLevels: [Captain, Security, Brig]

- type: entity
  id: ComputerShipyardSyndicate
  parent: [BaseStructureDisableToolUse, BaseStructureDestructible, ComputerShipyardBase]
  name: syndicate shipyard console
  description: Used to buy ships not available through other means.
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Syndicate
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Syndicate:
        type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_blackmarket
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_blackmarket
    - map: ["computerLayerKeys"]
      state: blackmarket_key
  - type: ShipyardConsole
    shipyardChannel: Syndicate
    #secretShipyardChannel: Nfsd #Find out via communicating with other players
    taxAccounts:
      Invalid: 0.30
    ignoreBaseSaleRate: true # Fixed 70% sale rate.
    canTransferDeed: false

- type: entity
  id: ComputerShipyardBlackMarket
  parent: [BaseStructureDisableToolUse, BaseStructureDestructible, ComputerShipyardBase]
  name: black market shipyard console
  description: Used to buy ill-gotten vesssels for nefarious purposes.
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.BlackMarket
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.BlackMarket:
        type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_blackmarket
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_blackmarket
    - map: ["computerLayerKeys"]
      state: blackmarket_key
  - type: ShipyardConsole
    shipyardChannel: Freelance
    #secretShipyardChannel: Nfsd #Find out via communicating with other players
    taxAccounts:
      Invalid: 0.30
    ignoreBaseSaleRate: true # Fixed 70% sale rate.
    canTransferDeed: false
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 250
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:ChangeConstructionNodeBehavior
        node: start
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Construction
    graph: ComputerShipyardBlackMarket
    node: repaired

- type: entity
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerBroken]
  id: ComputerShipyardBlackMarketBroken
  name: broken black market shipyard console
  description: This console has seen better days. Can be repaired with a repair kit.
  components:
  - type: Construction
    graph: ComputerShipyardBlackMarket
    node: start

- type: entity
  id: ComputerShipyardExpedition
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyard]
  name: expedition shipyard console
  description: Used to buy ships outfitted for planetary expeditions.
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Expedition
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Expedition:
       type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_expedition
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard
    - map: ["computerLayerKeys"]
      state: telesci_key

- type: entity
  id: ComputerShipyardScrap
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyard]
  name: scrapyard console
  description: Used to purchase and sell "shuttles".
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Scrap
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Scrap:
        type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_scrap
    - map: ["computerLayerKeyboard"]
      state: scrap_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_scrap
    - map: ["computerLayerKeys"]
      state: scrap_key

- type: entity
  id: ComputerShipyardMedical
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyard]
  name: medical shipyard console
  description: Used to purchase and sell medical shuttles
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Medical
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Medical:
        type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_medical
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_medical
    - map: ["computerLayerKeys"]
      state: telesci_key

- type: entity
  id: ComputerShipyardSr
  parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, ComputerShipyardBase]
  name: frontier staff shipyard console
  description: Used to buy vessels exclusive to Frontier Outpost personnel.
  components:
  - type: ActivatableUI
    key: enum.ShipyardConsoleUiKey.Sr
  - type: UserInterface
    interfaces:
      enum.ShipyardConsoleUiKey.Sr:
        type: ShipyardConsoleBoundUserInterface
  - type: Sprite
    sprite: _NF/Structures/Machines/computers.rsi
    layers:
    - map: ["computerLayerBody"]
      state: computer_sr
    - map: ["computerLayerKeyboard"]
      state: generic_keyboard
    - map: ["computerLayerScreen"]
      state: shipyard_sr
    - map: ["computerLayerKeys"]
      state: telesci_key
