mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
[MIRROR] Strays away from GLOB.machines when possible [MDB IGNORE] (#17478)
* Strays away from GLOB.machines when possible (#71100) ## About The Pull Request This replaces needless GLOB.machines with more precise lists whenever one existed, plus adding a new one for CTF machines. ## Why It's Good For The Game GLOB.machines holds every single /obj/machinery in the game, so checking the whole list for stuff is pretty big. This aims to cut that down by using smaller lists whenever possible. I also gave CTF a new list because it checked machines very often. ## Changelog Nothing player facing. * Strays away from GLOB.machines when possible Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
@@ -66,7 +66,7 @@ SUBSYSTEM_DEF(communications)
|
|||||||
message_admins("[ADMIN_LOOKUPFLW(user)] has called an emergency meeting.")
|
message_admins("[ADMIN_LOOKUPFLW(user)] has called an emergency meeting.")
|
||||||
|
|
||||||
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
|
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
|
||||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list)
|
||||||
if(!(C.machine_stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
|
if(!(C.machine_stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
|
||||||
if(unique)
|
if(unique)
|
||||||
C.add_message(sending)
|
C.add_message(sending)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
minor_announce(input["message"], "Incoming message from [input["message_sender"]]")
|
minor_announce(input["message"], "Incoming message from [input["message_sender"]]")
|
||||||
message_admins("Receiving a message from [input["sender_ckey"]] at [input["source"]]")
|
message_admins("Receiving a message from [input["sender_ckey"]] at [input["source"]]")
|
||||||
for(var/obj/machinery/computer/communications/communications_console in GLOB.machines)
|
for(var/obj/machinery/computer/communications/communications_console in GLOB.shuttle_caller_list)
|
||||||
communications_console.override_cooldown()
|
communications_console.override_cooldown()
|
||||||
|
|
||||||
/datum/world_topic/news_report
|
/datum/world_topic/news_report
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
S.update_appearance()
|
S.update_appearance()
|
||||||
S.power_change()
|
S.power_change()
|
||||||
|
|
||||||
for(var/area/A in GLOB.the_station_areas)
|
for(var/area/A as anything in GLOB.the_station_areas)
|
||||||
if(!A.requires_power || A.always_unpowered )
|
if(!A.requires_power || A.always_unpowered )
|
||||||
continue
|
continue
|
||||||
if(GLOB.typecache_powerfailure_safe_areas[A.type])
|
if(GLOB.typecache_powerfailure_safe_areas[A.type])
|
||||||
@@ -30,9 +30,8 @@
|
|||||||
C.cell.charge = 0
|
C.cell.charge = 0
|
||||||
|
|
||||||
/proc/power_restore()
|
/proc/power_restore()
|
||||||
|
|
||||||
priority_announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", ANNOUNCER_POWERON)
|
priority_announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", ANNOUNCER_POWERON)
|
||||||
for(var/obj/machinery/power/apc/C in GLOB.machines)
|
for(var/obj/machinery/power/apc/C in GLOB.apcs_list)
|
||||||
if(C.cell && is_station_level(C.z))
|
if(C.cell && is_station_level(C.z))
|
||||||
C.cell.charge = C.cell.maxcharge
|
C.cell.charge = C.cell.maxcharge
|
||||||
COOLDOWN_RESET(C, failure_timer)
|
COOLDOWN_RESET(C, failure_timer)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/mob/living/silicon/ai/proc/get_camera_list()
|
/mob/living/silicon/ai/proc/get_camera_list()
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
for (var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
for (var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
L.Add(C)
|
L.Add(C)
|
||||||
|
|
||||||
camera_sort(L)
|
camera_sort(L)
|
||||||
|
|||||||
@@ -179,7 +179,7 @@
|
|||||||
// Returns the list of cameras accessible from this computer
|
// Returns the list of cameras accessible from this computer
|
||||||
/obj/machinery/computer/security/proc/get_available_cameras()
|
/obj/machinery/computer/security/proc/get_available_cameras()
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
for (var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
for (var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
if((is_away_level(z) || is_away_level(C.z)) && (C.z != z))//if on away mission, can only receive feed from same z_level cameras
|
if((is_away_level(z) || is_away_level(C.z)) && (C.z != z))//if on away mission, can only receive feed from same z_level cameras
|
||||||
continue
|
continue
|
||||||
L.Add(C)
|
L.Add(C)
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
if((!length(z_lock) || (myturf.z in z_lock)) && GLOB.cameranet.checkTurfVis(myturf))
|
if((!length(z_lock) || (myturf.z in z_lock)) && GLOB.cameranet.checkTurfVis(myturf))
|
||||||
camera_location = myturf
|
camera_location = myturf
|
||||||
else
|
else
|
||||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
if(!C.can_use() || length(z_lock) && !(C.z in z_lock))
|
if(!C.can_use() || length(z_lock) && !(C.z in z_lock))
|
||||||
continue
|
continue
|
||||||
var/list/network_overlap = networks & C.network
|
var/list/network_overlap = networks & C.network
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
|
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
|
|
||||||
for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras)
|
for (var/obj/machinery/camera/cam as anything in GLOB.cameranet.cameras)
|
||||||
if(length(origin.z_lock) && !(cam.z in origin.z_lock))
|
if(length(origin.z_lock) && !(cam.z in origin.z_lock))
|
||||||
continue
|
continue
|
||||||
L.Add(cam)
|
L.Add(cam)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
if(A.idSelf == idSelf)
|
if(A.idSelf == idSelf)
|
||||||
controller = A
|
controller = A
|
||||||
break
|
break
|
||||||
for(var/obj/machinery/door/airlock/I in GLOB.machines)
|
for(var/obj/machinery/door/airlock/I in GLOB.airlocks)
|
||||||
if(I.id_tag == idDoor)
|
if(I.id_tag == idDoor)
|
||||||
door = I
|
door = I
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
/obj/item/camera_bug/proc/get_cameras()
|
/obj/item/camera_bug/proc/get_cameras()
|
||||||
if( world.time > (last_net_update + 100))
|
if( world.time > (last_net_update + 100))
|
||||||
bugged_cameras = list()
|
bugged_cameras = list()
|
||||||
for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/camera as anything in GLOB.cameranet.cameras)
|
||||||
if(camera.machine_stat || !camera.can_use())
|
if(camera.machine_stat || !camera.can_use())
|
||||||
continue
|
continue
|
||||||
if(length(list("ss13","mine", "rd", "labor", "ordnance", "minisat") & camera.network))
|
if(length(list("ss13","mine", "rd", "labor", "ordnance", "minisat") & camera.network))
|
||||||
|
|||||||
@@ -321,7 +321,7 @@
|
|||||||
areas_with_air_alarm.Add(A.type)
|
areas_with_air_alarm.Add(A.type)
|
||||||
CHECK_TICK
|
CHECK_TICK
|
||||||
|
|
||||||
for(var/obj/machinery/requests_console/RC in GLOB.machines)
|
for(var/obj/machinery/requests_console/RC in GLOB.allConsoles)
|
||||||
var/area/A = get_area(RC)
|
var/area/A = get_area(RC)
|
||||||
if(!A)
|
if(!A)
|
||||||
dat += "Skipped over [RC] in invalid location, [RC.loc].<br>"
|
dat += "Skipped over [RC] in invalid location, [RC.loc].<br>"
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
areas_with_LS.Add(A.type)
|
areas_with_LS.Add(A.type)
|
||||||
CHECK_TICK
|
CHECK_TICK
|
||||||
|
|
||||||
for(var/obj/item/radio/intercom/I in GLOB.machines)
|
for(var/obj/item/radio/intercom/I as anything in GLOB.intercoms_list)
|
||||||
var/area/A = get_area(I)
|
var/area/A = get_area(I)
|
||||||
if(!A)
|
if(!A)
|
||||||
dat += "Skipped over [I] in invalid location, [I.loc].<br>"
|
dat += "Skipped over [I] in invalid location, [I.loc].<br>"
|
||||||
@@ -357,7 +357,7 @@
|
|||||||
areas_with_intercom.Add(A.type)
|
areas_with_intercom.Add(A.type)
|
||||||
CHECK_TICK
|
CHECK_TICK
|
||||||
|
|
||||||
for(var/obj/machinery/camera/C in GLOB.machines)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
var/area/A = get_area(C)
|
var/area/A = get_area(C)
|
||||||
if(!A)
|
if(!A)
|
||||||
dat += "Skipped over [C] in invalid location, [C.loc].<br>"
|
dat += "Skipped over [C] in invalid location, [C.loc].<br>"
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping)
|
|||||||
|
|
||||||
if(!on)
|
if(!on)
|
||||||
var/list/seen = list()
|
var/list/seen = list()
|
||||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
for(var/turf/T in C.can_see())
|
for(var/turf/T in C.can_see())
|
||||||
seen[T]++
|
seen[T]++
|
||||||
for(var/turf/T in seen)
|
for(var/turf/T in seen)
|
||||||
@@ -106,7 +106,7 @@ GLOBAL_LIST_EMPTY(dirty_vars)
|
|||||||
|
|
||||||
var/list/obj/machinery/camera/CL = list()
|
var/list/obj/machinery/camera/CL = list()
|
||||||
|
|
||||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
CL += C
|
CL += C
|
||||||
|
|
||||||
var/output = {"<B>Camera Abnormalities Report</B><HR>
|
var/output = {"<B>Camera Abnormalities Report</B><HR>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
GLOB.requests.message_centcom(sender.client, msg)
|
GLOB.requests.message_centcom(sender.client, msg)
|
||||||
msg = span_adminnotice("<b><font color=orange>CENTCOM:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]:</b> [msg]")
|
msg = span_adminnotice("<b><font color=orange>CENTCOM:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]:</b> [msg]")
|
||||||
to_chat(GLOB.admins, msg, confidential = TRUE)
|
to_chat(GLOB.admins, msg, confidential = TRUE)
|
||||||
for(var/obj/machinery/computer/communications/console in GLOB.machines)
|
for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list)
|
||||||
console.override_cooldown()
|
console.override_cooldown()
|
||||||
|
|
||||||
/// Used by communications consoles to message the Syndicate
|
/// Used by communications consoles to message the Syndicate
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
GLOB.requests.message_syndicate(sender.client, msg)
|
GLOB.requests.message_syndicate(sender.client, msg)
|
||||||
msg = span_adminnotice("<b><font color=crimson>SYNDICATE:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_SYNDICATE_REPLY(sender)]:</b> [msg]")
|
msg = span_adminnotice("<b><font color=crimson>SYNDICATE:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_SYNDICATE_REPLY(sender)]:</b> [msg]")
|
||||||
to_chat(GLOB.admins, msg, confidential = TRUE)
|
to_chat(GLOB.admins, msg, confidential = TRUE)
|
||||||
for(var/obj/machinery/computer/communications/console in GLOB.machines)
|
for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list)
|
||||||
console.override_cooldown()
|
console.override_cooldown()
|
||||||
|
|
||||||
/// Used by communications consoles to request the nuclear launch codes
|
/// Used by communications consoles to request the nuclear launch codes
|
||||||
@@ -74,5 +74,5 @@
|
|||||||
GLOB.requests.nuke_request(sender.client, msg)
|
GLOB.requests.nuke_request(sender.client, msg)
|
||||||
msg = span_adminnotice("<b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)] [ADMIN_SET_SD_CODE]:</b> [msg]")
|
msg = span_adminnotice("<b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)] [ADMIN_SET_SD_CODE]:</b> [msg]")
|
||||||
to_chat(GLOB.admins, msg, confidential = TRUE)
|
to_chat(GLOB.admins, msg, confidential = TRUE)
|
||||||
for(var/obj/machinery/computer/communications/console in GLOB.machines)
|
for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list)
|
||||||
console.override_cooldown()
|
console.override_cooldown()
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
|||||||
if("maint_access_engiebrig")
|
if("maint_access_engiebrig")
|
||||||
if(!is_debugger)
|
if(!is_debugger)
|
||||||
return
|
return
|
||||||
for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines)
|
for(var/obj/machinery/door/airlock/maintenance/M in GLOB.airlocks)
|
||||||
M.check_access()
|
M.check_access()
|
||||||
if (ACCESS_MAINT_TUNNELS in M.req_access)
|
if (ACCESS_MAINT_TUNNELS in M.req_access)
|
||||||
M.req_access = list()
|
M.req_access = list()
|
||||||
@@ -79,7 +79,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
|||||||
if("maint_access_brig")
|
if("maint_access_brig")
|
||||||
if(!is_debugger)
|
if(!is_debugger)
|
||||||
return
|
return
|
||||||
for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines)
|
for(var/obj/machinery/door/airlock/maintenance/M in GLOB.airlocks)
|
||||||
M.check_access()
|
M.check_access()
|
||||||
if (ACCESS_MAINT_TUNNELS in M.req_access)
|
if (ACCESS_MAINT_TUNNELS in M.req_access)
|
||||||
M.req_access = list(ACCESS_BRIG)
|
M.req_access = list(ACCESS_BRIG)
|
||||||
@@ -324,7 +324,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
|||||||
if(!is_funmin)
|
if(!is_funmin)
|
||||||
return
|
return
|
||||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station"))
|
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station"))
|
||||||
for(var/obj/machinery/door/airlock/W in GLOB.machines)
|
for(var/obj/machinery/door/airlock/W in GLOB.airlocks)
|
||||||
if(is_station_level(W.z) && !istype(get_area(W), /area/station/command) && !istype(get_area(W), /area/station/commons) && !istype(get_area(W), /area/station/service) && !istype(get_area(W), /area/station/command/heads_quarters) && !istype(get_area(W), /area/station/security/prison))
|
if(is_station_level(W.z) && !istype(get_area(W), /area/station/command) && !istype(get_area(W), /area/station/commons) && !istype(get_area(W), /area/station/service) && !istype(get_area(W), /area/station/command/heads_quarters) && !istype(get_area(W), /area/station/security/prison))
|
||||||
W.req_access = list()
|
W.req_access = list()
|
||||||
message_admins("[key_name_admin(holder)] activated Egalitarian Station mode")
|
message_admins("[key_name_admin(holder)] activated Egalitarian Station mode")
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
|
|||||||
INVOKE_ASYNC(D, TYPE_PROC_REF(/obj/machinery/door, hostile_lockdown), owner)
|
INVOKE_ASYNC(D, TYPE_PROC_REF(/obj/machinery/door, hostile_lockdown), owner)
|
||||||
addtimer(CALLBACK(D, TYPE_PROC_REF(/obj/machinery/door, disable_lockdown)), 900)
|
addtimer(CALLBACK(D, TYPE_PROC_REF(/obj/machinery/door, disable_lockdown)), 900)
|
||||||
|
|
||||||
var/obj/machinery/computer/communications/C = locate() in GLOB.machines
|
var/obj/machinery/computer/communications/C = locate() in GLOB.shuttle_caller_list
|
||||||
if(C)
|
if(C)
|
||||||
C.post_status("alert", "lockdown")
|
C.post_status("alert", "lockdown")
|
||||||
|
|
||||||
@@ -560,7 +560,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
|
|||||||
|
|
||||||
/datum/action/innate/ai/honk/Activate()
|
/datum/action/innate/ai/honk/Activate()
|
||||||
to_chat(owner, span_clown("The intercom system plays your prepared file as commanded."))
|
to_chat(owner, span_clown("The intercom system plays your prepared file as commanded."))
|
||||||
for(var/obj/item/radio/intercom/found_intercom in GLOB.intercoms_list)
|
for(var/obj/item/radio/intercom/found_intercom as anything in GLOB.intercoms_list)
|
||||||
if(!found_intercom.is_on() || !found_intercom.get_listening() || found_intercom.wires.is_cut(WIRE_RX)) //Only operating intercoms play the honk
|
if(!found_intercom.is_on() || !found_intercom.get_listening() || found_intercom.wires.is_cut(WIRE_RX)) //Only operating intercoms play the honk
|
||||||
continue
|
continue
|
||||||
found_intercom.audible_message(message = "[found_intercom] crackles for a split second.", hearing_distance = 3)
|
found_intercom.audible_message(message = "[found_intercom] crackles for a split second.", hearing_distance = 3)
|
||||||
@@ -750,10 +750,9 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
|
|||||||
|
|
||||||
/datum/action/innate/ai/reactivate_cameras/Activate()
|
/datum/action/innate/ai/reactivate_cameras/Activate()
|
||||||
var/fixed_cameras = 0
|
var/fixed_cameras = 0
|
||||||
for(var/V in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
if(!uses)
|
if(!uses)
|
||||||
break
|
break
|
||||||
var/obj/machinery/camera/C = V
|
|
||||||
if(!C.status || C.view_range != initial(C.view_range))
|
if(!C.status || C.view_range != initial(C.view_range))
|
||||||
C.toggle_cam(owner_AI, 0) //Reactivates the camera based on status. Badly named proc.
|
C.toggle_cam(owner_AI, 0) //Reactivates the camera based on status. Badly named proc.
|
||||||
C.view_range = initial(C.view_range)
|
C.view_range = initial(C.view_range)
|
||||||
@@ -782,8 +781,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
|
|||||||
AI.update_sight()
|
AI.update_sight()
|
||||||
|
|
||||||
var/upgraded_cameras = 0
|
var/upgraded_cameras = 0
|
||||||
for(var/V in GLOB.cameranet.cameras)
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
||||||
var/obj/machinery/camera/C = V
|
|
||||||
var/obj/structure/camera_assembly/assembly = C.assembly_ref?.resolve()
|
var/obj/structure/camera_assembly/assembly = C.assembly_ref?.resolve()
|
||||||
if(assembly)
|
if(assembly)
|
||||||
var/upgraded = FALSE
|
var/upgraded = FALSE
|
||||||
|
|||||||
@@ -13,11 +13,13 @@
|
|||||||
if(!.)
|
if(!.)
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
for(var/obj/machinery/power/supermatter_crystal/engine/crystal in GLOB.machines)
|
if(isnull(GLOB.main_supermatter_engine))
|
||||||
if(is_station_level(crystal.z) || is_mining_level(crystal.z))
|
|
||||||
return TRUE
|
|
||||||
|
|
||||||
return FALSE
|
return FALSE
|
||||||
|
var/obj/machinery/power/supermatter_crystal/engine/crystal = locate() in GLOB.main_supermatter_engine
|
||||||
|
if(!is_station_level(crystal.z) && !is_mining_level(crystal.z))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
return TRUE
|
||||||
|
|
||||||
/datum/traitor_objective/ultimate/supermatter_cascade/generate_objective(datum/mind/generating_for, list/possible_duplicates)
|
/datum/traitor_objective/ultimate/supermatter_cascade/generate_objective(datum/mind/generating_for, list/possible_duplicates)
|
||||||
var/list/possible_areas = GLOB.the_station_areas.Copy()
|
var/list/possible_areas = GLOB.the_station_areas.Copy()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
if(cooldown)
|
if(cooldown)
|
||||||
return
|
return
|
||||||
cooldown = TRUE
|
cooldown = TRUE
|
||||||
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
for(var/obj/machinery/door/poddoor/M in GLOB.airlocks)
|
||||||
if(M.id == src.id)
|
if(M.id == src.id)
|
||||||
if(openclose == null || !sync_doors)
|
if(openclose == null || !sync_doors)
|
||||||
openclose = M.density
|
openclose = M.density
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
if(cooldown)
|
if(cooldown)
|
||||||
return
|
return
|
||||||
cooldown = TRUE
|
cooldown = TRUE
|
||||||
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
for(var/obj/machinery/door/poddoor/M in GLOB.airlocks)
|
||||||
if (M.id == src.id)
|
if (M.id == src.id)
|
||||||
INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, open))
|
INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, open))
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
sleep(6 SECONDS)
|
sleep(6 SECONDS)
|
||||||
|
|
||||||
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
for(var/obj/machinery/door/poddoor/M in GLOB.airlocks)
|
||||||
if (M.id == src.id)
|
if (M.id == src.id)
|
||||||
INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, close))
|
INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, close))
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
to_chat(user, span_warning("CTF cannot be unloaded if it was not loaded in the first place"))
|
to_chat(user, span_warning("CTF cannot be unloaded if it was not loaded in the first place"))
|
||||||
return
|
return
|
||||||
to_chat(user, span_warning("CTF is being unloaded"))
|
to_chat(user, span_warning("CTF is being unloaded"))
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
CTF.unload()
|
CTF.unload()
|
||||||
log_admin("[key_name_admin(user)] has unloaded CTF.")
|
log_admin("[key_name_admin(user)] has unloaded CTF.")
|
||||||
message_admins("[key_name_admin(user)] has unloaded CTF.")
|
message_admins("[key_name_admin(user)] has unloaded CTF.")
|
||||||
@@ -214,7 +214,7 @@
|
|||||||
|
|
||||||
var/ctf_enabled = FALSE
|
var/ctf_enabled = FALSE
|
||||||
var/area/A
|
var/area/A
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(activated_id != CTF.game_id)
|
if(activated_id != CTF.game_id)
|
||||||
continue
|
continue
|
||||||
ctf_enabled = CTF.toggle_ctf()
|
ctf_enabled = CTF.toggle_ctf()
|
||||||
@@ -276,12 +276,14 @@
|
|||||||
|
|
||||||
/obj/machinery/capture_the_flag/Initialize(mapload)
|
/obj/machinery/capture_the_flag/Initialize(mapload)
|
||||||
. = ..()
|
. = ..()
|
||||||
|
GLOB.ctf_panel.ctf_machines += src
|
||||||
SSpoints_of_interest.make_point_of_interest(src)
|
SSpoints_of_interest.make_point_of_interest(src)
|
||||||
default_gear = ctf_gear
|
default_gear = ctf_gear
|
||||||
ctf_landmark = GLOB.ctf_spawner
|
ctf_landmark = GLOB.ctf_spawner
|
||||||
|
|
||||||
/obj/machinery/capture_the_flag/Destroy()
|
/obj/machinery/capture_the_flag/Destroy()
|
||||||
ctf_landmark = null
|
ctf_landmark = null
|
||||||
|
GLOB.ctf_panel.ctf_machines -= src
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/machinery/capture_the_flag/process(delta_time)
|
/obj/machinery/capture_the_flag/process(delta_time)
|
||||||
@@ -344,7 +346,7 @@
|
|||||||
if(!(GLOB.ghost_role_flags & GHOSTROLE_MINIGAME))
|
if(!(GLOB.ghost_role_flags & GHOSTROLE_MINIGAME))
|
||||||
to_chat(user, span_warning("CTF has been temporarily disabled by admins."))
|
to_chat(user, span_warning("CTF has been temporarily disabled by admins."))
|
||||||
return
|
return
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id && CTF.ctf_enabled)
|
if(CTF.game_id != game_id && CTF.ctf_enabled)
|
||||||
to_chat(user, span_warning("There is already an ongoing game in the [get_area(CTF)]!"))
|
to_chat(user, span_warning("There is already an ongoing game in the [get_area(CTF)]!"))
|
||||||
return
|
return
|
||||||
@@ -363,7 +365,7 @@
|
|||||||
spawn_team_member(new_team_member)
|
spawn_team_member(new_team_member)
|
||||||
return
|
return
|
||||||
|
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id || CTF == src || CTF.ctf_enabled == FALSE)
|
if(CTF.game_id != game_id || CTF == src || CTF.ctf_enabled == FALSE)
|
||||||
continue
|
continue
|
||||||
if(user.ckey in CTF.team_members)
|
if(user.ckey in CTF.team_members)
|
||||||
@@ -464,7 +466,7 @@
|
|||||||
competitor.dropItemToGround(W)
|
competitor.dropItemToGround(W)
|
||||||
competitor.dust()
|
competitor.dust()
|
||||||
control_point_reset()
|
control_point_reset()
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id)
|
if(CTF.game_id != game_id)
|
||||||
continue
|
continue
|
||||||
if(CTF.ctf_enabled == TRUE)
|
if(CTF.ctf_enabled == TRUE)
|
||||||
@@ -522,14 +524,14 @@
|
|||||||
machine_reset(src)
|
machine_reset(src)
|
||||||
|
|
||||||
/obj/machinery/capture_the_flag/proc/instagib_mode()
|
/obj/machinery/capture_the_flag/proc/instagib_mode()
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id)
|
if(CTF.game_id != game_id)
|
||||||
continue
|
continue
|
||||||
CTF.ctf_gear = CTF.instagib_gear
|
CTF.ctf_gear = CTF.instagib_gear
|
||||||
CTF.respawn_cooldown = INSTAGIB_RESPAWN
|
CTF.respawn_cooldown = INSTAGIB_RESPAWN
|
||||||
|
|
||||||
/obj/machinery/capture_the_flag/proc/normal_mode()
|
/obj/machinery/capture_the_flag/proc/normal_mode()
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id)
|
if(CTF.game_id != game_id)
|
||||||
continue
|
continue
|
||||||
CTF.ctf_gear = CTF.default_gear
|
CTF.ctf_gear = CTF.default_gear
|
||||||
@@ -601,13 +603,13 @@
|
|||||||
|
|
||||||
/obj/effect/ctf/dead_barricade/Initialize(mapload)
|
/obj/effect/ctf/dead_barricade/Initialize(mapload)
|
||||||
. = ..()
|
. = ..()
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id)
|
if(CTF.game_id != game_id)
|
||||||
continue
|
continue
|
||||||
CTF.dead_barricades += src
|
CTF.dead_barricades += src
|
||||||
|
|
||||||
/obj/effect/ctf/dead_barricade/Destroy()
|
/obj/effect/ctf/dead_barricade/Destroy()
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.game_id != game_id)
|
if(CTF.game_id != game_id)
|
||||||
continue
|
continue
|
||||||
CTF.dead_barricades -= src
|
CTF.dead_barricades -= src
|
||||||
@@ -649,7 +651,7 @@
|
|||||||
|
|
||||||
/obj/machinery/control_point/proc/capture(mob/user)
|
/obj/machinery/control_point/proc/capture(mob/user)
|
||||||
if(do_after(user, 30, target = src))
|
if(do_after(user, 30, target = src))
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(CTF.ctf_enabled && (user.ckey in CTF.team_members))
|
if(CTF.ctf_enabled && (user.ckey in CTF.team_members))
|
||||||
controlling = CTF
|
controlling = CTF
|
||||||
icon_state = "dominator-[CTF.team]"
|
icon_state = "dominator-[CTF.team]"
|
||||||
@@ -665,7 +667,7 @@
|
|||||||
. = TRUE
|
. = TRUE
|
||||||
if(ishuman(target))
|
if(ishuman(target))
|
||||||
var/mob/living/carbon/human/H = target
|
var/mob/living/carbon/human/H = target
|
||||||
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if(H in CTF.spawned_mobs)
|
if(H in CTF.spawned_mobs)
|
||||||
. = TRUE
|
. = TRUE
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new())
|
GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new())
|
||||||
|
|
||||||
/datum/ctf_panel
|
/datum/ctf_panel
|
||||||
|
///List of all CTF machines
|
||||||
|
var/list/obj/machinery/capture_the_flag/ctf_machines = list()
|
||||||
|
|
||||||
/datum/ctf_panel/ui_state(mob/user)
|
/datum/ctf_panel/ui_state(mob/user)
|
||||||
return GLOB.observer_state
|
return GLOB.observer_state
|
||||||
@@ -15,7 +17,7 @@ GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new())
|
|||||||
var/list/data = list()
|
var/list/data = list()
|
||||||
var/list/teams = list()
|
var/list/teams = list()
|
||||||
|
|
||||||
for(var/obj/machinery/capture_the_flag/team in GLOB.machines)
|
for(var/obj/machinery/capture_the_flag/team as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if (!team.ctf_enabled)
|
if (!team.ctf_enabled)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -79,7 +81,7 @@ GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new())
|
|||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/datum/ctf_panel/proc/ctf_enabled()
|
/datum/ctf_panel/proc/ctf_enabled()
|
||||||
for (var/obj/machinery/capture_the_flag/ctf_machine in GLOB.machines)
|
for (var/obj/machinery/capture_the_flag/ctf_machine as anything in GLOB.ctf_panel.ctf_machines)
|
||||||
if (ctf_machine.ctf_enabled)
|
if (ctf_machine.ctf_enabled)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
* The tram doors are in a list of tram_doors and we apply the proc on that list.
|
* The tram doors are in a list of tram_doors and we apply the proc on that list.
|
||||||
*/
|
*/
|
||||||
/datum/lift_master/tram/proc/update_tram_doors(action)
|
/datum/lift_master/tram/proc/update_tram_doors(action)
|
||||||
for(var/obj/machinery/door/window/tram_door in GLOB.machines)
|
for(var/obj/machinery/door/window/tram_door in GLOB.airlocks)
|
||||||
if(tram_door.associated_lift != specific_lift_id)
|
if(tram_door.associated_lift != specific_lift_id)
|
||||||
continue
|
continue
|
||||||
switch(action)
|
switch(action)
|
||||||
|
|||||||
@@ -412,7 +412,7 @@
|
|||||||
* * close: boolean, the state you want the curtains in.
|
* * close: boolean, the state you want the curtains in.
|
||||||
*/
|
*/
|
||||||
/datum/mafia_controller/proc/toggle_night_curtains(close)
|
/datum/mafia_controller/proc/toggle_night_curtains(close)
|
||||||
for(var/obj/machinery/door/poddoor/D in GLOB.machines) //I really dislike pathing of these
|
for(var/obj/machinery/door/poddoor/D in GLOB.airlocks) //I really dislike pathing of these
|
||||||
if(D.id != "mafia") //so as to not trigger shutters on station, lol
|
if(D.id != "mafia") //so as to not trigger shutters on station, lol
|
||||||
continue
|
continue
|
||||||
if(close)
|
if(close)
|
||||||
|
|||||||
@@ -332,8 +332,7 @@
|
|||||||
|
|
||||||
// hack to display shuttle timer
|
// hack to display shuttle timer
|
||||||
if(!EMERGENCY_IDLE_OR_RECALLED)
|
if(!EMERGENCY_IDLE_OR_RECALLED)
|
||||||
var/obj/machinery/computer/communications/C = locate() in GLOB.machines
|
for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list)
|
||||||
if(C)
|
|
||||||
C.post_status("shuttle")
|
C.post_status("shuttle")
|
||||||
|
|
||||||
/mob/living/silicon/ai/can_interact_with(atom/A, treat_mob_as_adjacent)
|
/mob/living/silicon/ai/can_interact_with(atom/A, treat_mob_as_adjacent)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new)
|
|||||||
var/name = "Camera Net"
|
var/name = "Camera Net"
|
||||||
|
|
||||||
/// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
|
/// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
|
||||||
var/list/cameras = list()
|
var/list/obj/machinery/camera/cameras = list()
|
||||||
/// The chunks of the map, mapping the areas that the cameras can see.
|
/// The chunks of the map, mapping the areas that the cameras can see.
|
||||||
var/list/chunks = list()
|
var/list/chunks = list()
|
||||||
var/ready = 0
|
var/ready = 0
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
// Returns the list of cameras accessible from this computer
|
// Returns the list of cameras accessible from this computer
|
||||||
/datum/computer_file/program/secureye/proc/get_available_cameras()
|
/datum/computer_file/program/secureye/proc/get_available_cameras()
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras)
|
for (var/obj/machinery/camera/cam as anything in GLOB.cameranet.cameras)
|
||||||
if(!is_station_level(cam.z))//Only show station cameras.
|
if(!is_station_level(cam.z))//Only show station cameras.
|
||||||
continue
|
continue
|
||||||
L.Add(cam)
|
L.Add(cam)
|
||||||
|
|||||||
@@ -110,11 +110,10 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/machinery/dna_vault/Destroy()
|
/obj/machinery/dna_vault/Destroy()
|
||||||
for(var/V in fillers)
|
for(var/obj/structure/filler/filler as anything in fillers)
|
||||||
var/obj/structure/filler/filler = V
|
|
||||||
filler.parent = null
|
filler.parent = null
|
||||||
qdel(filler)
|
qdel(filler)
|
||||||
. = ..()
|
return ..()
|
||||||
|
|
||||||
/obj/machinery/dna_vault/ui_interact(mob/user, datum/tgui/ui)
|
/obj/machinery/dna_vault/ui_interact(mob/user, datum/tgui/ui)
|
||||||
ui = SStgui.try_update_ui(user, src, ui)
|
ui = SStgui.try_update_ui(user, src, ui)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ GLOBAL_LIST_EMPTY_TYPED(station_goals, /datum/station_goal)
|
|||||||
|
|
||||||
/datum/station_goal/Destroy()
|
/datum/station_goal/Destroy()
|
||||||
GLOB.station_goals -= src
|
GLOB.station_goals -= src
|
||||||
. = ..()
|
return ..()
|
||||||
|
|
||||||
/datum/station_goal/Topic(href, href_list)
|
/datum/station_goal/Topic(href, href_list)
|
||||||
..()
|
..()
|
||||||
|
|||||||
Reference in New Issue
Block a user