# New Frontiers - This file is licensed under AGPLv3
# Copyright (c) 2024 New Frontiers Contributors
# See AGPLv3.txt for details.

# Ship vouchers, used to redeem for free ships!
- type: entity
  abstract: true
  parent: BaseItem
  id: BaseShipVoucher
  name: ship voucher
  description: Used for free shuttle rentals from a shipyard.
  components:
  - type: Sprite
    sprite: _NF/Objects/Misc/shipyard_voucher.rsi
  - type: Item
    size: Small
    heldPrefix: default
    storedRotation: -90
  - type: StationRecordKeyStorage # Assuming ships purchased on vouchers still need recordkeeping.
  - type: StaticPrice
    price: 0
  - type: CargoSellBlacklist
  - type: NFShipyardVoucher # FIXME - whitelist component to prevent misprediction

# NFSD vouchers
- type: entity
  parent: BaseShipVoucher
  id: ShipVoucherNfsdSergeant
  name: NFSD sergeant ship voucher
  description: Allows for one free small to medium NFSD ship purchase. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: nfsd
    - state: vouchersergeant
  - type: Item
    heldPrefix: nfsd
  - type: ShipyardVoucher
    destroyOnEmpty: true
    consoleType: Security
    access:
    - Sergeant # Frontier
    accessGroups: # Frontier
    - GeneralNfsdAccess # Frontier

- type: entity
  parent: ShipVoucherNfsdSergeant
  id: ShipVoucherNfsdBailiff
  name: NFSD bailiff ship voucher
  description: Allows for one free small to capital NFSD ship purchase. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: nfsd
    - state: voucherbailiff
  - type: ShipyardVoucher
    access:
    - Armory
    - Sergeant # Frontier
    - Bailiff # Frontier
    accessGroups: # Frontier
    - GeneralNfsdAccess # Frontier

# Frontier vouchers
- type: entity
  parent: BaseShipVoucher
  id: ShipVoucherFrontierJanitor
  name: janitor ship voucher
  description: Allows for one free janitorial ship purchase from the Frontier Staff Shipyard. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: blue
    - state: voucherjanitor
  - type: Item
    heldPrefix: blue
  - type: ShipyardVoucher
    destroyOnEmpty: true
    consoleType: Sr
    access:
    - Janitor

- type: entity
  parent: ShipVoucherFrontierJanitor
  id: ShipVoucherFrontierValet
  name: valet ship voucher
  description: Allows for one free valet ship purchase from the Frontier Staff Shipyard. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: blue
    - state: vouchervalet
  - type: ShipyardVoucher
    access:
    - Service

- type: entity
  parent: ShipVoucherFrontierJanitor
  id: ShipVoucherFrontierMailCarrier
  name: mail carrier ship voucher
  description: Allows for one free mail ship purchase from the Frontier Staff Shipyard. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: blue
    - state: vouchermailcarrier
  - type: ShipyardVoucher
    access:
    - Mail

- type: entity
  parent: ShipVoucherFrontierJanitor
  id: ShipVoucherFrontierGuard
  name: station guard ship voucher
  description: Allows for one free guard ship purchase from the Frontier Staff Shipyard. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: blue
    - state: voucherstationguard
  - type: ShipyardVoucher
    access:
    - Brig # odd, but potentially restricts cadets in lieu of a security guard-only access level

- type: entity
  parent: ShipVoucherFrontierJanitor
  id: ShipVoucherFrontierStc
  name: station traffic controller ship voucher
  description: Allows for one free tug ship purchase from the Frontier Staff Shipyard. Destroyed on sale.
  components:
  - type: Sprite
    layers:
    - state: blue
    - state: voucherstationtrafficcontroller
  - type: ShipyardVoucher
    access:
    - StationTrafficController
