Merge branch 'master' into bar-codex

This commit is contained in:
alsoandanswer
2026-07-18 09:29:44 +08:00
95 changed files with 1300 additions and 251 deletions
@@ -14,6 +14,8 @@
w_class = WEIGHT_CLASS_SMALL
looping_sound = FALSE
light_system = MOVABLE_LIGHT
/obj/item/modular_computer/handheld/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "To deploy the charging cable on this device, either drag and drop it over a nearby APC, or click on the APC with the computer in hand."
@@ -61,7 +61,7 @@
data["battery"] = computer.battery_module ? list("rating" = computer.battery_module.battery_rating, "percent" = computer.battery_module.battery.percent()) : null
if(computer.flashlight)
var/brightness = clamp(0, round(computer.flashlight.power, 0.1) * 10, 10)
var/brightness = clamp(0, round(computer.flashlight.light_power, 0.1) * 10, 10)
data["brightness"] = brightness
return data
@@ -6,21 +6,26 @@
power_usage = 50
enabled = FALSE
critical = FALSE
var/range = 2
var/power = 1
var/flashlight_color = LIGHT_COLOR_HALOGEN
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, flashlight_color)
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(initial(parent_computer.light_range), initial(parent_computer.light_power), flashlight_color)
parent_computer.set_light_on(enabled)
/obj/item/computer_hardware/flashlight/proc/tweak_brightness(var/new_power)
. = power = clamp(0, new_power, 1)
set_light_power(clamp(0, new_power, 1))
if(parent_computer && enabled)
parent_computer.set_light(range, power, flashlight_color)
parent_computer.set_light_power(light_power)