From bf1e6af50898280d6c05fb691e2199da18db289b Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 30 Oct 2014 14:24:59 +0100 Subject: [PATCH] Z-Level Compatibility Now possible to configure 3 different kind of Z-levels. Station levels: Which Z-levels the station exists on. Contact levels: Which Z-levels are typically affected by, for example, Code Red which alters the visual state of fire alarms. Player levels: Which Z-levels a character can typically reach. --- .../computer3/computers/prisoner.dm | 2 +- code/__HELPERS/type2type.dm | 6 ++++++ code/controllers/configuration.dm | 17 +++++++++++++++-- code/game/area/Space Station 13 areas.dm | 4 ++-- code/game/gamemodes/blob/blob_report.dm | 2 +- code/game/gamemodes/events.dm | 12 ++++++------ code/game/gamemodes/events/power_failure.dm | 6 +++--- code/game/gamemodes/events/wormholes.dm | 2 +- code/game/gamemodes/gameticker.dm | 4 ++-- code/game/gamemodes/nuclear/nuclearbomb.dm | 2 +- .../gamemodes/revolution/anti_revolution.dm | 2 +- code/game/gamemodes/revolution/revolution.dm | 2 +- code/game/gamemodes/revolution/rp_revolution.dm | 2 +- code/game/machinery/alarm.dm | 5 +++-- code/game/machinery/computer/prisoner.dm | 2 +- code/modules/admin/admin.dm | 2 +- code/modules/admin/topic.dm | 6 +++--- code/modules/admin/verbs/diagnostics.dm | 2 +- code/modules/events/alien_infestation.dm | 2 +- code/modules/events/borers.dm | 2 +- code/modules/events/ion_storm.dm | 8 ++++---- code/modules/events/spider_infestation.dm | 2 +- code/modules/power/apc.dm | 10 +++++----- code/modules/power/smes.dm | 2 +- code/modules/security levels/security levels.dm | 8 ++++---- code/unused/_debug.dm | 2 +- config/example/config.txt | 9 +++++++++ 27 files changed, 77 insertions(+), 48 deletions(-) diff --git a/code/WorkInProgress/computer3/computers/prisoner.dm b/code/WorkInProgress/computer3/computers/prisoner.dm index 11aa5ebd6e..f1df9b2a59 100644 --- a/code/WorkInProgress/computer3/computers/prisoner.dm +++ b/code/WorkInProgress/computer3/computers/prisoner.dm @@ -43,7 +43,7 @@ if(!T.implanted) continue var/loc_display = "Unknown" var/mob/living/carbon/M = T.imp_in - if(M.z == 1 && !istype(M.loc, /turf/space)) + if(M.z in config.station_levels && !istype(M.loc, /turf/space)) var/turf/mob_loc = get_turf(M) loc_display = mob_loc.loc if(T.malfunction) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 8c188d0d18..1612f1ce7b 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -192,6 +192,12 @@ proc/tg_list2text(list/list, glue=",") . += copytext(text, last_found, found) last_found = found + delim_len while(found) + +/proc/text2numlist(text, delimiter="\n") + var/list/num_list = list() + for(var/x in text2list(text, delimiter)) + num_list += text2num(x) + return num_list //Case Sensitive! /proc/text2listEx(text, delimiter="\n") diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 8daa0c3e03..87aee98471 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -69,7 +69,7 @@ var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds... var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active. - + var/character_slots = 10 // The number of available character slots var/max_maint_drones = 5 //This many drones can spawn, @@ -151,6 +151,10 @@ var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge. var/use_overmap = 0 + var/list/station_levels = list(1) // Defines which Z-levels the station exists on. + var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect + var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach + /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode for (var/T in L) @@ -495,7 +499,7 @@ if("req_cult_ghostwriter") config.cult_ghostwriter_req_cultists = text2num(value) - + if("character_slots") config.character_slots = text2num(value) @@ -511,6 +515,15 @@ if("use_overmap") config.use_overmap = 1 + if("station_levels") + config.station_levels = text2numlist(value, ";") + + if("contact_levels") + config.contact_levels = text2numlist(value, ";") + + if("player_levels") + config.player_levels = text2numlist(value, ";") + else log_misc("Unknown setting in configuration: '[name]'") diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 8085e9eb02..2f4d87da4d 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -66,7 +66,7 @@ var/list/teleportlocs = list() if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue if(teleportlocs.Find(AR.name)) continue var/turf/picked = pick(get_area_turfs(AR.type)) - if (picked.z == 1) + if (picked.z in config.station_levels) teleportlocs += AR.name teleportlocs[AR.name] = AR @@ -83,7 +83,7 @@ var/list/ghostteleportlocs = list() ghostteleportlocs += AR.name ghostteleportlocs[AR.name] = AR var/turf/picked = pick(get_area_turfs(AR.type)) - if (picked.z == 1 || picked.z == 3 || picked.z == 4 || picked.z == 5) + if (picked.z in config.player_levels) ghostteleportlocs += AR.name ghostteleportlocs[AR.name] = AR diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index f58c59673c..46243b0df1 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -21,7 +21,7 @@ var/nukecode = "ERROR" for(var/obj/machinery/nuclearbomb/bomb in machines) if(bomb && bomb.r_code) - if(bomb.z == 1) + if(bomb.z in station_levels) nukecode = bomb.r_code interceptname = "Directive 7-12" intercepttext += "NanoTrasen Update: Biohazard Alert.
" diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 2fa881b5b6..53b9186a3e 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -57,7 +57,7 @@ var/list/turfs = new var/turf/picked for(var/turf/simulated/floor/T in world) - if(T.z == 1) + if(T.z in station_levels) turfs += T for(var/turf/simulated/floor/T in turfs) if(prob(20)) @@ -185,7 +185,7 @@ //world << sound('sound/AI/aliens.ogg') var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels) if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent @@ -444,21 +444,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing APCs" for (var/obj/machinery/power/apc/APC in world) - if(APC.z == 1) + if(APC.z in station_levels) APC.ion_act() apcnum++ world << "Finished processing APCs. Processed: [apcnum]" spawn(0) world << "Started processing SMES" for (var/obj/machinery/power/smes/SMES in world) - if(SMES.z == 1) + if(SMES.z in station_levels) SMES.ion_act() smesnum++ world << "Finished processing SMES. Processed: [smesnum]" spawn(0) world << "Started processing AIRLOCKS" for (var/obj/machinery/door/airlock/D in world) - if(D.z == 1) + if(D.z in station_levels) //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks airlocknum++ spawn(0) @@ -467,7 +467,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing FIREDOORS" for (var/obj/machinery/door/firedoor/D in world) - if(D.z == 1) + if(D.z in station_levels) firedoornum++; spawn(0) D.ion_act() diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index 87dd5f335c..ed82647615 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -7,7 +7,7 @@ for(var/obj/machinery/power/smes/S in world) var/area/current_area = get_area(S) - if(current_area.type in skipped_areas || S.z != 1) + if(current_area.type in skipped_areas || !(S.z in config.station_levels)) continue S.last_charge = S.charge S.last_output = S.output @@ -20,7 +20,7 @@ for(var/obj/machinery/power/apc/C in world) - if(C.cell && C.z == 1) + if(C.cell && C.z in config.station_levels) C.cell.charge = 0 /proc/power_restore(var/announce = 1) @@ -29,7 +29,7 @@ if(announce) command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') for(var/obj/machinery/power/apc/C in world) - if(C.cell && C.z == 1) + if(C.cell && C.z in config.station_levels) C.cell.charge = C.cell.maxcharge for(var/obj/machinery/power/smes/S in world) var/area/current_area = get_area(S) diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm index 311f6e5625..9a8066887b 100644 --- a/code/game/gamemodes/events/wormholes.dm +++ b/code/game/gamemodes/events/wormholes.dm @@ -2,7 +2,7 @@ spawn() var/list/pick_turfs = list() for(var/turf/simulated/floor/T in world) - if(T.z == 1) + if(T.z in config.station_levels) pick_turfs += T if(pick_turfs.len) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 53bb7fbd1a..568903ae89 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -201,7 +201,7 @@ var/global/datum/controller/gameticker/ticker switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) - if(T && T.z==1) //we don't use M.death(0) because it calls a for(/mob) loop and + if(T && T.z in config.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and M.health = 0 M.stat = DEAD if(1) //on a z-level 1 turf. @@ -261,7 +261,7 @@ var/global/datum/controller/gameticker/ticker world << sound('sound/effects/explosionfar.ogg') cinematic.icon_state = "summary_selfdes" for(var/mob/living/M in living_mob_list) - if(M.loc.z == 1) + if(M.loc.z in config.station_levels) M.death()//No mercy //If its actually the end of the round, wait for it to end. //Otherwise if its a verb it will continue on afterwards. diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index ce9082699f..4ab5961323 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -396,7 +396,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) var/off_station = 0 var/turf/bomb_location = get_turf(src) - if( bomb_location && (bomb_location.z == 1) ) + if(bomb_location && (bomb_location.z in config.station_levels)) if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) ) off_station = 1 else diff --git a/code/game/gamemodes/revolution/anti_revolution.dm b/code/game/gamemodes/revolution/anti_revolution.dm index 710b96e797..fce1cace91 100644 --- a/code/game/gamemodes/revolution/anti_revolution.dm +++ b/code/game/gamemodes/revolution/anti_revolution.dm @@ -134,7 +134,7 @@ /datum/game_mode/anti_revolution/proc/check_crew_victory() for(var/datum/mind/head_mind in heads) var/turf/T = get_turf(head_mind.current) - if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z == 1) && !head_mind.is_brigged(600)) + if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z in station_levels) && !head_mind.is_brigged(600)) if(ishuman(head_mind.current)) return 0 return 1 diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index d4159e55db..51f0dc7b3d 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -337,7 +337,7 @@ /datum/game_mode/revolution/proc/check_heads_victory() for(var/datum/mind/rev_mind in head_revolutionaries) var/turf/T = get_turf(rev_mind.current) - if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && T && (T.z == 1)) + if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && T && (T.z in config.station_levels)) if(ishuman(rev_mind.current)) return 0 return 1 diff --git a/code/game/gamemodes/revolution/rp_revolution.dm b/code/game/gamemodes/revolution/rp_revolution.dm index cbfe977230..2b9cc12e28 100644 --- a/code/game/gamemodes/revolution/rp_revolution.dm +++ b/code/game/gamemodes/revolution/rp_revolution.dm @@ -123,7 +123,7 @@ // probably wanna export this stuff into a separate function for use by both // revs and heads //assume that only carbon mobs can become rev heads for now - if(!rev_mind.current:handcuffed && T && T.z == 1) + if(!rev_mind.current:handcuffed && T && T.z in config.station_levels) return 0 return 1 diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 1e53a770ab..6ca98474f7 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -1488,8 +1488,9 @@ FIRE ALARM wiresexposed = 1 pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 - - if(z == 1 || z == 5) + +/obj/machinery/firealarm/initialize() + if(z in config.contact_levels) if(security_level) src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]") else diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index cb3e0f8f11..3bd94c747a 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -49,7 +49,7 @@ if(!T.implanted) continue var/loc_display = "Unknown" var/mob/living/carbon/M = T.imp_in - if(M.z == 1 && !istype(M.loc, /turf/space)) + if(M.z in config.station_levels && !istype(M.loc, /turf/space)) var/turf/mob_loc = get_turf(M) loc_display = mob_loc.loc if(T.malfunction) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 5b369dc9f4..670d52fced 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -973,7 +973,7 @@ var/global/floorIsLava = 0 if(3) var/count = 0 for(var/mob/living/carbon/monkey/Monkey in world) - if(Monkey.z == 1) + if(Monkey.z in station_levels) count++ return "Kill all [count] of the monkeys on the station" if(4) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index e2fc6dba68..3d2cea19b5 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2295,7 +2295,7 @@ message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1) for(var/turf/simulated/floor/F in world) - if(F.z == 1) + if(F.z in config.station_levels) F.name = "lava" F.desc = "The floor is LAVA!" F.overlays += "lava" @@ -2320,7 +2320,7 @@ sleep(10) for(var/turf/simulated/floor/F in world) // Reset everything. - if(F.z == 1) + if(F.z in config.station_levels) F.name = initial(F.name) F.desc = initial(F.desc) F.overlays.Cut() @@ -2368,7 +2368,7 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","EgL") for(var/obj/machinery/door/airlock/W in world) - if(W.z == 1 && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) + if(W.z in config.station_levels && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) W.req_access = list() message_admins("[key_name_admin(usr)] activated Egalitarian Station mode") command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg') diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index cbdc5ced9a..8c0575d080 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -17,7 +17,7 @@ var/inactive_on_main_station = 0 for(var/zone/zone in air_master.zones) var/turf/simulated/turf = locate() in zone.contents - if(turf && turf.z == 1) + if(turf && turf.z in config.station_levels) if(zone.needs_update) active_on_main_station++ else diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index d89f527e22..a9dd7ad77f 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -21,7 +21,7 @@ /datum/event/alien_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels) if(temp_vent.network.normal_members.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent diff --git a/code/modules/events/borers.dm b/code/modules/events/borers.dm index 20cd555a1b..d237dca937 100644 --- a/code/modules/events/borers.dm +++ b/code/modules/events/borers.dm @@ -20,7 +20,7 @@ /datum/event/borer_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) - if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels) //Stops cortical borers getting stuck in small networks. See: Security, Virology if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index dc69cd3357..c880955817 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -221,21 +221,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing APCs" for (var/obj/machinery/power/apc/APC in world) - if(APC.z == 1) + if(APC.z in station_levels) APC.ion_act() apcnum++ world << "Finished processing APCs. Processed: [apcnum]" spawn(0) world << "Started processing SMES" for (var/obj/machinery/power/smes/SMES in world) - if(SMES.z == 1) + if(SMES.z in station_levels) SMES.ion_act() smesnum++ world << "Finished processing SMES. Processed: [smesnum]" spawn(0) world << "Started processing AIRLOCKS" for (var/obj/machinery/door/airlock/D in world) - if(D.z == 1) + if(D.z in station_levels) //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks airlocknum++ spawn(0) @@ -244,7 +244,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing FIREDOORS" for (var/obj/machinery/door/firedoor/D in world) - if(D.z == 1) + if(D.z in station_levels) firedoornum++; spawn(0) D.ion_act() diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index a5b87954c1..1aedce4d47 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -19,7 +19,7 @@ /datum/event/spider_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) - if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index c0c8e2653a..bfedb92ed6 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -153,7 +153,7 @@ /obj/machinery/power/apc/Del() if(malfai && operating) if (ticker.mode.config_tag == "malfunction") - if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) + if (src.z in config.station_levels) //if (is_type_in_list(get_area(src), the_station_areas)) ticker.mode:apcs-- area.power_light = 0 area.power_equip = 0 @@ -919,7 +919,7 @@ malfai.malfhacking = 0 locked = 1 if (ticker.mode.config_tag == "malfunction") - if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) + if (src.z in config.station_levels) //if (is_type_in_list(get_area(src), the_station_areas)) ticker.mode:apcs++ if(usr:parent) src.malfai = usr:parent @@ -951,7 +951,7 @@ if(malfai) if (ticker.mode.config_tag == "malfunction") - if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) + if (src.z in config.station_levels) //if (is_type_in_list(get_area(src), the_station_areas)) operating ? ticker.mode:apcs++ : ticker.mode:apcs-- src.update() @@ -1017,7 +1017,7 @@ /obj/machinery/power/apc/proc/ion_act() //intended to be exactly the same as an AI malf attack - if(!src.malfhack && src.z == 1) + if(!src.malfhack && src.z in config.station_levels) if(prob(3)) src.locked = 1 if (src.cell.charge > 0) @@ -1300,7 +1300,7 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on) /obj/machinery/power/apc/proc/set_broken() if(malfai && operating) if (ticker.mode.config_tag == "malfunction") - if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) + if (src.z in config.station_levels) //if (is_type_in_list(get_area(src), the_station_areas)) ticker.mode:apcs-- // Aesthetically much better! src.visible_message("[src]'s screen flickers with warnings briefly!") diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index c39e922cae..17c6deef2c 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -333,7 +333,7 @@ /obj/machinery/power/smes/proc/ion_act() - if(src.z == 1) + if(src.z in config.station_levels) if(prob(1)) //explosion for(var/mob/M in viewers(src)) M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2) diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index ad1b300481..e96ed5b334 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -26,7 +26,7 @@ security_announcement_down.Announce("[config.alert_desc_green]", "Attention! Security level lowered to green") security_level = SEC_LEVEL_GREEN for(var/obj/machinery/firealarm/FA in machines) - if(FA.z == 1 || FA.z == 5) + if(FA.z in config.contact_levels) FA.overlays = list() FA.overlays += image('icons/obj/monitors.dmi', "overlay_green") if(SEC_LEVEL_BLUE) @@ -36,7 +36,7 @@ security_announcement_down.Announce("[config.alert_desc_blue_downto]", "Attention! Security level lowered to blue") security_level = SEC_LEVEL_BLUE for(var/obj/machinery/firealarm/FA in machines) - if(FA.z == 1 || FA.z == 5) + if(FA.z in config.contact_levels) FA.overlays = list() FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue") if(SEC_LEVEL_RED) @@ -52,7 +52,7 @@ CC.post_status("alert", "redalert")*/ for(var/obj/machinery/firealarm/FA in machines) - if(FA.z == 1 || FA.z == 5) + if(FA.z in config.contact_levels) FA.overlays = list() FA.overlays += image('icons/obj/monitors.dmi', "overlay_red") @@ -60,7 +60,7 @@ security_announcement_up.Announce("[config.alert_desc_delta]", "Attention! Delta security level reached!") security_level = SEC_LEVEL_DELTA for(var/obj/machinery/firealarm/FA in machines) - if(FA.z == 1 || FA.z == 5) + if(FA.z in config.contact_levels) FA.overlays = list() FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta") else diff --git a/code/unused/_debug.dm b/code/unused/_debug.dm index 271ee870a7..6b8bb9c3e3 100644 --- a/code/unused/_debug.dm +++ b/code/unused/_debug.dm @@ -528,7 +528,7 @@ Doing this because FindTurfs() isn't even used src << "Only administrators may use this command." return for(var/turf/T in world) - if(prob(4) && T.z == 1 && istype(T,/turf/station/floor)) + if(prob(4) && T.z in station_levels && istype(T,/turf/station/floor)) spawn(50+rand(0,3000)) var/obj/item/weapon/tank/plasmatank/pt = new /obj/item/weapon/tank/plasmatank( T ) pt.gas.temperature = 400+T0C diff --git a/config/example/config.txt b/config/example/config.txt index 6062108945..cfc417f1c8 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -263,3 +263,12 @@ CHARACTER_SLOTS 10 ## Uncomment to use overmap system for zlevel travel #USE_OVERMAP + +## Defines which Z-levels the station exists on. +STATION_LEVELS 1 + +## Defines which Z-levels which, for example, a Code Red announcement may affect +CONTACT_LEVELS 1;5 + +## Defines all Z-levels a character can typically reach +PLAYER_LEVELS 1;3;4;5;6