- type: entity
  id: WallLight
  name: light
  description: "An unpowered light."
  suffix: Unpowered
  components:
  - type: Transform
    anchored: true
  - type: Clickable
  - type: InteractionOutline
  - type: Construction
    graph: LightFixture
    node: tubeLight
  - type: Physics
    canCollide: false
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.15,-0.45,0.35,0.45"
      layer: [ Passable ]
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_tube.rsi
    drawdepth: WallMountedItems
    netsync: false
    layers:
    - state: on
      map: ["enum.PoweredLightLayers.Base"]
    state: on
  - type: PointLight
    radius: 10
    energy: 0.8
    softness: 1
    offset: "0, -0.5"
  - type: SignalReceiver
    inputs:
      - name: state
        type: bool
  - type: UserInterface
    interfaces:
      - key: enum.SignalReceiverUiKey.Key
        type: SignalPortSelectorBoundUserInterface
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors: #excess damage, don't spawn entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:EmptyAllContainersBehaviour
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: ["Destruction"]
  placement:
    mode: SnapgridCenter
    snap:
    - Wallmount

- type: entity
  name: light
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  id: PoweredlightEmpty
  suffix: Powered, Empty
  parent: WallLight
  components:
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_tube.rsi
    state: empty
  - type: PointLight
    enabled: false
  - type: PoweredLight
    bulb: Tube
    damage:
      types:
        Heat: 5
  - type: ApcPowerReceiver
  - type: ExtensionCableReceiver
  - type: DeviceNetworkComponent
    deviceNetId: Apc
  - type: ApcNetworkConnection
  - type: Appearance
    visuals:
    - type: PoweredLightVisualizer
      blinkingSound:
        path: "/Audio/Machines/light_tube_on.ogg"

- type: entity
  id: Poweredlight
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Powered
  parent: PoweredlightEmpty
  components:
  - type: Sprite
    state: off
  - type: PoweredLight
    hasLampOnSpawn: LightTube
    damage:
      types:
        Heat: 5

- type: entity
  id: PoweredlightLED
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Powered, LED
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LedLightTube
    damage:
      types:
        Heat: 5
     
- type: entity
  parent: WallLight
  id: UnpoweredLightLED
  suffix: Unpowered, LED
  components:
  - type: PointLight
    radius: 10
    energy: 2.5
    softness: 0.9
    color: "#EEEEFF"
        
- type: entity
  id: PoweredlightExterior
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Powered, Exterior Blue
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: ExteriorLightTube
    damage:
      types:
        Heat: 5
        
- type: entity
  parent: WallLight
  id: UnpoweredLightExterior
  suffix: Unpowered, Exterior Blue
  components:
  - type: PointLight
    radius: 12
    energy: 4.5
    softness: 0.5
    color: "#B4FCF0"
        

- type: entity
  id: PoweredlightSodium
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Powered, Sodium Orange
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: SodiumLightTube
    damage:
      types:
        Heat: 5
        
- type: entity
  parent: WallLight
  id: UnpoweredLightSodium
  suffix: Unpowered, Sodium Orange
  components:
  - type: PointLight
    radius: 10
    energy: 4
    softness: 0.5
    color: "#FFAF38"

- type: entity
  name: small light
  description: "An unpowered light."
  id: SmallLight
  suffix: Unpowered
  parent: WallLight
  components:
    - type: AmbientSound
      volume: -15
      range: 2
      sound:
        path: /Audio/Ambience/Objects/light_hum.ogg
    - type: Sprite
      sprite: Structures/Wallmounts/Lighting/light_small.rsi
      state: on
    - type: PointLight
      energy: 1.0
      radius: 6
      softness: 1.1
      enabled: true
    - type: Damageable
      damageContainer: Inorganic
    - type: Destructible
      thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage, don't spawn entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 25
        behaviors:
        - !type:EmptyAllContainersBehaviour
        - !type:SpawnEntitiesBehavior
          spawn:
            SheetSteel1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: ["Destruction"]
    - type: Construction
      graph: LightFixture
      node: bulbLight

- type: entity
  name: small light
  description: "A light fixture. Draws power and produces light when equipped with a light bulb."
  id: PoweredSmallLightEmpty
  suffix: Powered, Empty
  parent: SmallLight
  components:
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_small.rsi
    state: empty
  - type: PointLight
    enabled: false
    offset: "0, -0.5"
  - type: Physics
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "0,0,0.1,0.25"
      layer: [ Passable ]
  - type: PoweredLight
    bulb: Bulb
    damage:
      types:
        Heat: 5
  - type: ApcPowerReceiver
  - type: ExtensionCableReceiver
  - type: DeviceNetworkComponent
    deviceNetId: Apc
  - type: ApcNetworkConnection
  - type: Appearance
    visuals:
    - type: PoweredLightVisualizer

- type: entity
  id: PoweredSmallLight
  suffix: Powered
  parent: PoweredSmallLightEmpty
  components:
  - type: Sprite
    state: off
  - type: PoweredLight
    hasLampOnSpawn: LightBulb
    damage:
      types:
        Heat: 5
