# SPDX-FileCopyrightText: 2020 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2020 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2020 Peter Wedder <burneddi@gmail.com>
# SPDX-FileCopyrightText: 2020 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Kara D <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2021 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <gradientvera@outlook.com>
# SPDX-FileCopyrightText: 2022 Kara <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 lapatison <100279397+lapatison@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2023 AsikKEsel <115815982+AsikKEsel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TaralGit <76408146+TaralGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 and_a <and_a@DESKTOP-RJENGIR>
# SPDX-FileCopyrightText: 2023 deltanedas <user@zenith>
# SPDX-FileCopyrightText: 2023 liltenhead <104418166+liltenhead@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Adeinitas <147965189+adeinitas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hmeister <nathan.springfredfoxbon4@gmail.com>
# SPDX-FileCopyrightText: 2024 MACMAN2003 <macman2003c@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 Scribbles0 <91828755+Scribbles0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SoulFN <164462467+SoulFN@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Timemaster99 <57200767+Timemaster99@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 VMSolidus <evilexecutive@gmail.com>
# SPDX-FileCopyrightText: 2024 Verm <32827189+Vermidia@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@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 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: BaseItem
  id: ShardBase
  description: It's a shard of some unknown material.
  components:
  - type: Sharp
  - type: Execution
    doAfterDuration: 4.0
  - type: Sprite
    layers:
      - sprite: Objects/Materials/Shards/shard.rsi
        state: shard1
        map: [ "enum.DamageStateVisualLayers.Base" ]
  - type: RandomSprite
    available:
      - enum.DamageStateVisualLayers.Base:
          shard1: ""
          shard2: ""
          shard3: ""
  - type: MeleeWeapon
    attackRate: 1
    damage:
      types:
        Slash: 3.5
  - type: Item
    sprite: Objects/Materials/Shards/shard.rsi
    size: Tiny
  - type: CollisionWake
    enabled: false
  - type: Fixtures
    fixtures:
      slips:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.2,-0.2,0.2,0.2"
        hard: false
        layer:
        - LowImpassable
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.2,-0.2,0.2,0.2"
        density: 30
        mask:
        - ItemMask
  - type: DamageOtherOnHit
    damage:
      types:
        Slash: 2
  - type: EmbeddableProjectile # Goobstation - Make shards embeddable so spacewind doesnt massacre the entire station :-)
    sound: /Audio/Weapons/bladeslice.ogg
  - type: Tag
    tags:
    - Trash
  - type: SpaceGarbage
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Glass
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: StepTrigger
    intersectRatio: 0.2
    triggerGroups: # Goobstation
      types:
      - Shard
  - type: PreventableStepTrigger
  - type: Slippery
    slipSound:
      path: /Audio/Effects/glass_step.ogg
    slipData:
      launchForwardsMultiplier: 0
  - type: TriggerOnStepTrigger
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 5
  - type: DeleteOnTrigger
  - type: StaticPrice
    price: 0
  - type: Scalpel # Shitmed
    speed: 0.45
  - type: ThrowableBlocked # Goobstation
    behavior: Damage
    damage:
      types:
        Blunt: 100

- type: entity
  parent: ShardBase
  id: ShardGlass
  name: glass shard
  description: A small piece of glass.
  components:
  - type: Sprite
    color: "#bbeeff"
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 4.5
  - type: Tag
    tags:
      - GlassShard
      - Trash
  - type: Extractable
    grindableSolutionName: shardglass
  - type: SolutionContainerManager
    solutions:
      shardglass:
        reagents:
        - ReagentId: Silicon
          Quantity: 5 #Half of the value of regular glass. TECHNICALLY, welding a single shard of glass gives you the full thing back with just 1 sheet, but that is stupid so I am making it half.
  - type: Construction
    graph: ShivConstruct
    node: start
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25

- type: entity
  parent: ShardBase
  id: ShardGlassReinforced
  name: reinforced glass shard
  description: A small piece of reinforced glass.
  components:
  - type: Sprite
    color: "#96cdef"
  - type: MeleeWeapon
    damage:
      types:
        Slash: 4.5
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: PartRodMetal1
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 5.5
  - type: Tag
    tags:
      - ReinforcedGlassShard
      - Trash
  - type: Extractable
    grindableSolutionName: shardrglass
  - type: SolutionContainerManager
    solutions:
      shardrglass:
        reagents:
        - ReagentId: Silicon
          Quantity: 5 #I don't care enough to divide all of the reinforced glass materials by 2 because reinforced glass shards are due for removal anyways.
  - type: Construction
    graph: ReinforcedShivConstruct
    node: start
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25
      Steel: 12

- type: entity
  parent: ShardBase
  id: ShardGlassPlasma
  name: plasma glass shard
  description: A small piece of plasma glass.
  components:
  - type: Sprite
    color: "#FF72E7"
  - type: MeleeWeapon
    damage:
      types:
        Slash: 5.5
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: SheetPlasma1
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 6.5
  - type: Tag
    tags:
      - PlasmaGlassShard
      - Trash
  - type: Extractable
    grindableSolutionName: shardpglass
  - type: SolutionContainerManager
    solutions:
      shardpglass:
        reagents:
        - ReagentId: Silicon
          Quantity: 5
        - ReagentId: Plasma
          Quantity: 5
  - type: Construction
    graph: PlasmaShivConstruct
    node: start
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25
      Plasma: 25

- type: entity
  parent: ShardBase
  id: ShardGlassUranium
  name: uranium glass shard
  description: A small piece of uranium glass.
  components:
  - type: Sprite
    color: "#8eff7a"
  - type: MeleeWeapon
    damage:
      types:
        Slash: 4.5
        Radiation: 2
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: SheetUranium1
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 5
        Radiation: 2.5
  - type: Tag
    tags:
      - UraniumGlassShard
      - Trash
  - type: Extractable
    grindableSolutionName: sharduglass
  - type: SolutionContainerManager
    solutions:
      sharduglass:
        reagents:
        - ReagentId: Silicon
          Quantity: 5
        - ReagentId: Uranium
          Quantity: 5
  - type: Construction
    graph: UraniumShivConstruct
    node: start
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25
      Uranium: 25

- type: entity
  parent: ShardBase
  id: ShardGlassClockwork
  name: clockwork glass shard
  description: A small piece of brass-infused glass.
  components:
  - type: Sprite
    color: "#e0aa36"
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: SheetBrass1
  - type: DamageUserOnTrigger
    damage:
      types:
        Piercing: 5
  - type: Tag
    tags:
      - ClockworkGlassShard
      - Trash
  - type: Extractable
    grindableSolutionName: shardcglass
  - type: SolutionContainerManager
    solutions:
      shardcglass:
        reagents:
        - ReagentId: Silicon
          Quantity: 5
        - ReagentId: Zinc
          Quantity: 1.65
        - ReagentId: Copper
          Quantity: 3.35
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25
      Brass: 25