#==Suffix Guide==
#Always Powered - light doesn't need power to give off life
#Empty - on map init, light spawns without bulb
#Blue/Sodium/etc. - the color of the light

#Basic lights
- type: entity
  abstract: true
  id: BaseWallLight
  placement:
    mode: SnapgridCenter
    snap:
    - Wallmount
  components:
  - type: MeleeSound
    soundGroups:
      Brute:
        collection: GlassSmash
  - type: Transform
    anchored: true
  - type: Clickable
  - type: InteractionOutline
  - type: Sprite
    drawdepth: WallMountedItems
    layers:
    - map: ["enum.PoweredLightLayers.Base"]
      state: base
    - map: ["enum.PoweredLightLayers.Glow"]
      state: glow
      shader: unshaded
  - type: PointLight
    color: "#FFE4CE" # 5000K color temp
    energy: 0.8
    radius: 10
    softness: 1
    offset: "0, -0.5"
  - type: Damageable
    damageModifierSet: Metallic
  - type: Injurable
    damageContainer: Inorganic
  - type: RCDDeconstructable
    cost: 4
    delay: 2
    fx: EffectRCDDeconstruct2
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.4,0.35,0.4,0.5"
        density: 190
        mask:
        - None
        layer:
        - TabletopMachineLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:EmptyAllContainersBehaviour
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
  - type: PlacementReplacement
    key: lights

- type: entity
  parent: BaseWallLight
  id: AlwaysPoweredWallLight
  name: light
  suffix: Always powered
  description: "An always powered light."
  components:
  - type: Construction
    graph: LightFixture
    node: tubeLight
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_tube.rsi
    layers:
    - map: ["enum.PoweredLightLayers.Base"]
      state: base
    - map: ["enum.PoweredLightLayers.Glow"]
      state: glow
      shader: unshaded
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 2
            max: 2

- type: entity
  name: light
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  id: PoweredlightEmpty
  suffix: Empty
  parent: AlwaysPoweredWallLight
  components:
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_tube.rsi
    state: empty
  - type: PointLight
    enabled: false
  - type: PoweredLight
    bulb: Tube
  - type: ContainerContainer
    containers:
      light_bulb: !type:ContainerSlot
  - type: ApcPowerReceiver
  - type: ExtensionCableReceiver
  - type: DeviceNetwork
    deviceNetId: Wireless
    receiveFrequencyId: SmartLight
  - type: WirelessNetworkConnection
    range: 200
  - type: DeviceLinkSink
    ports:
      - On
      - Off
      - Toggle
  - type: Appearance
  - type: PoweredLightVisuals
    blinkingSound:
      path: "/Audio/Machines/light_tube_on.ogg"
    spriteStateMap:
      empty: empty
      off: base
      on: base
      broken: broken
      burned: burned
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: Poweredlight
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: ""
  parent: PoweredlightEmpty
  components:
  - type: Sprite
    state: base
  - type: PointLight
    enabled: true
  - type: PoweredLight
    hasLampOnSpawn: LightTube
  - type: AmbientOnPowered
  - type: AmbientSound
    volume: -15
    range: 2
    sound:
      path: /Audio/Ambience/Objects/light_hum.ogg
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

#LED lights
- type: entity
  id: PoweredlightLED
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: LED
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LedLightTube
  - type: PointLight
    radius: 15
    energy: 1
    softness: 0.9
    color: "#EEEEFF"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 1 # LEDs don't get as hot
    popupText: powered-light-component-burn-hand

- type: entity
  parent: AlwaysPoweredWallLight
  id: AlwaysPoweredLightLED
  suffix: Always Powered, LED
  components:
  - type: PointLight
    radius: 10
    energy: 2.5
    softness: 0.9
    color: "#EEEEFF"

#Exterior lights
- type: entity
  id: PoweredlightExterior
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Exterior
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: ExteriorLightTube
  - type: DamageOnInteract
    damage:
      types:
        Heat: 4 # brighter light gets hotter
    popupText: powered-light-component-burn-hand

- type: entity
  parent: AlwaysPoweredWallLight
  id: AlwaysPoweredLightExterior
  suffix: Always Powered, Exterior
  components:
  - type: PointLight
    radius: 12
    energy: 4.5
    softness: 0.5
    color: "#B4FCF0"

#Sodium lights
- type: entity
  id: PoweredlightSodium
  description: "A light fixture. Draws power and produces light when equipped with a light tube."
  suffix: Sodium
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: SodiumLightTube
  - type: PointLight
    radius: 10
    energy: 2.5
    softness: 0.9
    color: "#FFAF38"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  parent: AlwaysPoweredWallLight
  id: AlwaysPoweredLightSodium
  suffix: Always Powered, Sodium
  components:
  - type: PointLight
    radius: 10
    energy: 4
    softness: 0.5
    color: "#FFAF38"

#Small lights
- type: entity
  parent: BaseWallLight
  id: SmallLight
  name: small light
  suffix: Always Powered
  description: "An always powered light."
  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: base
    - type: PointLight
      energy: 1.0
      radius: 6
      softness: 1.1
      enabled: true
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeAabb
            bounds: "-0.1,0.255,0.1,0.5"
          density: 190
          mask:
          - None
          layer:
          - TabletopMachineLayer
    - type: Destructible
      thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 50
        behaviors:
        - !type:SpawnEntitiesBehavior
          spawn:
            SheetSteel1:
              min: 1
              max: 1
    - 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: Empty
  parent: SmallLight
  components:
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/light_small.rsi
    state: empty
  - type: AmbientSound
    enabled: false
  - type: PointLight
    enabled: false
    offset: "0, -0.5"
  - type: ContainerContainer
    containers:
      light_bulb: !type:ContainerSlot
  - type: PoweredLight
    bulb: Bulb
  - type: ApcPowerReceiver
  - type: ExtensionCableReceiver
  - type: DeviceNetwork
    deviceNetId: Wireless
    receiveFrequencyId: SmartLight
  - type: WirelessNetworkConnection
    range: 200
  - type: Appearance
  - type: PoweredLightVisuals
    spriteStateMap:
      empty: empty
      off: base
      on: base
      broken: broken
      burned: burned
  - type: DeviceLinkSink
    ports:
      - On
      - Off
      - Toggle
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: PoweredLEDSmallLight
  suffix: LED
  parent: PoweredSmallLightEmpty
  components:
  - type: Sprite
    state: base
  - type: PointLight
    enabled: true
    radius: 8
    energy: 1
    softness: 1
    color: "#EEEEFF"
  - type: PoweredLight
    hasLampOnSpawn: LedLightBulb
  - type: DamageOnInteract
    damage:
      types:
        Heat: 1
    popupText: powered-light-component-burn-hand

- type: entity
  id: PoweredDimSmallLight
  suffix: Dim
  parent: PoweredSmallLightEmpty
  components:
  - type: Sprite
    state: base
  - type: PointLight
    enabled: true
    radius: 5
    energy: 0.5
    softness: 3
    color: "#ba473f"
  - type: PoweredLight
    hasLampOnSpawn: DimLightBulb
  - type: DamageOnInteract
    damage:
      types:
        Heat: 1
    popupText: powered-light-component-burn-hand

- type: entity
  id: PoweredWarmSmallLight
  suffix: Warm
  parent: PoweredSmallLightEmpty
  components:
  - type: Sprite
    state: base
  - type: PointLight
    enabled: true
    radius: 6
    energy: 1
    softness: 3
    color: "#FF8A0C"
  - type: PoweredLight
    hasLampOnSpawn: WarmLightBulb
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: PoweredSmallLight
  suffix: ""
  parent: PoweredSmallLightEmpty
  components:
  - type: Sprite
    state: base
  - type: PointLight
    enabled: true
  - type: PoweredLight
    hasLampOnSpawn: LightBulb
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

#Emergency Lights
- type: entity
  parent: BaseWallLight
  id: EmergencyLight
  name: emergency light
  description: A small light with an internal battery that turns on as soon as it stops receiving any power. Nanotrasen technology allows it to adapt its color to alert crew to the conditions of the station.
  components:
  - type: PointLight
    enabled: false
    radius: 5
    energy: 0.6
    offset: "0, 0.4"
    color: "#7CFC00"
    mask: /Textures/Effects/LightMasks/double_cone.png
  - type: ApcPowerReceiver
  - type: ExtensionCableReceiver
  - type: Battery
    # Very important:
    # Disable networking to prevent the battery getting continuously dirtied every tick as it interacts with the power network.
    # This can not be done by changing the charge rate as the power supply ramps up over time.
    # This disables prediction for this battery.
    netsync: false
    maxCharge: 30000
    startingCharge: 0
  - type: EmergencyLight
  - type: RotatingLight
    speed: 40
  - type: Sprite
    sprite: Structures/Wallmounts/Lighting/emergency_light.rsi
    layers:
    - state: base
      map: [ "enum.EmergencyLightVisualLayers.Base" ]
    - state: emergency_light_off
      map: [ "enum.EmergencyLightVisualLayers.LightOff" ]
      color: "#7CFC00"
    - state: emergency_light_on
      map: [ "enum.EmergencyLightVisualLayers.LightOn" ]
      color: "#7CFC00"
      shader: "unshaded"
      visible: false
  - type: Construction
    graph: LightFixture
    node: emergencyLight
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
          ShardGlass:
            min: 1
            max: 1

#Coloured lights

- type: entity
  id: PoweredlightCyan
  suffix: Cyan
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalCyan
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#47f8ff"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightCyan
  suffix: Always Powered, Cyan
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#47f8ff"

- type: entity
  id: PoweredlightBlue
  suffix: Blue
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalBlue
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#39a1ff"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightBlue
  suffix: Always Powered, Blue
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#39a1ff"

- type: entity
  id: PoweredlightYellow
  suffix: Yellow
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalYellow
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ffde46"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightYellow
  suffix: Always Powered, Yellow
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ffde46"

- type: entity
  id: PoweredlightPink
  suffix: Pink
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalPink
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ff66cc"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightPink
  suffix: Always Powered, Pink
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ff66cc"

- type: entity
  id: PoweredlightOrange
  suffix: Orange
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalOrange
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ff8227"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightOrange
  suffix: Always Powered, Orange
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#ff8227"

- type: entity
  id: PoweredlightBlack
  suffix: Black
  parent: Poweredlight
  description:
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalBlack
  - type: PointLight
    radius: 8
    energy: 1
    softness: 0.5
    color: "#363636"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightBlack
  suffix: Always Powered, Black
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 1
    softness: 0.5
    color: "#363636"

- type: entity
  id: PoweredlightRed
  suffix: Red
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalRed
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#fb4747"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightRed
  suffix: Always Powered, Red
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#fb4747"

- type: entity
  id: PoweredlightGreen
  suffix: Green
  parent: Poweredlight
  components:
  - type: PoweredLight
    hasLampOnSpawn: LightTubeCrystalGreen
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#52ff39"
  - type: DamageOnInteract
    damage:
      types:
        Heat: 2
    popupText: powered-light-component-burn-hand

- type: entity
  id: AlwaysPoweredlightGreen
  suffix: Always Powered, Green
  parent: AlwaysPoweredWallLight
  components:
  - type: PointLight
    radius: 8
    energy: 3
    softness: 0.5
    color: "#52ff39"
