# SPDX-FileCopyrightText: 2024 Armok <155400926+ARMOKS@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 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseHardlightArrow
  abstract: true
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Weapons/Guns/Bow/arrow.rsi
    state: icon
    shader: unshaded
  - type: Physics
    bodyType: Dynamic
    linearDamping: 0
    angularDamping: 0
  - type: Reflective
    reflective:
    - Energy
  - type: Fixtures
    fixtures:
      projectile:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.1,-0.2,0.1,0.2"
        hard: false
        mask:
        - Opaque
  - type: Ammo
    muzzleFlash: null
  - type: Projectile
    deleteOnCollide: false
    onlyCollideWhenShot: true
    damage:
      types:
        Heat: 45
  - type: TimedDespawn
    lifetime: 10
  - type: PointLight
    color: white
    radius: 1.5
    energy: 1.5

- type: entity
  id: BaseHardlightEmbeddableArrow
  parent: BaseItem
  abstract: true
  components:
  - type: Item
    size: Small
  - type: EmbeddableProjectile
    sound: /Audio/Weapons/star_hit.ogg
    embedOnThrow: false
    deleteOnRemove: true
  - type: ThrowingAngle
    angle: 0

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowEnergy
  name: energy arrow
  description: An arrow made from hardlight.
  components:
  - type: Sprite
    color: "#FFB200"
  - type: PointLight
    color: "#FFB200"

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowDisabler
  name: disabler arrow
  description: An arrow made from hardlight. This one stuns the victim in a non-lethal way.
  components:
  - type: Sprite
    color: "#00B2FF"
  - type: PointLight
    color: "#00B2FF"
  - type: Projectile
    damage:
      types:
        Heat: 0
  - type: StaminaDamageOnCollide
    damage: 60
    overtime: 30

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowFiery
  name: fiery arrow
  description: An arrow made from hardlight. This one burns the victim.
  components:
  - type: Sprite
    color: red
  - type: PointLight
    color: red
  - type: Projectile
    damage:
      types:
        Heat: 15
  - type: IgniteOnCollide
    fireStacks: 4

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowFreeze
  name: freezing arrow
  description: An arrow made from hardlight. This one freezes the victim.
  components:
  - type: Sprite
    color: blue
  - type: PointLight
    color: blue
  - type: Projectile
    damage:
      types:
        Cold: 10
  - type: ChangeTemperatureOnCollide
    heat: -600000

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowExplosive
  name: explosive arrow
  description: An arrow made from hardlight. This one explodes on hit, but the energy dissapates quickly, it wont fly very far.
  components:
  - type: Sprite
    color: "#7300FF"
  - type: PointLight
    color: "#7300FF"
  - type: Projectile
    damage:
      types:
        Heat: 0
  - type: TimedDespawn
    lifetime: 0.7
  - type: TriggerOnCollide
    fixtureID: projectile
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    totalIntensity: 18
    intensitySlope: 0.6
    maxIntensity: 6
    canCreateVacuum: false

- type: entity
  parent: BaseHardlightArrow
  id: ArrowXray
  name: x-ray arrow
  description: An arrow made from hardlight. This one pierces through everything.
  components:
  - type: Sprite
    color: "#1AE51A"
  - type: PointLight
    color: "#1AE51A"
  - type: Projectile
    penetrate: true
    noPenetrateMask:
    - BlobImpassable
    damage:
      types:
        Heat: 30
  - type: Fixtures
    fixtures:
      projectile:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.1,-0.2,0.1,0.2"
        hard: false
        mask:
        - Opaque
  - type: TimedDespawn
    lifetime: 0.7

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowBee
  name: bee arrow
  description: An arrow made from hardlight. This one summons angry bees.
  components:
  - type: Sprite
    color: yellow
  - type: PointLight
    color: yellow
  - type: Projectile
    damage:
      types:
        Heat: 0
  - type: SpawnEntitiesOnHit
    spawnOnlyIfHitMob: true
    proto: MobAngryBeeWeak
    amount: 8
    collideIgnoreEntities:
    - MobBee
    - MobAngryBee
    - MobSyndieAngryBee
    - MobAngryBeeWeak

- type: entity
  parent: [BaseHardlightArrow, BaseHardlightEmbeddableArrow]
  id: ArrowIon
  name: ion arrow
  description: An arrow made from hardlight. causes EMP on hit.
  components:
  - type: Sprite
    color: silver
  - type: PointLight
    color: silver
  - type: Projectile
    damage:
      types:
        Ion: 60
  - type: TriggerOnCollide
    fixtureID: projectile
  - type: EmpOnTrigger
    range: 1
    energyConsumption: 360
    disableDuration: 5
