# SPDX-FileCopyrightText: 2018 clusterfack <8516830+clusterfack@users.noreply.github.com>
# SPDX-FileCopyrightText: 2018 clusterfack <clusterfack@users.noreply.github.com>
# SPDX-FileCopyrightText: 2019 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2019 ScumbagDog <33865465+ScumbagDog@users.noreply.github.com>
# SPDX-FileCopyrightText: 2019 Swept <49448379+SweptWasTaken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Clyybber <darkmine956@gmail.com>
# SPDX-FileCopyrightText: 2020 DmitriyRubetskoy <75271456+DmitriyRubetskoy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 DmitriyRubetskoy <rubetskoy234@mail.ru>
# SPDX-FileCopyrightText: 2020 Exp <theexp111@gmail.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Remie Richards <remierichards@gmail.com>
# SPDX-FileCopyrightText: 2020 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 20kdc <asdd2808@gmail.com>
# SPDX-FileCopyrightText: 2021 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Ygg01 <y.laughing.man.y@gmail.com>
# SPDX-FileCopyrightText: 2021 mirrorcult <notzombiedude@gmail.com>
# SPDX-FileCopyrightText: 2021 py01 <60152240+collinlunn@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 py01 <pyronetics01@gmail.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 CommieFlowers <rasmus.cedergren@hotmail.com>
# SPDX-FileCopyrightText: 2022 Kara D <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Alekshhh <44923899+Alekshhh@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 HerCoyote23 <131214189+HerCoyote23@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 I.K <45953835+notquitehadouken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TaralGit <76408146+TaralGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Tunguso4ka <71643624+Tunguso4ka@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 and_a <and_a@DESKTOP-RJENGIR>
# SPDX-FileCopyrightText: 2023 drteaspoon420 <87363733+drteaspoon420@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2023 notquitehadouken <1isthisameme>
# SPDX-FileCopyrightText: 2023 stopbreaking <126102320+stopbreaking@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Hanz <41141796+Hanzdegloker@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Preston Smith <92108534+thetolbean@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 starch <starchpersonal@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Eagle <lincoln.mcqueen@gmail.com>
# SPDX-FileCopyrightText: 2025 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 VMSolidus <evilexecutive@gmail.com>
# SPDX-FileCopyrightText: 2025 fishbait <gnesse@gmail.com>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
# SPDX-FileCopyrightText: 2025 vanx <61917534+Vaaankas@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: spear
  parent: [BaseItem, BaseMinorContraband]
  id: Spear
  description: Definition of a Classic. Keeping murder affordable since 200,000 BCE.
  components:
  - type: EmbeddableProjectile
    offset: -0.15,0.0
  - type: ThrowingAngle
    angle: 225
  - type: LandAtCursor
  - type: Tag
    tags:
    - Spear
  - type: Fixtures
    fixtures:
      fix1:
        shape: !type:PolygonShape
          vertices:
            - -0.08,-0.06 # Goob edit
            - -0.06,-0.08 # Goob edit
            - 0.40,0.30
            - 0.30,0.40
        density: 20
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2
  - type: Sharp
  - type: Sprite
    sprite: Objects/Weapons/Melee/spear.rsi
    layers:
    - state: spear
    - state: spear1
      map: ["enum.SolutionContainerLayers.Fill"]
      visible: false
  - type: MeleeWeapon
    canWideSwing: false # Goob
    range: 2.2 # Goob
    attackRate: 0.8 # Goob
    animationRotation: -135 # WWDP
    wideAnimationRotation: -135
    damage:
      types:
        Piercing: 12
    angle: 0
    animation: WeaponArcThrust
    soundHit:
      path: /Audio/Weapons/bladeslice.ogg
  - type: DamageOtherOnHit
    damage:
      types:
        Piercing: 24 # Goob edit
  - type: Item
    size: Large # Goob edit
    shape: # Goob
    - 0,0,8,0
    storedRotation: 45 # Goob
  - type: Clothing
    quickEquip: false
    slots:
    - back
    - suitStorage
  - type: Construction
    graph: Spear
    node: spear
  - type: SolutionContainerManager
    solutions:
      melee:
        maxVol: 5 # Goobstation
  - type: MeleeChemicalInjector
    transferAmount: 1 # Goobstation
    solution: melee
  - type: RefillableSolution
    solution: melee
  - type: InjectableSolution
    solution: melee
  - type: SolutionInjectOnEmbed
    transferAmount: 2
    solution: melee
  - type: SolutionTransfer
    maxTransferAmount: 2
  - type: Wieldable
  - type: IncreaseDamageOnWield
    damage:
      types:
        Piercing: 6 # Goob edit
  # Goobstation - nuh uh
  #- type: Damageable
  #  damageContainer: Inorganic
  #- type: Destructible
  #  thresholds:
  #  - trigger:
  #      !type:DamageTrigger
  #      damage: 40 # Goob edit, excess damage avoids cost of spawning entities.
  #    behaviors:
  #    - !type:DoActsBehavior
  #      acts: [ "Destruction" ]
  #  - trigger:
  #      !type:DamageTrigger
  #      damage: 20
  #    behaviors:
  #    - !type:PlaySoundBehavior
  #      sound:
  #        collection: GlassBreak
  #        params:
  #          volume: -4
  #    - !type:SpawnEntitiesBehavior
  #      spawn:
  #        PartRodMetal1:
  #          min: 1
  #          max: 1
  #    - !type:DoActsBehavior
  #      acts: [ "Destruction" ]
  #- type: DamageOnLand
  #  damage:
  #    types:
  #      Blunt: 5
  - type: UseDelay
  - type: Appearance
  - type: SolutionContainerVisuals
    maxFillLevels: 1
    fillBaseName: spear
    inHandsFillBaseName: -fill-
    inHandsMaxFillLevels: 1
    equippedFillBaseName: -fill-
    equippedMaxFillLevels: 1
  - type: ThrowableBlocked # Goobstation
  - type: UndetectableContraband #Goobstation-Contraband detector


- type: entity
  name: reinforced spear
  parent: Spear
  id: SpearReinforced
  description: A spear with a reinforced glass shard as a tip.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/reinforced_spear.rsi
  - type: MeleeWeapon
    animationRotation: -135 # WWDP
    wideAnimationRotation: -135
    damage:
      types:
        Piercing: 15
  - type: DamageOtherOnHit
    damage:
      types:
        Piercing: 30 # Goob edit
  - type: Construction
    graph: SpearReinforced

- type: entity
  name: plasma spear
  parent: Spear
  id: SpearPlasma
  description: A spear with a plasma shard as a tip.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/plasma_spear.rsi
  - type: MeleeWeapon
    animationRotation: -135 # WWDP
    wideAnimationRotation: -135
    damage:
      types:
        Piercing: 18
  - type: DamageOtherOnHit
    damage:
      types:
        Piercing: 36 # Goob edit
  - type: Construction
    graph: SpearPlasma

- type: entity
  name: uranium spear
  parent: Spear
  id: SpearUranium
  description: A spear with a uranium shard as a tip.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/uranium_spear.rsi
  - type: MeleeWeapon
    animationRotation: -135 # WWDP
    wideAnimationRotation: -135
    damage:
      types:
        Piercing: 10
        Radiation: 8
  - type: DamageOtherOnHit
    damage:
      types:
        Piercing: 24 # Goob edit
        Radiation: 12 # Goob edit
  - type: Construction
    graph: SpearUranium

- type: entity
  name: bone spear
  parent: Spear
  id: SpearBone
  description: A spear made of bones.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/bone_spear.rsi
  - type: Construction
    graph: SpearBone
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 40 # Goob edit, excess damage avoids cost of spawning entities.
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
          params:
            volume: -4
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialBones1:
            min: 1
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

- type: entity
  name: sharkminnow tooth spear
  parent: Spear 
  id: SpearSharkMinnow
  description: A spear with a sharkminnow tooth as a tip.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/sharkminnow_spear.rsi
  - type: MeleeWeapon
    wideAnimationRotation: -135
    damage:
      types:
        Piercing: 20 #goobedit - buff spear variant, nerf tooth.
  - type: DamageOtherOnHit
    damage:
      types:
        Piercing: 30 #goobedit - buff spear variant, nerf tooth.
  - type: Construction
    graph: SpearSharkMinnow
