- type: entity
  parent: BaseItem
  id: BaseLightbulb
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Power/light_bulb.rsi
    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
      - !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" ]
  - type: Appearance
    visuals:
    - type: LightBulbVisualizer
  - type: Tag
    tags:
    - Recyclable
    - Trash
  - type: Recyclable

# 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: That's a light bulb.
  components:
  - type: LightBulb
    bulb: Bulb
    color: "#FFD1A3" # 4000K color temp
    lightEnergy: 1.0
    lightRadius: 6
    lightSoftness: 1.1
  - type: Sprite
    sprite: Objects/Power/light_bulb.rsi
    state: normal

- type: entity
  parent: BaseLightbulb
  name: fluorescent light tube
  id: LightTube
  description: That's a light fixture.
  components:
  - type: LightBulb
    bulb: Tube
    color: "#FFE4CE" # 5000K color temp
    lightEnergy: 0.8
    lightRadius: 10
    lightSoftness: 1
  - type: Sprite
    sprite:  Objects/Power/light_tube.rsi
    state: normal

- type: entity
  parent: BaseLightbulb
  name: led light tube
  description: A high power high energy bulb.
  id: LedLightTube
  components:
  - type: LightBulb
    bulb: Tube
    color: "#EEEEFF"
    lightEnergy: 2.5
    lightRadius: 10
    lightSoftness: 0.9
    BurningTemperature: 350
    PowerUse: 25
  - type: Sprite
    sprite:  Objects/Power/light_tube.rsi
    state: normal

- type: entity
  parent: BaseLightbulb
  name: exterior light tube
  description: A high power high energy bulb for the depths of space. May contain mercury.
  id: ExteriorLightTube
  components:
  - type: LightBulb
    bulb: Tube
    color: "#B4FCF0"
    lightEnergy: 4.5
    lightRadius: 12
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 100
  - type: Sprite
    sprite:  Objects/Power/light_tube.rsi
    state: normal

- type: entity
  parent: BaseLightbulb
  name: sodium light tube
  description: A high power high energy bulb for the depths of space. Salty.
  id: SodiumLightTube
  components:
  - type: LightBulb
    bulb: Tube
    color: "#FFAF38"
    lightEnergy: 4
    lightRadius: 10
    lightSoftness: 0.5
    BurningTemperature: 350
    PowerUse: 100
  - type: Sprite
    sprite:  Objects/Power/light_tube.rsi
    state: normal
