# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Subversionary <109166122+Subversionary@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <aviu00@protonmail.com>
# SPDX-FileCopyrightText: 2025 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 pubbi <63283968+impubbi@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Goob edit - energy bola

- type: entity
  name: bola
  parent: [BaseItem, BaseSecurityContraband]
  id: BaseBola
  description: Linked together with some spare cuffs and metal.
  abstract: true
  components:
  - type: Item
    size: Normal
  - type: Sprite
    sprite: Objects/Weapons/Throwable/bola.rsi
    state: icon
  - type: EmitSoundOnThrow
    sound: /Audio/Weapons/bolathrow.ogg
  - type: EmitSoundOnLand
    sound: /Audio/Effects/snap.ogg
  - type: LandAtCursor
  - type: Ensnaring
    freeTime: 2.0
    breakoutTime: 3.5 #all bola should generally be fast to remove
    walkSpeed: 0.7 #makeshift bola shouldn't slow too much
    sprintSpeed: 0.7
    staminaDamage: 0
    canThrowTrigger: true
    canMoveBreakout: true
    maxEnsnares: 1
  - type: ThrowableBlocked
  - type: CombatDoAfter
    trigger: !type:CombatDoAfterThrownEvent
    delay: 1.5
    dropCancelDelay: 0.005

- type: entity
  name: bola
  parent: BaseBola
  id: Bola
  components:
  - type: Construction
    graph: Bola
    node: bola
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 75
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    damage:
      types:
        Blunt: 5
  - type: ThrowableBlocked
    behavior: Damage
    damage:
      types:
        Blunt: 15

- type: entity
  name: energy bola
  description: A specialized hardlight bola designed to ensnare fleeing criminals and aid in arrests.
  parent: BaseBola
  id: BolaEnergy
  components:
  - type: Item
    size: Small
  - type: Sprite
    sprite: _Goobstation/Objects/Weapons/Throwable/energy_bola.rsi
  - type: Ensnaring
    freeTime: 2.0
    breakoutTime: 3.5 #all bola should generally be fast to remove
    walkSpeed: 0.5 #makeshift bola shouldn't slow too much
    sprintSpeed: 0.5
    staminaDamage: 0 # anything but this is gamebreaking
    canThrowTrigger: true
    canMoveBreakout: true
    destroyOnRemove: true
    maxEnsnares: 1
  - type: Tag
    tags:
    - BolaEnergy
  - type: LandAtCursor
  - type: Fixtures
    fixtures:
      fix1:
        shape: !type:PhysShapeCircle
          radius: 0.4
        density: 20 # derived from base_item
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2
