# SPDX-FileCopyrightText: 2023 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2023 drteaspoon420 <87363733+drteaspoon420@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Boaz1111 <149967078+Boaz1111@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 superjj18 <gagnonjake@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseItem
  id: BaseArrow
  abstract: true
  components:
  - type: Item
    size: Small
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi
  - type: Fixtures
    fixtures:
      fix1:
        shape: !type:PhysShapeCircle
          radius: 0.2
        density: 5
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2
      projectile:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.1,-0.3,0.1,-0.1"
        hard: false
        mask:
        - Impassable
        - BulletImpassable
  - type: EmbeddableProjectile
    sound: /Audio/Weapons/star_hit.ogg
    embedOnThrow: false
  - type: ThrowingAngle
    angle: 0
  - type: Ammo
    muzzleFlash: null
  - type: Tag
    tags:
    - Arrow
  - type: Projectile
    deleteOnCollide: false
    onlyCollideWhenShot: true
    damage:
      types:
        Piercing: 25
  - type: SolutionContainerManager
    solutions:
      ammo:
        maxVol: 2
  - type: RefillableSolution
    solution: ammo
  - type: InjectableSolution
    solution: ammo
  - type: SolutionInjectOnEmbed
    transferAmount: 2
    solution: ammo
  - type: SolutionTransfer
    maxTransferAmount: 2
  - type: Appearance
  - type: SolutionContainerVisuals
    maxFillLevels: 1
    fillBaseName: solution


- type: entity
  parent: BaseArrow
  id: ArrowRegular
  name: arrow
  description: You can feel the power of the steppe within you.
  components:
  - type: Sprite
    layers:
    - state: tail
      color: red
    - state: rod
      color: brown
    - state: tip
    - state: solution1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: Projectile
    damage:
      types:
        Piercing: 35

- type: entity
  parent: BaseArrow
  id: ArrowImprovised
  name: glass shard arrow
  description: The greyshirt's preferred projectile.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi
    layers:
    - state: tail
      color: white
    - state: rod
      color: darkgray
    - state: tip
      color: lightblue
    - state: solution1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: Projectile
    damage:
      types:
        Piercing: 25
  - type: Construction
    graph: ImprovisedArrow
    node: ImprovisedArrow

- type: entity
  parent: BaseArrow
  id: ArrowImprovisedPlasma
  name: plasma glass shard arrow
  description: The greyshirt's preferred projectile. Now with extra lethality!
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi
    layers:
    - state: tail
      color: white
    - state: rod
      color: darkgray
    - state: tip
      color: purple
    - state: solution1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: Projectile
    damage:
      types:
        Piercing: 30
  - type: Construction
    graph: ImprovisedArrowPlasma
    node: ImprovisedArrowPlasma

- type: entity
  parent: BaseArrow
  id: ArrowImprovisedUranium
  name: uranium glass shard arrow
  description: The greyshirt's preferred projectile. Now with added radiation!
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi
    layers:
    - state: tail
      color: white
    - state: rod
      color: darkgray
    - state: tip
      color: green
    - state: solution1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: Projectile
    damage:
      types:
        Piercing: 25
        Radiation: 5
  - type: Construction
    graph: ImprovisedArrowUranium
    node: ImprovisedArrowUranium

- type: entity
  parent: BaseArrow
  id: ArrowImprovisedCarp
  name: carp tooth arrow
  description: The salvager's preferred arrow. Kill your enemies with the teeth of their families.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi
    layers:
    - state: tail
      color: purple
    - state: rod
      color: darkgray
    - state: tip
      color: white
    - state: solution1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: Projectile
    damage:
      types:
        Piercing: 30
  - type: Construction
    graph: ImprovisedArrowCarp
    node: ImprovisedArrowCarp
