Skip to content

Commit

Permalink
lights
Browse files Browse the repository at this point in the history
  • Loading branch information
BeagleGaming1 committed Aug 7, 2023
1 parent 68d49d6 commit bc953f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ SUBSYSTEM_DEF(ticker)
INVOKE_ASYNC(C, TYPE_PROC_REF(/obj/structure/closet, select_gamemode_equipment), mode.type)
for(var/obj/structure/machinery/vending/V in machines)
INVOKE_ASYNC(V, TYPE_PROC_REF(/obj/structure/machinery/vending, select_gamemode_equipment), mode.type)
for(var/obj/structure/machinery/power/apc/apc in machines)
if(!is_mainship_level(apc.z))
continue
addtimer(CALLBACK(apc, TYPE_PROC_REF(/obj/structure/machinery/power/apc, late_activation)), rand(4 SECONDS, 15 SECONDS))

SEND_GLOBAL_SIGNAL(COMSIG_GLOB_POST_SETUP)

Expand Down
7 changes: 7 additions & 0 deletions code/modules/power/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,18 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list(
update_icon()
addtimer(CALLBACK(src, PROC_REF(update)), 5)

if(is_mainship_level(z) && !(SSticker.current_state == GAME_STATE_PLAYING || SSticker.current_state == GAME_STATE_FINISHED))
operating = 0

start_processing()

if(!start_charge && is_ground_level(z) && prob(10))
set_broken()

/obj/structure/machinery/power/apc/proc/late_activation()
operating = 1
update()

/obj/structure/machinery/power/apc/set_pixel_location()
tdir = dir //To fix Vars bug
setDir(SOUTH)
Expand Down

0 comments on commit bc953f5

Please sign in to comment.