# SPDX-FileCopyrightText: 2019 Swept <49448379+SweptWasTaken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2020 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Ygg01 <daniel.fath7@gmail.com>
# SPDX-FileCopyrightText: 2020 lajolico <55922029+lajolico@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2021 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 ZeWaka <zewakagamer@gmail.com>
# SPDX-FileCopyrightText: 2021 mirrorcult <notzombiedude@gmail.com>
# SPDX-FileCopyrightText: 2022 Kevin Zheng <kevinz5000@gmail.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Matz05 <Matz05@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Moony <moony@hellomouse.net>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Veritius <veritiusgaming@gmail.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 moonheart08 <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 brainfood1183 <113240905+brainfood1183@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 potato1234_x <79580518+potato1234x@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 MACMAN2003 <macman2003c@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ubaser <134914314+UbaserB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Verm <32827189+Vermidia@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@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 Boaz1111 <149967078+Boaz1111@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 Southbridge <7013162+southbridge-fur@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseItem
  id: BaseLightbulb
  abstract: true
  components:
  - type: MeleeSound
    soundGroups:
      Brute:
        collection: GlassSmash
  - type: Sprite
    sprite: Objects/Power/light_bulb.rsi
    layers:
      - map: [ enum.LightBulbVisualLayers.Base ]
        state: normal
  - type: LightBulb
  - type: Damageable
    damageContainer: Inorganic
  - type: DamageOnLand
    damage:
      types:
        Blunt: 5
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 5
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
          params:
            volume: -8
      - !type:DoActsBehavior
        acts: [ "Breakage" ]
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
          params:
            volume: -8
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Appearance
  - type: Tag
    tags:
    - Trash
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Glass: 25
  - type: SpaceGarbage
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
  - type: ThrowableBlocked # Goobstation
    behavior: Damage
    damage:
      types:
        Blunt: 5

- type: entity
  parent: BaseLightbulb
  id: BaseLightTube
  abstract: true
  components:
  - type: Sprite
    sprite:  Objects/Power/light_tube.rsi
  - type: LightBulb
    bulb: Tube
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:DoActsBehavior
        acts: [ "Breakage" ]
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Lighting color values gathered from
# https://andi-siess.de/rgb-to-color-temperature/
# https://academo.org/demos/colour-temperature-relationship/
- type: entity
  parent: BaseLightbulb
  name: incandescent light bulb
  id: LightBulb
  description: A light bulb.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#FFD1A3" # 4000K color temp
    lightEnergy: 1.0
    lightRadius: 6
    lightSoftness: 1.1
  - type: Tag
    tags:
    - LightBulb
    - Trash

- type: entity
  parent: BaseLightbulb
  name: led light bulb
  id: LedLightBulb
  description: A power efficient light bulb.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#EEEEFF"
    lightEnergy: 1
    lightRadius: 8
    lightSoftness: 1
    BurningTemperature: 350 #LEDs are colder than incandescent bulbs
    PowerUse: 6 #LEDs are more power efficient than incandescent bulbs
  - type: Tag
    tags:
    - LightBulb
    - Trash

- type: entity
  parent: BaseLightbulb
  name: dim light bulb
  id: DimLightBulb
  description: A dim light bulb for populating the darkness of maintenance.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#ba473f"
    lightEnergy: 0.5
    lightRadius: 5
    lightSoftness: 3
  - type: Tag
    tags:
    - LightBulb
    - Trash

- type: entity
  parent: BaseLightbulb
  name: warm light bulb
  id: WarmLightBulb
  description: A warm light bulb for a more cozy atmosphere.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#ff9833" # 2200k color temp
    lightEnergy: 1
    lightRadius: 6
    lightSoftness: 3
  - type: Tag
    tags:
    - LightBulb
    - Trash

- type: entity
  parent: LightBulb
  name: old incandescent light bulb
  id: LightBulbOld
  description: An aging light bulb.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#FFD1A3" # 4000K color temp
    lightEnergy: 0.3 # old incandescents just arent as bright
    lightRadius: 6
    lightSoftness: 1.1

- type: entity
  suffix: Broken
  parent: BaseLightbulb
  name: incandescent light bulb
  id: LightBulbBroken
  description: A light bulb.
  components:
  - type: LightBulb
    startingState: Broken
    bulb: Bulb

- type: entity
  parent: BaseLightbulb
  name: service light bulb
  id: ServiceLightBulb
  description: A low-brightness green lightbulb used in janitorial service lights.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#CCFF60"
    lightEnergy: 0.45
    lightRadius: 1.5
    lightSoftness: 3
  - type: Tag
    tags:
    - LightBulb
    - Trash

- type: entity
  parent: BaseLightTube
  name: fluorescent light tube
  id: LightTube
  description: A light fixture.
  components:
  - type: LightBulb
    color: "#FFE4CE" # 5000K color temp
    lightEnergy: 0.8
    lightRadius: 10
    lightSoftness: 1
    PowerUse: 25

- type: entity
  parent: LightTube
  name: old fluorescent light tube
  id: LightTubeOld
  description: An aging light fixture.
  components:
  - type: LightBulb
    color: "#FFDABB" # old fluorescents are yellower-4500K temp
    lightEnergy: 0.5
    lightRadius: 10
    lightSoftness: 1
    PowerUse: 10

- type: entity
  suffix: Broken
  parent: BaseLightTube
  name: fluorescent light tube
  id: LightTubeBroken
  description: A light fixture.
  components:
  - type: LightBulb
    startingState: Broken

- type: entity
  parent: BaseLightTube
  name: led light tube
  description: A high power high energy bulb.
  id: LedLightTube
  components:
  - type: LightBulb
    color: "#EEEEFF"
    lightEnergy: 1
    lightRadius: 15
    lightSoftness: 0.9
    BurningTemperature: 350
    PowerUse: 12

- type: entity
  parent: BaseLightTube
  name: exterior light tube
  description: A high power high energy bulb for the depths of space. May contain mercury.
  id: ExteriorLightTube
  components:
  - type: LightBulb
    color: "#B4FCF0"
    lightEnergy: 4.5
    lightRadius: 12
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 100

- type: entity
  parent: BaseLightTube
  name: sodium light tube
  description: A high power high energy bulb for the depths of space. Salty.
  id: SodiumLightTube
  components:
  - type: LightBulb
    color: "#FFAF38"
    lightEnergy: 4
    lightRadius: 10
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 100

- type: entity
  parent: BaseLightTube
  name: crystal light tube
  description: A high power high energy bulb which has a small colored crystal inside.
  id: BaseLightTubeCrystal
  abstract: true
  components:
  - type: LightBulb
    lightEnergy: 3
    lightRadius: 8
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 60

- type: entity
  parent: BaseLightTubeCrystal
  name: cyan crystal light tube
  id: LightTubeCrystalCyan
  components:
  - type: LightBulb
    color: "#47f8ff"
  - type: Construction
    graph: CyanLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalCyan

- type: entity
  parent: BaseLightTubeCrystal
  name: blue crystal light tube
  id: LightTubeCrystalBlue
  components:
  - type: LightBulb
    color: "#39a1ff"
  - type: Construction
    graph: BlueLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalBlue

- type: entity
  parent: BaseLightTubeCrystal
  name: yellow crystal light tube
  id: LightTubeCrystalYellow
  components:
  - type: LightBulb
    color: "#ffde46"
  - type: Construction
    graph: YellowLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalYellow

- type: entity
  parent: BaseLightTubeCrystal
  name: pink crystal light tube
  id: LightTubeCrystalPink
  components:
  - type: LightBulb
    color: "#ff66cc"
  - type: Construction
    graph: PinkLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalPink

- type: entity
  parent: BaseLightTubeCrystal
  name: orange crystal light tube
  id: LightTubeCrystalOrange
  components:
  - type: LightBulb
    color: "#ff8227"
  - type: Construction
    graph: OrangeLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalOrange

- type: entity
  parent: BaseLightTubeCrystal
  name: black crystal light tube
  description: A high power high energy bulb which has a small colored crystal inside. It isn't very bright.
  id: LightTubeCrystalBlack
  components:
  - type: LightBulb
    color: "#363636"
    lightEnergy: 1
    lightRadius: 8
  - type: Construction
    graph: BlackLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalBlack

- type: entity
  parent: BaseLightTubeCrystal
  name: red crystal light tube
  id: LightTubeCrystalRed
  components:
  - type: LightBulb
    color: "#fb4747"
  - type: Construction
    graph: RedLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalRed

- type: entity
  parent: LightTubeCrystalCyan
  name: green crystal light tube
  id: LightTubeCrystalGreen
  components:
  - type: LightBulb
    color: "#52ff39"
  - type: Construction
    graph: GreenLight
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalGreen


- type: entity
  parent: BaseLightbulb
  name: crystal light bulb
  description: A high power high energy bulb which has a small colored crystal inside.
  id: BaseLightbulbCrystal
  abstract: true
  components:
  - type: LightBulb
    color: "#47f8ff"
    lightEnergy: 1
    lightRadius: 6
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 60
    bulb: Bulb

- type: entity
  parent: BaseLightbulbCrystal
  name: cyan crystal light bulb
  id: LightBulbCrystalCyan
  components:
  - type: LightBulb
    color: "#47f8ff"
  - type: Construction
    graph: CyanLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalCyan

- type: entity
  parent: BaseLightbulbCrystal
  name: blue crystal light bulb
  id: LightBulbCrystalBlue
  components:
  - type: LightBulb
    color: "#39a1ff"
  - type: Construction
    graph: BlueLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalBlue

- type: entity
  parent: BaseLightbulbCrystal
  name: yellow crystal light bulb
  id: LightBulbCrystalYellow
  components:
  - type: LightBulb
    color: "#ffde46"
  - type: Construction
    graph: YellowLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalYellow

- type: entity
  parent: BaseLightbulbCrystal
  name: pink crystal light bulb
  id: LightBulbCrystalPink
  components:
  - type: LightBulb
    color: "#ff66cc"
  - type: Construction
    graph: PinkLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalPink

- type: entity
  parent: BaseLightbulbCrystal
  name: orange crystal light bulb
  id: LightBulbCrystalOrange
  components:
  - type: LightBulb
    color: "#ff8227"
  - type: Construction
    graph: OrangeLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalOrange

- type: entity
  parent: BaseLightbulbCrystal
  name: black crystal light bulb
  description: A high power high energy bulb which has a small colored crystal inside. It isn't very bright.
  id: LightBulbCrystalBlack
  components:
  - type: LightBulb
    color: "#363636"
    lightEnergy: 1
    lightRadius: 8
  - type: Construction
    graph: BlackLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalBlack

- type: entity
  parent: BaseLightbulbCrystal
  name: red crystal light bulb
  id: LightBulbCrystalRed
  components:
  - type: LightBulb
    color: "#fb4747"
  - type: Construction
    graph: RedLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalRed

- type: entity
  parent: BaseLightbulbCrystal
  name: green crystal light bulb
  id: LightBulbCrystalGreen
  components:
  - type: LightBulb
    color: "#52ff39"
  - type: Construction
    graph: GreenLightBulb
    node: icon
  - type: ToolRefinable
    refineResult:
    - id: SheetGlass1
    - id: ShardCrystalGreen