mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-23 22:06:47 +01:00
4a50853514
PDA flashlights work again and their strength is now determined by the flashlight inside. There is still only one type of flashlight. Cargo tug lights work again and are now directional.
32 lines
891 B
Plaintext
32 lines
891 B
Plaintext
/obj/item/computer_hardware/flashlight
|
|
name = "flashlight"
|
|
desc = "A small pen-sized flashlight used to illuminate a small area."
|
|
icon = 'icons/obj/lighting.dmi'
|
|
icon_state = "headlights"
|
|
power_usage = 50
|
|
enabled = FALSE
|
|
critical = FALSE
|
|
|
|
light_range = 1.2
|
|
light_power = 0.5
|
|
light_color = LIGHT_COLOR_HALOGEN
|
|
light_system = MOVABLE_LIGHT
|
|
|
|
light_on = FALSE
|
|
|
|
/obj/item/computer_hardware/flashlight/enable()
|
|
. = ..()
|
|
if(parent_computer)
|
|
parent_computer.set_light_range_power_color(light_range, light_power, light_color)
|
|
parent_computer.set_light_on(enabled)
|
|
|
|
/obj/item/computer_hardware/flashlight/disable()
|
|
. = ..()
|
|
if(parent_computer)
|
|
parent_computer.set_light_on(enabled)
|
|
|
|
/obj/item/computer_hardware/flashlight/proc/tweak_brightness(var/new_power)
|
|
set_light_power(clamp(0, new_power, 1))
|
|
if(parent_computer && enabled)
|
|
parent_computer.set_light_power(light_power)
|