# Misc electronic trigger devices.
# TODO:
# - proximity
# - voice
# - machine linking
# - device network
# - biometric/health (maybe just via device nets?)
# - booby-trap / on-storage-open

- type: entity
  parent: BaseItem
  id: TimerTrigger
  name: timer trigger
  description: A configurable timer.
  components:
  - type: Sprite
    sprite: Objects/Devices/timer.rsi
    state: timer
  - type: Item
    size: Tiny
  - type: StaticPrice
    price: 40
  - type: PayloadTrigger
    components:
    - type: TriggerOnUse
      keyOut: startTimer
    - type: TimerTrigger
      keysIn:
      - startTimer
      # use the default trigger key so it can activate any inserted payload
      keyOut: trigger
      delay: 5
      delayOptions: [3, 5, 10, 15, 30]
      initialBeepDelay: 0
      beepSound:
        path: /Audio/Machines/Nuke/general_beep.ogg
        params:
          volume: -2

- type: entity
  parent: TimerTrigger
  id: SignalTrigger
  name: signal trigger
  description: Adds a machine link that is triggered by signals.
  components:
  - type: Sprite
    sprite: Objects/Devices/signaltrigger.rsi
    state: signaltrigger
  - type: StaticPrice
    price: 40
  - type: Tag
    tags:
    - SignalTrigger
  - type: PayloadTrigger
    components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: BasicDevice
    - type: WirelessNetworkConnection
      range: 200
    - type: DeviceLinkSink
    - type: TriggerOnSignal
      keyOut: startTimer
    - type: TimerTrigger
      keysIn:
      - startTimer
      # use the default trigger key so it can activate any inserted payload
      keyOut: trigger
      delay: 3
      initialBeepDelay: 0
      beepSound:
        path: /Audio/Machines/Nuke/general_beep.ogg
        params:
          volume: -2

- type: entity
  parent: BaseItem
  id: VoiceTrigger
  name: voice trigger
  description: Adds a machine link that is triggered by vocal keywords.
  components:
  - type: Item
    size: Tiny
  - type: Sprite
    sprite: Objects/Devices/voice.rsi
    state: voice
  - type: StaticPrice
    price: 40
  - type: Tag
    tags:
    - VoiceTrigger
  - type: PayloadTrigger
    components:
    - type: TriggerOnVoice
