Skip to content

Commit

Permalink
Adjust lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapu1178 committed Aug 27, 2024
1 parent 6f25cb8 commit 7f1b24d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// frequency, in 1/10ths of a second, of the lighting process
#define LIGHTING_INTERVAL 5

#define MINIMUM_USEFUL_LIGHT_RANGE 1.4
#define MINIMUM_USEFUL_LIGHT_RANGE 1

/// height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone
#define LIGHTING_HEIGHT 1
Expand Down
9 changes: 6 additions & 3 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1251,11 +1251,11 @@
switch(var_name)
if(NAMEOF(src, light_inner_range))
if(light_system == COMPLEX_LIGHT)
set_light(l_inner_range = var_value)
set_light(l_outer_range = light_outer_range, l_inner_range = var_value, )
. = TRUE
if(NAMEOF(src, light_outer_range))
if(light_system == COMPLEX_LIGHT)
set_light(l_outer_range = var_value)
set_light(l_outer_range = var_value, l_inner_range = light_inner_range)
else
set_light_range(var_value)
. = TRUE
Expand All @@ -1272,7 +1272,10 @@
set_light_color(var_value)
. = TRUE
if(NAMEOF(src, light_on))
set_light_on(var_value)
if(light_system == COMPLEX_LIGHT)
set_light(l_on = var_value)
else
set_light_color(var_value)
. = TRUE
if(NAMEOF(src, light_flags))
set_light_flags(var_value)
Expand Down
9 changes: 4 additions & 5 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
processing_flags = START_PROCESSING_MANUALLY

light_color = LIGHT_COLOR_CYAN
light_outer_range = 1
light_inner_range = 0.1
light_outer_range = 1.4
light_power = 1
light_on = FALSE

var/efficiency = 1
var/min_health = -25
Expand Down Expand Up @@ -287,12 +287,11 @@
for(var/chem in av_chem)
chem_buttons[chem] = pick_n_take(av_chem) //no dupes, allow for random buttons to still be correct


/obj/machinery/sleeper/proc/refresh_light()
if(is_operational)
set_light_on(TRUE)
set_light(l_on = TRUE)
else
set_light_on(FALSE)
set_light(l_on = FALSE)

/obj/machinery/sleeper/syndie
icon_state = "sleeper_s"
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/mancrowave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

/obj/machinery/sleeper/mancrowave/refresh_light()
if(is_operational && occupant)
set_light_on(TRUE)
set_light(l_on = TRUE)
else
set_light_on(FALSE)
set_light(l_on = FALSE)

/obj/machinery/sleeper/mancrowave/close_machine(mob/user)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/lighting/lighting_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define NONSENSICAL_VALUE -99999
/atom/proc/set_light(l_outer_range, l_inner_range, l_power, l_falloff_curve = LIGHTING_DEFAULT_FALLOFF_CURVE, l_color = NONSENSICAL_VALUE, l_on)
if(l_outer_range > 0 && l_outer_range < MINIMUM_USEFUL_LIGHT_RANGE)
l_outer_range = MINIMUM_USEFUL_LIGHT_RANGE //Brings the range up to 1.4, which is just barely brighter than the soft lighting that surrounds players.
l_outer_range = MINIMUM_USEFUL_LIGHT_RANGE

if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT, l_inner_range, l_outer_range, l_power, l_falloff_curve, l_color, l_on) & COMPONENT_BLOCK_LIGHT_UPDATE)
return
Expand Down
15 changes: 15 additions & 0 deletions code/modules/surgery/machines/bodyscanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
dir = EAST
density = TRUE

light_color = LIGHT_COLOR_VIVID_GREEN
light_inner_range = 0.1
light_outer_range = 1.4
light_power = 1

var/obj/machinery/bodyscanner_console/linked_console

/obj/machinery/bodyscanner/Initialize(mapload)
Expand Down Expand Up @@ -85,6 +90,16 @@
return
eject_occupant(user)

/obj/machinery/bodyscanner/set_is_operational(new_value)
. = ..()
refresh_light()

/obj/machinery/bodyscanner/proc/refresh_light()
if(is_operational)
set_light(l_on = TRUE)
else
set_light(l_on = FALSE)

/obj/machinery/bodyscanner/proc/eject_occupant(mob/user, resisted)
if(!occupant)
return
Expand Down

0 comments on commit 7f1b24d

Please sign in to comment.