# SPDX-FileCopyrightText: 2022 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 PopGamer46 <yt1popgamer@gmail.com>
# SPDX-FileCopyrightText: 2024 Spessmann <156740760+Spessmann@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 coolboy911 <85909253+coolboy911@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 lunarcomets <140772713+lunarcomets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Gansu <68031780+GansuLalan@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <ilyukarno@gmail.com>
# SPDX-FileCopyrightText: 2025 aa5g21 <aa5g21@soton.ac.uk>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: BaseItem
  id: BaseHandheldInstrument
  description: That's an instrument.
  components:
  - type: Sprite
    state: icon
  - type: Instrument
  - type: ActivatableUI
    inHandsOnly: false # Goobstation
    singleUser: true
    requireActiveHand: false # Goobstation
    verbText: verb-instrument-openui
    key: enum.InstrumentUiKey.Key
  - type: UserInterface
    interfaces:
      enum.InstrumentUiKey.Key:
        type: InstrumentBoundUserInterface
  - type: Item
    size: Normal
  - type: StaticPrice
    price: 200

#These are for instruments that are larger, can't be picked up, or have collision
- type: entity
  name: baseinstrument
  id: BasePlaceableInstrument
  parent: BaseStructureDynamic
  abstract: true
  components:
  - type: Instrument
  - type: ActivatableUI
    blockSpectators: true # otherwise they can play client-side music
    inHandsOnly: false
    singleUser: true
    requiresComplex: true
    verbText: verb-instrument-openui
    key: enum.InstrumentUiKey.Key
  - type: InteractionOutline
  - type: Sprite
    sprite: Objects/Fun/Instruments/structureinstruments.rsi
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: UserInterface
    interfaces:
      enum.InstrumentUiKey.Key:
        type: InstrumentBoundUserInterface
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.45
        density: 80
        mask:
        - Impassable
        - MidImpassable
        layer:
        - Opaque
        - MidImpassable
        - BulletImpassable
  - type: StaticPrice
    price: 300
  - type: RequireProjectileTarget

- type: entity
  parent: BasePlaceableInstrument
  id: BasePlaceableInstrumentRotatable
  name: baseinstrumentrotatable
  abstract: true
  components:
  - type: Rotatable
    rotateWhileAnchored: true
