diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index d19c6138fc5..7220783038e 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -45,8 +45,20 @@ return heard +/proc/isStationLevel(var/level) + return level in config.station_levels +/proc/isNotStationLevel(var/level) + return !isStationLevel() +/proc/isPlayerLevel(var/level) + return level in config.player_levels + +/proc/isAdminLevel(var/level) + return level in config.admin_levels + +/proc/isNotAdminLevel(var/level) + return !isAdminLevel(level) //Magic constants obtained by using linear regression on right-angled triangles of sides 0 4)//Perhapse make a new core with a low prob return 0 @@ -62,7 +62,7 @@ if (istype(T, /turf/space)) numSpace += 1 else if(istype(T, /turf)) - if (M.z!=1) + if (isNotStationLevel(M.z)) numOffStation += 1 else numAlive += 1 diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 46243b0df13..d12bfaa7541 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -62,7 +62,7 @@ proc/count() for(var/turf/T in world) - if(T.z != 1) + if(isNotStationLevel(T.z) continue if(istype(T,/turf/simulated/floor)) @@ -84,7 +84,7 @@ src.r_wall += 1 for(var/obj/O in world) - if(O.z != 1) + if(isNotStationLevel(O.z)) continue if(istype(O, /obj/structure/window)) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 4bed45418ad..fdbc1e35fd3 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -12,7 +12,7 @@ var/list/sacrificed = list() for(var/obj/effect/rune/R in world) if(R == src) continue - if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && R.z != 2) + if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) index++ allrunesloc.len = index allrunesloc[index] = R.loc diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 53b9186a3e5..59aede3ac99 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -151,7 +151,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue for(var/datum/disease/D in H.viruses) foundAlready = 1 @@ -211,7 +211,7 @@ /* // Haha, this is way too laggy. I'll keep the prison break though. for(var/obj/machinery/light/L in world) - if(L.z != 1) continue + if(isNotStationLevel(L.z)) continue L.flicker(50) sleep(100) @@ -220,7 +220,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue if(istype(H,/mob/living/carbon/human)) H.apply_effect((rand(15,75)),IRRADIATE,0) @@ -237,7 +237,7 @@ var/turf/T = get_turf(M) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue M.apply_effect((rand(15,75)),IRRADIATE,0) sleep(100) diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index 8e7bd03a7dc..7f4f6f70201 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -78,8 +78,8 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 walk_towards(immrod, end,1) sleep(1) while (immrod) - if (immrod.z != 1) - immrod.z = 1 + if (isNotStationLevel(immrod.z)) + immrod.z = pick(config.station_levels) if(immrod.loc == end) del(immrod) sleep(10) diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index 378c6b24685..f2c510b9b98 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -83,7 +83,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. var/goal = locate(endx, endy, 1) src.x = startx src.y = starty - src.z = 1 + src.z = pick(config.station_levels) spawn(0) walk_towards(src, goal, 1) return diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm index 9203fa15e9d..ba1c2be13c3 100644 --- a/code/game/gamemodes/events/holidays/Christmas.dm +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -1,6 +1,6 @@ /proc/Christmas_Game_Start() for(var/obj/structure/flora/tree/pine/xmas in world) - if(xmas.z != 1) continue + if(isNotStationLevel(xmas.z)) continue for(var/turf/simulated/floor/T in orange(1,xmas)) for(var/i=1,i<=rand(1,5),i++) new /obj/item/weapon/a_gift(T) diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index 2cd06199bd8..cab426e455f 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -171,7 +171,7 @@ var/global/Holiday = null */ /* var/list/obj/containers = list() for(var/obj/item/weapon/storage/S in world) - if(S.z != 1) continue + if(isNotStationLevel(S.z)) continue containers += S message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/ diff --git a/code/game/gamemodes/events/miniblob.dm b/code/game/gamemodes/events/miniblob.dm index 127e877e96b..93fbbb8c2dd 100644 --- a/code/game/gamemodes/events/miniblob.dm +++ b/code/game/gamemodes/events/miniblob.dm @@ -21,7 +21,7 @@ sleep(-1) if(!blob_cores.len) break var/obj/effect/blob/B = pick(blob_cores) - if(B.z != 1) + if(isNotStationLevel(B.z)) continue B.Life() spawn(30) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index ed82647615e..3035a51ebd4 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -33,7 +33,7 @@ C.cell.charge = C.cell.maxcharge 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 || isNotStationLevel(S.z)) continue S.charge = S.last_charge S.output = S.last_output @@ -46,7 +46,7 @@ if(announce) command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') for(var/obj/machinery/power/smes/S in world) - if(S.z != 1) + if(isNotStationLevel(S.z)) continue S.charge = S.capacity S.output = 200000 diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 568903ae89c..cae571912e5 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -382,11 +382,11 @@ var/global/datum/controller/gameticker/ticker if(Player.stat != DEAD) var/turf/playerTurf = get_turf(Player) if(emergency_shuttle.departed && emergency_shuttle.evac) - if(playerTurf.z != 2) + if(isNotAdminLevel(playerTurf.z)) Player << "You managed to survive, but were marooned on [station_name()] as [Player.real_name]..." else Player << "You managed to survive the events on [station_name()] as [Player.real_name]." - else if(playerTurf.z == 2) + else if(isAdminLevel(playerTurf.z)) Player << "You successfully underwent crew transfer after events on [station_name()] as [Player.real_name]." else if(issilicon(Player)) Player << "You remain operational after the events on [station_name()] as [Player.real_name]." diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 8cf15cfd59a..24472446755 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1404,7 +1404,7 @@ datum var/turf/T = get_turf(target.current) if(target.current.stat == 2) return 1 - else if((T) && (T.z != 1))//If they leave the station they count as dead for this + else if((T) && (isNotStationLevel(T.z)))//If they leave the station they count as dead for this return 2 else return 0 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index e2cc152c8eb..d2fae33e86a 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -88,7 +88,7 @@ datum/objective/mutiny if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey) return 1 var/turf/T = get_turf(target.current) - if(T && (T.z != 1)) //If they leave the station they count as dead for this + if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this return 2 return 0 return 1 @@ -123,7 +123,7 @@ datum/objective/mutiny/rp if(target in ticker.mode:head_revolutionaries) return 1 var/turf/T = get_turf(target.current) - if(T && (T.z != 1)) //If they leave the station they count as dead for this + if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this rval = 2 return 0 return rval diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 51f0dc7b3d4..051c112bbb4 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -367,7 +367,7 @@ if(headrev.current) if(headrev.current.stat == DEAD) text += "died" - else if(headrev.current.z != 1) + else if(isNotStationLevel(headrev.current.z)) text += "fled the station" else text += "survived the revolution" @@ -390,7 +390,7 @@ if(rev.current) if(rev.current.stat == DEAD) text += "died" - else if(rev.current.z != 1) + else if(isNotStationLevel(rev.current.z)) text += "fled the station" else text += "survived the revolution" @@ -415,7 +415,7 @@ if(head.current) if(head.current.stat == DEAD) text += "died" - else if(head.current.z != 1) + else if(isNotStationLevel(head.current.z)) text += "fled the station" else text += "survived the revolution" diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm index 0b94990cd2f..d19c0615784 100644 --- a/code/game/mecha/medical/medical.dm +++ b/code/game/mecha/medical/medical.dm @@ -1,7 +1,7 @@ /obj/mecha/medical/New() ..() var/turf/T = get_turf(src) - if(T.z != 2) + if(isPlayerLevel(T.z)) new /obj/item/mecha_parts/mecha_tracking(src) return diff --git a/code/game/mecha/working/working.dm b/code/game/mecha/working/working.dm index 83df31f8c19..ea12b02df21 100644 --- a/code/game/mecha/working/working.dm +++ b/code/game/mecha/working/working.dm @@ -6,7 +6,7 @@ /obj/mecha/working/New() ..() var/turf/T = get_turf(src) - if(T.z != 2) + if(isPlayerLevel(T.z)) new /obj/item/mecha_parts/mecha_tracking(src) return diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 3d2cea19b5f..6210c05a8b6 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1283,11 +1283,11 @@ foo += text("Is an AI | ") else foo += text("Make AI | ", src, M) - if(M.z != 2) + if(isNotAdminLevel(M.z)) foo += text("Prison | ", src, M) foo += text("Maze | ", src, M) else - foo += text("On Z = 2 | ") + foo += text("On Z = [M.z] | ") else foo += text("Hasn't Entered Game | ") foo += text("Heal/Revive | ", src, M) diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index 24e35aa1e20..a83ab152ced 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -14,7 +14,7 @@ /datum/event/brand_intelligence/start() for(var/obj/machinery/vending/V in machines) - if(V.z != 1) continue + if(isNotStationLevel(V.z)) continue vendingMachines.Add(V) if(!vendingMachines.len) diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index 076b5f3104f..b9e4d1408cb 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -17,7 +17,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue for(var/datum/disease/D in H.viruses) foundAlready = 1 diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm index 6a6c0f7320e..1ff3dacab33 100644 --- a/code/modules/events/radiation_storm.dm +++ b/code/modules/events/radiation_storm.dm @@ -22,7 +22,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue if(istype(T.loc, /area/maintenance) || istype(T.loc, /area/crew_quarters)) continue @@ -43,7 +43,7 @@ var/turf/T = get_turf(M) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue M.apply_effect((rand(5,25)),IRRADIATE,0) sleep(100) diff --git a/code/modules/events/rogue_drones.dm b/code/modules/events/rogue_drones.dm index df40de5d4d5..15b7eebbb9b 100644 --- a/code/modules/events/rogue_drones.dm +++ b/code/modules/events/rogue_drones.dm @@ -41,7 +41,7 @@ var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() sparks.set_up(3, 0, D.loc) sparks.start() - D.z = 2 + D.z = config.admin_levels[1] D.has_loot = 0 del(D) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index bfedb92ed6c..6e888da4fd6 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -968,7 +968,7 @@ /*if(!malf.can_shunt) malf << "You cannot shunt." return*/ - if(src.z != 1) + if(isNotStationLevel(src.z)) return src.occupier = new /mob/living/silicon/ai(src,malf.laws,null,1) src.occupier.adjustOxyLoss(malf.getOxyLoss()) diff --git a/config/example/config.txt b/config/example/config.txt index cfc417f1c84..c7b7850c6fe 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -267,6 +267,9 @@ CHARACTER_SLOTS 10 ## Defines which Z-levels the station exists on. STATION_LEVELS 1 +## Defines which Z-levels are used for admin functionality, such as Central Command and the Syndicate Shuttle +ADMIN_LEVELS 2 + ## Defines which Z-levels which, for example, a Code Red announcement may affect CONTACT_LEVELS 1;5