diff --git a/code/__HELPERS/level_traits.dm b/code/__HELPERS/level_traits.dm new file mode 100644 index 00000000000..e2a74cf8e01 --- /dev/null +++ b/code/__HELPERS/level_traits.dm @@ -0,0 +1,17 @@ +// Helpers for checking whether a z-level conforms to a specific requirement + +// Basic levels +#define is_centcom_level(z) ((z) == ZLEVEL_CENTCOM) + +#define is_station_level(z) ((z) in GLOB.station_z_levels) + +#define is_mining_level(z) ((z) == ZLEVEL_MINING) + +#define is_reebe(z) ((z) == ZLEVEL_CITYOFCOGS) + +#define is_transit_level(z) ((z) == ZLEVEL_TRANSIT) + +#define is_away_level(z) ((z) > ZLEVEL_SPACEMAX) + +// If true, the singularity cannot strip away asteroid turf on this Z +#define is_planet_level(z) (GLOB.z_is_planet["z"]) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index efdb36c4251..7bb5fa4e93e 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -231,7 +231,7 @@ num_human_escapees++ if(shuttle_areas[get_area(Player)]) num_shuttle_escapees++ - + .[POPCOUNT_SURVIVORS] = num_survivors .[POPCOUNT_ESCAPEES] = num_escapees .[POPCOUNT_SHUTTLE_ESCAPEES] = num_shuttle_escapees @@ -243,7 +243,7 @@ var/list/parts = list() var/station_evacuated = EMERGENCY_ESCAPED_OR_ENDGAMED var/popcount = count_survivors() - + //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() @@ -442,7 +442,7 @@ text += " survived" if(fleecheck) var/turf/T = get_turf(ply.current) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) text += " while fleeing the station" if(ply.current.real_name != ply.name) text += " as [ply.current.real_name]" diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index aa1445df3b7..e80af492ab2 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1436,11 +1436,6 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) temp = ((temp + (temp>>3))&29127) % 63 //070707 return temp -//checks if a turf is in the planet z list. -/proc/turf_z_is_planet(turf/T) - return GLOB.z_is_planet["[T.z]"] - - //same as do_mob except for movables and it allows both to drift and doesn't draw progressbar /proc/do_atom(atom/movable/user , atom/movable/target, time = 30, uninterruptible = 0,datum/callback/extra_checks = null) if(!user || !target) diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index e86d32f76b2..fcf7dba607e 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -30,7 +30,7 @@ SUBSYSTEM_DEF(communications) /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) - if(!(C.stat & (BROKEN|NOPOWER)) && (C.z in GLOB.station_z_levels)) + if(!(C.stat & (BROKEN|NOPOWER)) && is_station_level(C.z)) if(unique) C.add_message(sending) else //We copy the message for each console, answers and deletions won't be shared diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 6b394c3a1fa..07c08cda551 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -146,7 +146,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) var/list/station_areas_blacklist = typecacheof(list(/area/space, /area/mine, /area/ruin)) for(var/area/A in world) var/turf/picked = safepick(get_area_turfs(A.type)) - if(picked && (picked.z in GLOB.station_z_levels)) + if(picked && is_station_level(picked.z)) if(!(A.type in GLOB.the_station_areas) && !is_type_in_typecache(A, station_areas_blacklist)) GLOB.the_station_areas.Add(A.type) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 463b82b13ef..4bead36bb12 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -61,7 +61,7 @@ SUBSYSTEM_DEF(minimap) for(var/z in z_levels) send_asset(client, "minimap_[z].png") -/datum/controller/subsystem/minimap/proc/generate(z = 1, x1 = 1, y1 = 1, x2 = world.maxx, y2 = world.maxy) +/datum/controller/subsystem/minimap/proc/generate(z, x1 = 1, y1 = 1, x2 = world.maxx, y2 = world.maxy) // Load the background. var/icon/minimap = new /icon('icons/minimap.dmi') // Scale it up to our target size. diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 65fb418953e..d1f81ef2118 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -323,7 +323,7 @@ SUBSYSTEM_DEF(shuttle) continue var/turf/T = get_turf(thing) - if(T && (T.z in GLOB.station_z_levels)) + if(T && is_station_level(T.z)) callShuttle = 0 break diff --git a/code/datums/antagonists/cult.dm b/code/datums/antagonists/cult.dm index df6aab45b00..78effa04bdf 100644 --- a/code/datums/antagonists/cult.dm +++ b/code/datums/antagonists/cult.dm @@ -257,7 +257,7 @@ var/sanity = 0 while(summon_spots.len < SUMMON_POSSIBILITIES && sanity < 100) var/area/summon = pick(GLOB.sortedAreas - summon_spots) - if(summon && (summon.z in GLOB.station_z_levels) && summon.valid_territory) + if(summon && is_station_level(summon.z) && summon.valid_territory) summon_spots += summon sanity++ update_explanation_text() diff --git a/code/datums/antagonists/nukeop.dm b/code/datums/antagonists/nukeop.dm index 8b7fc7826f1..441098aabd7 100644 --- a/code/datums/antagonists/nukeop.dm +++ b/code/datums/antagonists/nukeop.dm @@ -232,7 +232,7 @@ /datum/team/nuclear/proc/syndies_escaped() var/obj/docking_port/mobile/S = SSshuttle.getShuttle("syndicate") - return (S && (S.z == ZLEVEL_CENTCOM || S.z == ZLEVEL_TRANSIT)) + return S && (is_centcom_level(S.z) || is_transit_level(S.z)) /datum/team/nuclear/proc/get_result() var/evacuation = SSshuttle.emergency.mode == SHUTTLE_ENDGAME diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 60f90d61ad1..c3970baee06 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -408,7 +408,7 @@ AD.Refresh() for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) - if(!(H.z in GLOB.station_z_levels)) + if(!is_station_level(H.z)) continue if(!H.HasDisease(D)) H.ForceContractDisease(D) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 4e059f80767..98acae6d1bf 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -547,7 +547,7 @@ if(I == src) continue var/mob/M = I.current - if(M && (M.z in GLOB.station_z_levels) && !M.stat) + if(M && is_station_level(M.z) && !M.stat) last_healthy_headrev = FALSE break text += "head | not mindshielded | employee | [last_healthy_headrev ? "LAST " : ""]HEADREV | rev" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index a2564eaea99..f4965fea138 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -76,7 +76,7 @@ GLOBAL_LIST_EMPTY(teleportlocs) if(GLOB.teleportlocs[AR.name]) continue var/turf/picked = safepick(get_area_turfs(AR.type)) - if (picked && (picked.z in GLOB.station_z_levels)) + if (picked && is_station_level(picked.z)) GLOB.teleportlocs[AR.name] = AR sortTim(GLOB.teleportlocs, /proc/cmp_text_dsc) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 67e5697916c..eb63ca147ff 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -109,7 +109,7 @@ if(!T) return FALSE - if(T.z == ZLEVEL_TRANSIT) + if(is_transit_level(T.z)) for(var/A in SSshuttle.mobile) var/obj/docking_port/mobile/M = A if(M.launch_status == ENDGAME_TRANSIT) @@ -118,7 +118,7 @@ if(T in shuttle_area) return TRUE - if(T.z != ZLEVEL_CENTCOM)//if not, don't bother + if(!is_centcom_level(T.z))//if not, don't bother return FALSE //Check for centcom itself @@ -137,15 +137,15 @@ /atom/proc/onSyndieBase() var/turf/T = get_turf(src) if(!T) - return 0 + return FALSE - if(T.z != ZLEVEL_CENTCOM)//if not, don't bother - return 0 + if(!is_centcom_level(T.z))//if not, don't bother + return FALSE - if(istype(T.loc, /area/shuttle/syndicate) || istype(T.loc, /area/syndicate_mothership)) - return 1 + if(istype(T.loc, /area/shuttle/syndicate) || istype(T.loc, /area/syndicate_mothership) || istype(T.loc, /area/shuttle/assault_pod)) + return TRUE - return 0 + return FALSE /atom/proc/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) SendSignal(COMSIG_ATOM_HULK_ATTACK, user) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 077ed792074..83012750e00 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -579,8 +579,8 @@ /atom/movable/proc/in_bounds() . = FALSE - var/turf/currentturf = get_turf(src) - if(currentturf && (currentturf.z == ZLEVEL_CENTCOM || (currentturf.z in GLOB.station_z_levels) || currentturf.z == ZLEVEL_TRANSIT)) + var/turf/T = get_turf(src) + if (T && (is_centcom_level(T.z) || is_station_level(T.z) || is_transit_level(T.z))) . = TRUE diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index b6ddd5d8fdc..3b8937d9fb4 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -73,7 +73,7 @@ C.prefs.copy_to(M) M.key = C.key var/datum/mind/app_mind = M.mind - + var/datum/antagonist/wizard/apprentice/app = new(app_mind) app.master = user app.school = kind @@ -108,7 +108,7 @@ if(!user.mind.has_antag_datum(/datum/antagonist/nukeop,TRUE)) to_chat(user, "AUTHENTICATION FAILURE. ACCESS DENIED.") return FALSE - if(user.z != ZLEVEL_CENTCOM) + if(!user.onSyndieBase()) to_chat(user, "[src] is out of range! It can only be used at your base!") return FALSE return TRUE @@ -165,7 +165,7 @@ var/datum/antagonist/nukeop/creator_op = user.has_antag_datum(/datum/antagonist/nukeop,TRUE) if(!creator_op) return - + switch(borg_to_spawn) if("Medical") R = new /mob/living/silicon/robot/modules/syndicate/medical(T) @@ -187,7 +187,7 @@ R.real_name = R.name R.key = C.key - + var/datum/antagonist/nukeop/new_borg = new(R.mind) new_borg.send_to_spawnpoint = FALSE R.mind.add_antag_datum(new_borg,creator_op.nuke_team) @@ -208,7 +208,7 @@ /obj/item/antag_spawner/slaughter_demon/attack_self(mob/user) - if(!(user.z in GLOB.station_z_levels)) + if(!is_station_level(user.z)) to_chat(user, "You should probably wait until you reach the station.") return if(used) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index cc96a69f34a..f65c9ca768e 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -59,7 +59,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) /mob/camera/blob/proc/validate_location() var/turf/T = get_turf(src) var/area/A = get_area(T) - if(((A && !A.blob_allowed) || !T || !(T.z in GLOB.station_z_levels)) && LAZYLEN(GLOB.blobstart)) + if(((A && !A.blob_allowed) || !T || !is_station_level(T.z)) && LAZYLEN(GLOB.blobstart)) T = get_turf(pick(GLOB.blobstart)) if(!T) CRASH("No blobspawnpoints and blob spawned in nullspace.") @@ -83,7 +83,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) max_blob_points = INFINITY blob_points = INFINITY addtimer(CALLBACK(src, .proc/victory), 450) - + if(!victory_in_progress && max_count < blobs_legit.len) max_count = blobs_legit.len ..() @@ -95,7 +95,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) for(var/i in GLOB.mob_living_list) var/mob/living/L = i var/turf/T = get_turf(L) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) continue if(L in GLOB.overminds || (L.pass_flags & PASSBLOB)) diff --git a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm index 895c38c94a3..3d41d8aa8a5 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm @@ -165,13 +165,13 @@ var/list/teleportnames = list() for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in GLOB.all_clockwork_objects) - if(!O.Adjacent(invoker) && O != src && (O.z <= ZLEVEL_SPACEMAX) && O.anchored) //don't list obelisks that we're next to + if(!O.Adjacent(invoker) && O != src && !is_away_level(O.z) && O.anchored) //don't list obelisks that we're next to var/area/A = get_area(O) var/locname = initial(A.name) possible_targets[avoid_assoc_duplicate_keys("[locname] [O.name]", teleportnames)] = O for(var/mob/living/L in GLOB.alive_mob_list) - if(!L.stat && is_servant_of_ratvar(L) && !L.Adjacent(invoker) && (L.z <= ZLEVEL_SPACEMAX)) //People right next to the invoker can't be portaled to, for obvious reasons + if(!L.stat && is_servant_of_ratvar(L) && !L.Adjacent(invoker) && !is_away_level(L.z)) //People right next to the invoker can't be portaled to, for obvious reasons possible_targets[avoid_assoc_duplicate_keys("[L.name] ([L.real_name])", teleportnames)] = L if(!possible_targets.len) diff --git a/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm b/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm index 24e46e280f8..fc11da99713 100644 --- a/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm +++ b/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm @@ -94,7 +94,7 @@ fabrication_values["power_cost"] = 0 var/turf/Y = get_turf(user) - if(!Y || (!(Y.z in GLOB.station_z_levels) && Y.z != ZLEVEL_CENTCOM && Y.z != ZLEVEL_MINING && Y.z != ZLEVEL_LAVALAND)) + if(!Y || (!is_centcom_level(Y.z) && !is_station_level(Y.z) && !is_mining_level(Y.z))) fabrication_values["operation_time"] *= 2 if(fabrication_values["power_cost"] > 0) fabrication_values["power_cost"] *= 2 diff --git a/code/game/gamemodes/clock_cult/clock_mobs/_eminence.dm b/code/game/gamemodes/clock_cult/clock_mobs/_eminence.dm index 2a419415431..b53caee2815 100644 --- a/code/game/gamemodes/clock_cult/clock_mobs/_eminence.dm +++ b/code/game/gamemodes/clock_cult/clock_mobs/_eminence.dm @@ -93,7 +93,7 @@ to_chat(M, message) /mob/camera/eminence/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode) - if(z == ZLEVEL_CITYOFCOGS || is_servant_of_ratvar(speaker) || GLOB.ratvar_approaches || GLOB.ratvar_awakens) //Away from Reebe, the Eminence can't hear anything + if(is_reebe(z) || is_servant_of_ratvar(speaker) || GLOB.ratvar_approaches || GLOB.ratvar_awakens) //Away from Reebe, the Eminence can't hear anything to_chat(src, message) return to_chat(src, "[speaker] says something, but you can't understand any of it...") @@ -263,7 +263,7 @@ button_icon_state = "warp_down" /datum/action/innate/eminence/station_jump/Activate() - if(owner.z == ZLEVEL_CITYOFCOGS) + if(is_reebe(owner.z)) owner.forceMove(get_turf(pick(GLOB.generic_event_spawns))) owner.playsound_local(owner, 'sound/magic/magic_missile.ogg', 50, TRUE) flash_color(owner, flash_color = "#AF0AAF", flash_time = 25) diff --git a/code/game/gamemodes/clock_cult/clock_scripture.dm b/code/game/gamemodes/clock_cult/clock_scripture.dm index 94983923f94..046196f03a5 100644 --- a/code/game/gamemodes/clock_cult/clock_scripture.dm +++ b/code/game/gamemodes/clock_cult/clock_scripture.dm @@ -126,7 +126,7 @@ Applications: 8 servants, 3 caches, and 100 CV /datum/clockwork_scripture/proc/check_offstation_penalty() var/turf/T = get_turf(invoker) - if(!T || (!(T.z in GLOB.station_z_levels) && T.z != ZLEVEL_CENTCOM && T.z != ZLEVEL_MINING && T.z != ZLEVEL_LAVALAND && T.z != ZLEVEL_CITYOFCOGS)) + if(!T || (!is_centcom_level(T.z) && !is_station_level(T.z) && !is_mining_level(T.z) && !is_reebe(T.z))) channel_time *= 2 power_cost *= 2 return TRUE @@ -262,7 +262,7 @@ Applications: 8 servants, 3 caches, and 100 CV to_chat(invoker, "There are too many constructs of this type ([constructs])! You may only have [round(construct_limit)] at once.") return var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = GLOB.ark_of_the_clockwork_justiciar - if(G && !G.active && combat_construct && invoker.z == ZLEVEL_CITYOFCOGS && !confirmed) //Putting marauders on the base during the prep phase is a bad idea mmkay + if(G && !G.active && combat_construct && is_reebe(invoker.z) && !confirmed) //Putting marauders on the base during the prep phase is a bad idea mmkay if(alert(invoker, "This is a combat construct, and you cannot easily get it to the station. Are you sure you want to make one here?", "Construct Alert", "Yes", "Cancel") == "Cancel") return if(!is_servant_of_ratvar(invoker) || !invoker.canUseTopic(slab)) diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm index 8275e4d20ed..7e05e6a1870 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm @@ -209,7 +209,7 @@ quickbind_desc = "Returns you to Reebe." /datum/clockwork_scripture/abscond/check_special_requirements() - if(invoker.z == ZLEVEL_CITYOFCOGS) + if(is_reebe(invoker.z)) to_chat(invoker, "You're already at Reebe.") return return TRUE diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 8aebf1d1969..3f05cb4bfea 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -203,7 +203,7 @@ This file contains the arcane tome files. A = get_area(src) if(!src || QDELETED(src) || !Adjacent(user) || user.incapacitated() || !check_rune_turf(Turf, user)) return - + //AAAAAAAAAAAAAAAH, i'm rewriting enough for now so TODO: remove this shit if(ispath(rune_to_scribe, /obj/effect/rune/narsie)) if(!summon_objective) @@ -266,10 +266,8 @@ This file contains the arcane tome files. to_chat(user, "There is already a rune here.") return FALSE - - if(!(T.z in GLOB.station_z_levels) && T.z != ZLEVEL_MINING) + if(!is_station_level(T.z) && !is_mining_level(T.z)) to_chat(user, "The veil is not weak enough here.") - return FALSE return TRUE diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index e15b448b56f..6dab01f9679 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -268,7 +268,7 @@ structure_check() searches for nearby cultist structures required for the invoca var/list/teleportnames = list() for(var/R in GLOB.teleport_runes) var/obj/effect/rune/teleport/T = R - if(T != src && (T.z <= ZLEVEL_SPACEMAX)) + if(T != src && !is_away_level(T.z)) potential_runes[avoid_assoc_duplicate_keys(T.listkey, teleportnames)] = T if(!potential_runes.len) @@ -277,7 +277,8 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() return - if(user.z > ZLEVEL_SPACEMAX) + var/turf/T = get_turf(src) + if(is_away_level(T.z)) to_chat(user, "You are not in the right dimension!") log_game("Teleport rune failed - user in away mission") fail_invoke() @@ -289,7 +290,6 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() return - var/turf/T = get_turf(src) var/turf/target = get_turf(actual_selected_rune) if(is_blocked_turf(target, TRUE)) to_chat(user, "The target rune is blocked. Attempting to teleport to it would be massively unwise.") @@ -479,7 +479,7 @@ structure_check() searches for nearby cultist structures required for the invoca /obj/effect/rune/narsie/invoke(var/list/invokers) if(used) return - if(!(z in GLOB.station_z_levels)) + if(!is_station_level(z)) return if(locate(/obj/singularity/narsie) in GLOB.poi_list) @@ -826,7 +826,7 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() log_game("Summon Cultist rune failed - target was deconverted") return - if(cultist_to_summon.z > ZLEVEL_SPACEMAX) + if(is_away_level(cultist_to_summon.z)) to_chat(user, "[cultist_to_summon] is not in our dimension!") fail_invoke() log_game("Summon Cultist rune failed - target in away mission") diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 7ab96cd2748..588b45d5f68 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -65,7 +65,7 @@ log_game("Teleport talisman failed - no other teleport runes") return ..(user, 0) - if(user.z > ZLEVEL_SPACEMAX) + if(is_away_level(user.z)) to_chat(user, "You are not in the right dimension!") log_game("Teleport talisman failed - user in away mission") return ..(user, 0) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 743a4aea3c3..6013b48016c 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -1,7 +1,7 @@ /proc/power_failure() priority_announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure", 'sound/ai/poweroff.ogg') for(var/obj/machinery/power/smes/S in GLOB.machines) - if(istype(get_area(S), /area/ai_monitored/turret_protected) || !(S.z in GLOB.station_z_levels)) + if(istype(get_area(S), /area/ai_monitored/turret_protected) || !is_station_level(S.z)) continue S.charge = 0 S.output_level = 0 @@ -22,7 +22,7 @@ break if(A.contents) for(var/atom/AT in A.contents) - if(!(AT.z in GLOB.station_z_levels)) //Only check one, it's enough. + if(!is_station_level(AT.z)) //Only check one, it's enough. skip = 1 break if(skip) @@ -33,7 +33,7 @@ A.power_change() for(var/obj/machinery/power/apc/C in GLOB.apcs_list) - if(C.cell && (C.z in GLOB.station_z_levels)) + if(C.cell && is_station_level(C.z)) var/area/A = C.area var/skip = 0 @@ -50,11 +50,11 @@ priority_announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", 'sound/ai/poweron.ogg') for(var/obj/machinery/power/apc/C in GLOB.machines) - if(C.cell && (C.z in GLOB.station_z_levels)) + if(C.cell && is_station_level(C.z)) C.cell.charge = C.cell.maxcharge C.failure_timer = 0 for(var/obj/machinery/power/smes/S in GLOB.machines) - if(!(S.z in GLOB.station_z_levels)) + if(!is_station_level(S.z)) continue S.charge = S.capacity S.output_level = S.output_level_max @@ -72,7 +72,7 @@ priority_announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", 'sound/ai/poweron.ogg') for(var/obj/machinery/power/smes/S in GLOB.machines) - if(!(S.z in GLOB.station_z_levels)) + if(!is_station_level(S.z)) continue S.charge = S.capacity S.output_level = S.output_level_max diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 4508e5ee86c..89624764914 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -233,7 +233,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/nuke_station/Activate() var/turf/T = get_turf(owner) - if(!istype(T) || !(T.z in GLOB.station_z_levels)) + if(!istype(T) || !is_station_level(T.z)) to_chat(owner, "You cannot activate the doomsday device while off-station!") return if(alert(owner, "Send arming signal? (true = arm, false = cancel)", "purge_all_life()", "confirm = TRUE;", "confirm = FALSE;") != "confirm = TRUE;") @@ -356,7 +356,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /obj/machinery/doomsday_device/process() var/turf/T = get_turf(src) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) minor_announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", TRUE) SSshuttle.clearHostileEnvironment(src) qdel(src) @@ -378,7 +378,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( for(var/i in GLOB.mob_living_list) var/mob/living/L = i var/turf/T = get_turf(L) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) continue if(issilicon(L)) continue @@ -425,7 +425,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/lockdown/Activate() for(var/obj/machinery/door/D in GLOB.airlocks) - if(!(D.z in GLOB.station_z_levels)) + if(!is_station_level(D.z)) continue INVOKE_ASYNC(D, /obj/machinery/door.proc/hostile_lockdown, owner) addtimer(CALLBACK(D, /obj/machinery/door.proc/disable_lockdown), 900) @@ -503,7 +503,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/break_fire_alarms/Activate() for(var/obj/machinery/firealarm/F in GLOB.machines) - if(!(F.z in GLOB.station_z_levels)) + if(!is_station_level(F.z)) continue F.emagged = TRUE to_chat(owner, "All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.") @@ -530,7 +530,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/break_air_alarms/Activate() for(var/obj/machinery/airalarm/AA in GLOB.machines) - if(!(AA.z in GLOB.station_z_levels)) + if(!is_station_level(AA.z)) continue AA.emagged = TRUE to_chat(owner, "All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.") @@ -753,7 +753,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/emergency_lights/Activate() for(var/obj/machinery/light/L in GLOB.machines) - if(L.z in GLOB.station_z_levels) + if(is_station_level(L.z)) L.no_emergency = TRUE INVOKE_ASYNC(L, /obj/machinery/light/.proc/update, FALSE) CHECK_TICK diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 28bbe3334fe..729a273c537 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -450,7 +450,7 @@ if(target == src) return - if(!(z in GLOB.station_z_levels) && z != ZLEVEL_LAVALAND) + if(!is_station_level(z) && !is_mining_level(z)) to_chat(src, "Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area.") return diff --git a/code/game/gamemodes/miniantags/monkey/monkey.dm b/code/game/gamemodes/miniantags/monkey/monkey.dm index 7e6d92d927d..71afe1c8233 100644 --- a/code/game/gamemodes/miniantags/monkey/monkey.dm +++ b/code/game/gamemodes/miniantags/monkey/monkey.dm @@ -67,7 +67,7 @@ var/datum/disease/D = new /datum/disease/transformation/jungle_fever() //ugly but unfortunately needed for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(!(H.z in GLOB.station_z_levels)) + if(!is_station_level(H.z)) continue if(H.mind && H.client && H.stat != DEAD) if(H.HasDisease(D)) diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm index 58128b89cee..ce750e6a88d 100644 --- a/code/game/gamemodes/nuclear/nuclear_challenge.dm +++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm @@ -67,7 +67,7 @@ if(GLOB.player_list.len < CHALLENGE_MIN_PLAYERS) to_chat(user, "The enemy crew is too small to be worth declaring war on.") return FALSE - if(user.z != ZLEVEL_CENTCOM) + if(!user.onSyndieBase()) to_chat(user, "You have to be at your base to use this.") return FALSE if(world.time-SSticker.round_start_time > CHALLENGE_TIME_LIMIT) diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 6dd7dfa9d67..1cc0abe76ac 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -451,12 +451,12 @@ var/off_station = 0 var/turf/bomb_location = get_turf(src) var/area/A = get_area(bomb_location) - if(bomb_location && (bomb_location.z in GLOB.station_z_levels)) + if(bomb_location && is_station_level(bomb_location.z)) if(istype(A, /area/space)) off_station = NUKE_NEAR_MISS if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE))) off_station = NUKE_NEAR_MISS - else if((istype(A, /area/syndicate_mothership) || (istype(A, /area/shuttle/syndicate)) && bomb_location.z == ZLEVEL_CENTCOM)) + else if(bomb_location.onSyndieBase()) off_station = NUKE_SYNDICATE_BASE else off_station = NUKE_MISS_STATION @@ -556,7 +556,7 @@ This is here to make the tiles around the station mininuke change when it's arme addtimer(CALLBACK(user, /atom/proc/add_atom_colour, (i % 2)? "#00FF00" : "#FF0000", ADMIN_COLOUR_PRIORITY), i) addtimer(CALLBACK(src, .proc/manual_suicide, user), 101) return MANUAL_SUICIDE - + /obj/item/disk/proc/manual_suicide(mob/living/user) user.remove_atom_colour(ADMIN_COLOUR_PRIORITY) user.visible_message("[user] was destroyed by the nuclear blast!") diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 0f2a1b0ec1c..4b147e94463 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -154,7 +154,7 @@ if(!target || !considered_alive(target) || considered_afk(target)) return TRUE var/turf/T = get_turf(target.current) - return T && !(T.z in GLOB.station_z_levels) + return T && !is_station_level(T.z) /datum/objective/mutiny/update_explanation_text() ..() diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index f20e16b36b2..71947fc682b 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -164,7 +164,7 @@ /datum/game_mode/revolution/proc/check_heads_victory() for(var/datum/mind/rev_mind in revolution.head_revolutionaries()) var/turf/T = get_turf(rev_mind.current) - if(!considered_afk(rev_mind) && considered_alive(rev_mind) && (T.z in GLOB.station_z_levels)) + if(!considered_afk(rev_mind) && considered_alive(rev_mind) && is_station_level(T.z)) if(ishuman(rev_mind.current)) return FALSE return TRUE diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 8a58c7fae58..47421721085 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -53,7 +53,7 @@ LAZYADD(myarea.cameras, src) proximity_monitor = new(src, 1) - if(mapload && (z in GLOB.station_z_levels) && prob(3) && !start_active) + if(mapload && is_station_level(z) && prob(3) && !start_active) toggle_cam() /obj/machinery/camera/Destroy() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 8bab6a9d9af..73e629e5617 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -124,7 +124,7 @@ /obj/machinery/computer/security/proc/get_available_cameras() var/list/L = list() for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) - if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve 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 recieve feed from same z_level cameras continue L.Add(C) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 02ce509970d..c90b6152d06 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -303,7 +303,7 @@ var/mob/camera/aiEye/remote/remote_eye = user.remote_control var/obj/machinery/computer/camera_advanced/ratvar/R = target var/turf/T = get_turf(remote_eye) - if(user.z != ZLEVEL_CITYOFCOGS || !(T.z in GLOB.station_z_levels)) + if(!is_reebe(user.z) || !is_station_level(T.z)) return if(isclosedturf(T)) to_chat(user, "You can't teleport into a wall.") diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index c1be7dbf90c..0707ca04270 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -9,7 +9,7 @@ var/authenticated = 0 var/auth_id = "Unknown" //Who is currently logged in? var/list/datum/comm_message/messages = list() - var/datum/comm_message/currmsg + var/datum/comm_message/currmsg var/datum/comm_message/aicurrmsg var/state = STATE_DEFAULT var/aistate = STATE_DEFAULT @@ -52,7 +52,7 @@ /obj/machinery/computer/communications/Topic(href, href_list) if(..()) return - if(!(z in GLOB.station_z_levels) && z != ZLEVEL_CENTCOM) //Can only use on centcom and SS13 + if(!is_station_level(z) && !is_centcom_level(z)) //Can only use on centcom and SS13 to_chat(usr, "Unable to establish a connection: \black You're too far away from the station!") return usr.set_machine(src) @@ -135,7 +135,7 @@ to_chat(usr, "Arrays recycling. Please stand by.") playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) return - + var/input = stripped_multiline_input(usr, "Please choose a message to transmit to allied stations. Please be aware that this process is very expensive, and abuse will lead to... termination.", "Send a message to an allied station.", "") if(!input || !(usr in view(1,src))) return diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 50689558492..525c474bd92 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -56,7 +56,7 @@ var/loc_display = "Unknown" var/mob/living/M = T.imp_in - if((Tr.z in GLOB.station_z_levels) && !isspaceturf(M.loc)) + if(is_station_level(Tr.z) && !isspaceturf(M.loc)) var/turf/mob_loc = get_turf(M) loc_display = mob_loc.loc diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm index fda89646097..10653f5a78a 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -203,7 +203,7 @@ var/turf/T = get_turf(AM) if(!T) return FALSE - if(T.z == ZLEVEL_CENTCOM || T.z > ZLEVEL_SPACEMAX) + if(is_centcom_level(T.z) || is_away_level(T.z)) return FALSE var/area/A = get_area(T) if(!A || A.noteleport) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index ae4af4072d7..5a306cac509 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -70,7 +70,7 @@ if(stat & NOPOWER) return - if(src.z in GLOB.station_z_levels) + if(is_station_level(z)) add_overlay("overlay_[GLOB.security_level]") else add_overlay("overlay_[SEC_LEVEL_GREEN]") @@ -124,7 +124,7 @@ var/list/data = list() data["emagged"] = emagged - if(src.z in GLOB.station_z_levels) + if(is_station_level(z)) data["seclevel"] = get_security_level() else data["seclevel"] = "green" diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index edcf422b583..706e14cae66 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -107,7 +107,7 @@ var/line1 var/line2 if(SSshuttle.supply.mode == SHUTTLE_IDLE) - if(SSshuttle.supply.z in GLOB.station_z_levels) + if(is_station_level(SSshuttle.supply.z)) line1 = "CARGO" line2 = "Docked" else @@ -140,7 +140,7 @@ var/obj/docking_port/mobile/shuttle = SSshuttle.supply var/shuttleMsg = null if (shuttle.mode == SHUTTLE_IDLE) - if (shuttle.z in GLOB.station_z_levels) + if (is_station_level(shuttle.z)) shuttleMsg = "Docked" else shuttleMsg = "[shuttle.getModeStr()]: [shuttle.getTimerStr()]" diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 868c9ee7280..e72964c79d0 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -42,7 +42,7 @@ return power_station /obj/machinery/teleport/hub/CollidedWith(atom/movable/AM) - if(z == ZLEVEL_CENTCOM) + if(is_centcom_level(z)) to_chat(AM, "You can't use this here.") return if(is_ready()) diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 385d1125429..b82a46b7e04 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -13,7 +13,7 @@ range = RANGED /obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target) - if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) + if(!action_checks(target) || is_centcom_level(loc.z)) return var/turf/T = get_turf(target) if(T) @@ -34,7 +34,7 @@ /obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target) - if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) + if(!action_checks(target) || is_centcom_level(loc.z)) return var/list/theareas = get_areas_in_range(100, chassis) if(!theareas.len) diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 284ae40be25..318aaa9e246 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -425,14 +425,14 @@ Code: switch(SSshuttle.supply.mode) if(SHUTTLE_CALL) menu += "Moving to " - if(!(SSshuttle.supply.z in GLOB.station_z_levels)) + if(!is_station_level(SSshuttle.supply.z)) menu += "station" else menu += "centcom" menu += " ([SSshuttle.supply.timeLeft(600)] Mins)" else menu += "At " - if(!(SSshuttle.supply.z in GLOB.station_z_levels)) + if(!is_station_level(SSshuttle.supply.z)) menu += "centcom" else menu += "station" diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 533858b748c..84cd51fe229 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -72,7 +72,7 @@ /obj/item/storage/backpack/holding/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/living/user) if((istype(W, /obj/item/storage/backpack/holding) || count_by_type(W.GetAllContents(), /obj/item/storage/backpack/holding))) var/turf/loccheck = get_turf(src) - if(loccheck.z == ZLEVEL_CITYOFCOGS) + if(is_reebe(loccheck.z)) user.visible_message("An unseen force knocks [user] to the ground!", "\"I think not!\"") user.Knockdown(60) return diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index 49aa5b53636..c3022a77588 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -53,7 +53,7 @@ Frequency: if (usr.stat || usr.restrained()) return var/turf/current_location = get_turf(usr)//What turf is the user on? - if(!current_location || current_location.z == ZLEVEL_CENTCOM)//If turf was not found or they're on CentCom + if(!current_location || is_centcom_level(current_location.z))//If turf was not found or they're on CentCom to_chat(usr, "[src] is malfunctioning.") return if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc))) @@ -168,7 +168,7 @@ Frequency: /obj/item/hand_tele/attack_self(mob/user) var/turf/current_location = get_turf(user)//What turf is the user on? var/area/current_area = current_location.loc - if(!current_location || current_area.noteleport || current_location.z > ZLEVEL_SPACEMAX || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf + if(!current_location || current_area.noteleport || is_away_level(current_location.z) || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf to_chat(user, "\The [src] is malfunctioning.") return var/list/L = list( ) @@ -206,7 +206,7 @@ Frequency: return current_location = get_turf(user) //Recheck. current_area = current_location.loc - if(!current_location || current_area.noteleport || current_location.z > ZLEVEL_SPACEMAX || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf + if(!current_location || current_area.noteleport || is_away_level(current_location.z) || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf to_chat(user, "\The [src] is malfunctioning.") return user.show_message("Locked In.", 2) diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 271e8982143..83549a56d20 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -63,7 +63,7 @@ canSmoothWith += /turf/open/indestructible/clock_spawn_room //list overrides are a terrible thing . = ..() ratvar_act() - if(z == ZLEVEL_CITYOFCOGS) + if(is_reebe(z)) resistance_flags |= INDESTRUCTIBLE /obj/structure/lattice/clockwork/ratvar_act() @@ -120,7 +120,7 @@ if(!mapload) new /obj/effect/temp_visual/ratvar/floor/catwalk(loc) new /obj/effect/temp_visual/ratvar/beam/catwalk(loc) - if(z == ZLEVEL_CITYOFCOGS) + if(is_reebe(z)) resistance_flags |= INDESTRUCTIBLE /obj/structure/lattice/catwalk/clockwork/ratvar_act() diff --git a/code/game/turfs/simulated/floor/plating/asteroid.dm b/code/game/turfs/simulated/floor/plating/asteroid.dm index 2cdac898b71..8ffcab79497 100644 --- a/code/game/turfs/simulated/floor/plating/asteroid.dm +++ b/code/game/turfs/simulated/floor/plating/asteroid.dm @@ -59,7 +59,7 @@ /turf/open/floor/plating/asteroid/singularity_act() - if(turf_z_is_planet(src)) + if(is_planet_level(z)) return ..() ScrapeAway() diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index fe9a5926bb1..a5753edcd13 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -4,7 +4,7 @@ #define RANDOM_LOWER_X 50 #define RANDOM_LOWER_Y 50 -/proc/spawn_rivers(target_z = 5, nodes = 4, turf_type = /turf/open/lava/smooth/lava_land_surface, whitelist_area = /area/lavaland/surface/outdoors, min_x = RANDOM_LOWER_X, min_y = RANDOM_LOWER_Y, max_x = RANDOM_UPPER_X, max_y = RANDOM_UPPER_Y) +/proc/spawn_rivers(target_z = ZLEVEL_LAVALAND, nodes = 4, turf_type = /turf/open/lava/smooth/lava_land_surface, whitelist_area = /area/lavaland/surface/outdoors, min_x = RANDOM_LOWER_X, min_y = RANDOM_LOWER_Y, max_x = RANDOM_UPPER_X, max_y = RANDOM_UPPER_Y) var/list/river_nodes = list() var/num_spawned = 0 while(num_spawned < nodes) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 10fba383207..79d9838ea24 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -605,7 +605,7 @@ /datum/admins/proc/unprison(mob/M in GLOB.mob_list) set category = "Admin" set name = "Unprison" - if (M.z == ZLEVEL_CENTCOM) + if (is_centcom_level(M.z)) SSjob.SendToLateJoin(M) message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]") log_admin("[key_name(usr)] has unprisoned [key_name(M)]") diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 22b60d130e5..e38f857cd46 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -360,7 +360,7 @@ if(isdrone(M)) drones++ continue - if(M.z == ZLEVEL_CENTCOM) + if(is_centcom_level(M.z)) living_skipped++ continue living_players++ diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index f0eddfa8f08..13e07e03687 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -447,7 +447,7 @@ return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station")) for(var/obj/machinery/door/airlock/W in GLOB.machines) - if((W.z in GLOB.station_z_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) + if(is_station_level(W.z) && !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") priority_announce("CentCom airlock control override activated. Please take this time to get acquainted with your coworkers.", null, 'sound/ai/commandreport.ogg') diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 89d284fca61..43454f3bd4e 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -528,7 +528,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) for(var/area/A in world) if(on_station) var/turf/picked = safepick(get_area_turfs(A.type)) - if(picked && (picked.z in GLOB.station_z_levels)) + if(picked && is_station_level(picked.z)) if(!(A.type in areas_all) && !is_type_in_typecache(A, station_areas_blacklist)) areas_all.Add(A.type) else if(!(A.type in areas_all)) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index ece3775872f..9035a343172 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -35,7 +35,7 @@ return FALSE if(onstation) var/turf/T = get_turf(applicant) - if(!(T.z in GLOB.station_z_levels)) + if(!is_station_level(T.z)) return FALSE if(conscious && applicant.stat) //incase you don't care about a certain antag being unconcious when made, ie if they have selfhealing abilities. return FALSE diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm index 78718c897c5..a54ced0cbc7 100644 --- a/code/modules/clothing/glasses/engine_goggles.dm +++ b/code/modules/clothing/glasses/engine_goggles.dm @@ -60,7 +60,7 @@ /obj/item/clothing/glasses/meson/engine/process() if(mode == MODE_MESON) var/turf/T = get_turf(src) - if(T && T.z == ZLEVEL_MINING) + if(T && is_mining_level(T.z)) toggle_mode(loc) return diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index be42be428a5..c34c219882d 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -40,7 +40,7 @@ for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in GLOB.machines) if(QDELETED(temp_vent)) continue - if((temp_vent.loc.z in GLOB.station_z_levels) && !temp_vent.welded) + if(is_station_level(temp_vent.loc.z) && !temp_vent.welded) var/datum/pipeline/temp_vent_parent = temp_vent.parents[1] //Stops Aliens getting stuck in small networks. //See: Security, Virology diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index c2f98be8d5d..68ec168a1e0 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -32,7 +32,7 @@ /datum/round_event/brand_intelligence/start() for(var/obj/machinery/vending/V in GLOB.machines) - if(!(V.z in GLOB.station_z_levels)) + if(!is_station_level(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 f33d8ec87a6..f2e3104ab8a 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -33,7 +33,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(!(T.z in GLOB.station_z_levels)) + if(!is_station_level(T.z)) continue if(!H.client) continue diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index 2ae44a5f841..8006d63b978 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -15,5 +15,5 @@ /datum/round_event/grid_check/start() for(var/P in GLOB.apcs_list) var/obj/machinery/power/apc/C = P - if(C.cell && (C.z in GLOB.station_z_levels)) + if(C.cell && is_station_level(C.z)) C.energy_fail(rand(30,120)) \ No newline at end of file diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index 56b40ab57da..fa0d5aadf85 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -100,7 +100,7 @@ /obj/machinery/shuttle_scrambler/process() if(active) - if(z in GLOB.station_z_levels) + if(is_station_level(z)) var/siphoned = min(SSshuttle.points,siphon_per_tick) SSshuttle.points -= siphoned credits_stored += siphoned @@ -208,7 +208,7 @@ /obj/docking_port/mobile/pirate/initiate_docking(obj/docking_port/stationary/new_dock, movement_direction, force=FALSE) . = ..() - if(. == DOCKING_SUCCESS && new_dock.z != ZLEVEL_TRANSIT) + if(. == DOCKING_SUCCESS && !is_transit_level(new_dock.z)) engines_cooling = TRUE addtimer(CALLBACK(src,.proc/reset_cooldown),engine_cooldown,TIMER_UNIQUE) @@ -252,7 +252,7 @@ var/list/results = list() for(var/atom/movable/AM in world) if(is_type_in_typecache(AM,GLOB.pirate_loot_cache)) - if(AM.z in GLOB.station_z_levels) + if(is_station_level(AM.z)) if(get_area(AM) == get_area(src)) //Should this be variable ? continue results += AM diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index 227bf149844..50ed1211c4f 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -31,7 +31,7 @@ var/list/potential = list() for(var/mob/living/simple_animal/L in GLOB.alive_mob_list) var/turf/T = get_turf(L) - if(!(T.z in GLOB.station_z_levels)) + if(!is_station_level(T.z)) continue if(!(L in GLOB.player_list) && !L.mind) potential += L diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index 046208b5ac8..a3c625e3963 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -22,7 +22,7 @@ /datum/round_event/spider_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in world) - if((temp_vent.loc.z in GLOB.station_z_levels) && !temp_vent.welded) + if(is_station_level(temp_vent.loc.z) && !temp_vent.welded) var/datum/pipeline/temp_vent_parent = temp_vent.parents[1] if(temp_vent_parent.other_atmosmch.len > 20) vents += temp_vent diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm index 65bafaf4016..5e911605756 100644 --- a/code/modules/events/vent_clog.dm +++ b/code/modules/events/vent_clog.dm @@ -19,7 +19,7 @@ /datum/round_event/vent_clog/setup() endWhen = rand(25, 100) for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent in GLOB.machines) - if((temp_vent.loc.z in GLOB.station_z_levels) && !temp_vent.welded) + if(is_station_level(temp_vent.loc.z) && !temp_vent.welded) var/datum/pipeline/temp_vent_parent = temp_vent.parents[1] if(temp_vent_parent.other_atmosmch.len > 20) vents += temp_vent diff --git a/code/modules/events/wizard/curseditems.dm b/code/modules/events/wizard/curseditems.dm index 00d8c3b829d..7bf92ffb0cf 100644 --- a/code/modules/events/wizard/curseditems.dm +++ b/code/modules/events/wizard/curseditems.dm @@ -38,7 +38,7 @@ ruins_wizard_loadout = 1 for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(ruins_spaceworthiness && !(H.z in GLOB.station_z_levels) || isspaceturf(H.loc) || isplasmaman(H)) + if(ruins_spaceworthiness && !is_station_level(H.z) || isspaceturf(H.loc) || isplasmaman(H)) continue //#savetheminers if(ruins_wizard_loadout && iswizard(H)) continue diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index 1cf4858ce79..9ac7d891917 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -58,7 +58,7 @@ ..() /obj/item/greentext/process() - if(new_holder && new_holder.z == ZLEVEL_CENTCOM)//you're winner! + if(new_holder && is_centcom_level(new_holder.z))//you're winner! to_chat(new_holder, "At last it feels like victory is assured!") if(!(new_holder in SSticker.mode.traitors)) SSticker.mode.traitors += new_holder.mind diff --git a/code/modules/events/wizard/petsplosion.dm b/code/modules/events/wizard/petsplosion.dm index 3459c803184..1624d3af312 100644 --- a/code/modules/events/wizard/petsplosion.dm +++ b/code/modules/events/wizard/petsplosion.dm @@ -8,7 +8,7 @@ /datum/round_event_control/wizard/petsplosion/preRunEvent() for(var/mob/living/simple_animal/F in GLOB.alive_mob_list) - if(!ishostile(F) && (F.z in GLOB.station_z_levels)) + if(!ishostile(F) && is_station_level(F.z)) mobs_to_dupe++ if(mobs_to_dupe > 100 || !mobs_to_dupe) return EVENT_CANT_RUN @@ -24,7 +24,7 @@ if(activeFor >= 30 * countdown) // 0 seconds : 2 animals | 30 seconds : 4 animals | 1 minute : 8 animals countdown += 1 for(var/mob/living/simple_animal/F in GLOB.alive_mob_list) //If you cull the heard before the next replication, things will be easier for you - if(!ishostile(F) && (F.z in GLOB.station_z_levels)) + if(!ishostile(F) && is_station_level(F.z)) new F.type(F.loc) mobs_duped++ if(mobs_duped > 400) diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index d622f10c973..18bde5eb071 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -13,7 +13,7 @@ var/list/mobs = list() for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(!(H.z in GLOB.station_z_levels)) + if(!is_station_level(H.z)) continue //lets not try to strand people in space or stuck in the wizards den moblocs += H.loc mobs += H diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm index dbaa8a1c22a..3a25df10d4a 100644 --- a/code/modules/events/wormholes.dm +++ b/code/modules/events/wormholes.dm @@ -21,7 +21,7 @@ /datum/round_event/wormholes/start() for(var/turf/open/floor/T in world) - if(T.z in GLOB.station_z_levels) + if(is_station_level(T.z)) pick_turfs += T for(var/i = 1, i <= number_of_wormholes, i++) diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index 13e2264b299..120a000f07d 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -67,7 +67,6 @@ GLOBAL_LIST_EMPTY(z_is_planet) /obj/effect/mapping_helpers/planet_z/Initialize() . = ..() var/turf/T = get_turf(src) - if(!turf_z_is_planet(T)) - GLOB.z_is_planet["[T.z]"] = list() + GLOB.z_is_planet["[T.z]"] = TRUE return INITIALIZE_HINT_QDEL diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 4e419646bc5..df20ce5921b 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -38,7 +38,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also var/list/options = params2list(possible_destinations) var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) - var/dat = "[(z in GLOB.station_z_levels) ? "Docking clamps engaged. Standing by." : "Mining Shuttle Uplink: [M ? M.getStatusText() : "*OFFLINE*"]"]
" + var/dat = "[is_station_level(z) ? "Docking clamps engaged. Standing by." : "Mining Shuttle Uplink: [M ? M.getStatusText() : "*OFFLINE*"]"]
" if(M) var/destination_found for(var/obj/docking_port/stationary/S in SSshuttle.stationary) @@ -48,7 +48,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also continue destination_found = 1 dat += "Send to [S.name]
" - if(!destination_found && (z in GLOB.station_z_levels)) //Only available if miners are lazy and did not set an LZ using the remote. + if(!destination_found && is_station_level(z)) //Only available if miners are lazy and did not set an LZ using the remote. dat += "Prepare for blind drop? (Dangerous)
" if(LAZYLEN(turrets)) dat += "
Perimeter Defense System: Enable All / Disable All
\ @@ -87,7 +87,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also return if(href_list["move"]) - if(!(z in GLOB.station_z_levels) && shuttleId == "colony_drop") + if(!is_station_level(z) && shuttleId == "colony_drop") to_chat(usr, "You can't move the base again!") return var/shuttle_error = SSshuttle.moveShuttle(shuttleId, href_list["move"], 1) @@ -129,7 +129,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also updateUsrDialog() /obj/machinery/computer/auxillary_base/proc/set_mining_mode() - if(z == ZLEVEL_MINING) //The console switches to controlling the mining shuttle once landed. + if(is_mining_level(z)) //The console switches to controlling the mining shuttle once landed. req_one_access = list() shuttleId = "mining" //The base can only be dropped once, so this gives the console a new purpose. possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public" @@ -146,7 +146,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also /turf/open/indestructible, )) - if(T.z != ZLEVEL_MINING) + if(!is_mining_level(T.z)) return BAD_ZLEVEL var/colony_radius = CEILING(max(base_dock.width, base_dock.height)*0.5, 1) @@ -211,7 +211,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also var/obj/machinery/computer/auxillary_base/AB for (var/obj/machinery/computer/auxillary_base/A in GLOB.machines) - if(A.z in GLOB.station_z_levels) + if(is_station_level(A.z)) AB = A break if(!AB) @@ -280,7 +280,7 @@ obj/docking_port/stationary/public_mining_dock var/turf/landing_spot = get_turf(src) - if(landing_spot.z != ZLEVEL_MINING) + if(!is_mining_level(landing_spot.z)) to_chat(user, "This device is only to be used in a mining zone.") return var/obj/machinery/computer/auxillary_base/aux_base_console diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index 4270b54b0a8..dd8e98823b0 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -151,7 +151,7 @@ to_chat(owner, "You can only build within the mining base!") return FALSE - if(!(build_target.z in GLOB.station_z_levels)) + if(!is_station_level(build_target.z)) to_chat(owner, "The mining base has launched and can no longer be modified.") return FALSE diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm index 4f4b16e6d32..573c3dab71c 100644 --- a/code/modules/mining/equipment/survival_pod.dm +++ b/code/modules/mining/equipment/survival_pod.dm @@ -60,7 +60,7 @@ playsound(get_turf(src), 'sound/effects/phasein.ogg', 100, 1) var/turf/T = deploy_location - if(T.z != ZLEVEL_MINING && T.z != ZLEVEL_LAVALAND)//only report capsules away from the mining/lavaland level + if(!is_mining_level(T.z)) //only report capsules away from the mining/lavaland level message_admins("[ADMIN_LOOKUPFLW(usr)] activated a bluespace capsule away from the mining level! [ADMIN_JMP(T)]") log_admin("[key_name(usr)] activated a bluespace capsule away from the mining level at [get_area(T)][COORD(T)]") template.load(deploy_location, centered = TRUE) diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index e69c8fa05dd..f714e3f471e 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -20,7 +20,7 @@ /obj/item/device/wormhole_jaunter/proc/turf_check(mob/user) var/turf/device_turf = get_turf(user) - if(!device_turf || device_turf.z == ZLEVEL_CENTCOM || device_turf.z == ZLEVEL_TRANSIT) + if(!device_turf || is_centcom_level(device_turf.z) || is_transit_level(device_turf.z)) to_chat(user, "You're having difficulties getting the [src.name] to work.") return FALSE return TRUE @@ -40,7 +40,7 @@ for(var/obj/item/device/radio/beacon/B in GLOB.teleportbeacons) var/turf/T = get_turf(B) - if(T.z in GLOB.station_z_levels) + if(is_station_level(T.z)) destinations += B return destinations diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 7b4773c5da8..60577ea7a97 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -587,7 +587,7 @@ to_chat(user, "You unfold the ladder. It extends much farther than you were expecting.") var/last_ladder = null for(var/i in 1 to world.maxz) - if(i == ZLEVEL_CENTCOM || i == ZLEVEL_TRANSIT || i == ZLEVEL_CITYOFCOGS) + if(is_centcom_level(i) || is_transit_level(i) || is_reebe(i)) continue var/turf/T2 = locate(ladder_x, ladder_y, i) last_ladder = new /obj/structure/ladder/unbreakable/jacob(T2, null, last_ladder) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index e16eb0e5b27..84e5bdeed1a 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -102,7 +102,7 @@ smelt_ore(ore) /obj/machinery/mineral/ore_redemption/proc/send_console_message() - if(!(z in GLOB.station_z_levels)) + if(!is_station_level(z)) return message_sent = TRUE var/area/A = get_area(src) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 8d3f62f18d2..ba4850eb476 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -75,7 +75,7 @@ var/global/list/dumb_rev_heads = list() /obj/machinery/computer/shuttle/mining/attack_hand(mob/user) - if((user.z in GLOB.station_z_levels) && user.mind && is_head_revolutionary(user) && !(user.mind in dumb_rev_heads)) + if(is_station_level(user.z) && user.mind && is_head_revolutionary(user) && !(user.mind in dumb_rev_heads)) to_chat(user, "You get a feeling that leaving the station might be a REALLY dumb idea...") dumb_rev_heads += user.mind return diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 7bf71caefe2..c68b5a32bcc 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -408,7 +408,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(drunkenness >= 91) adjustBrainLoss(0.4, 60) if(prob(20) && !stat) - if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && (z in GLOB.station_z_levels)) //QoL mainly + if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly to_chat(src, "You're so tired... but you can't miss that shuttle...") else to_chat(src, "Just a quick nap...") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1c5109ef40a..9c3401de661 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -761,9 +761,9 @@ var/turf/T = get_turf(src) if(!T) return 0 - if(T.z == ZLEVEL_CENTCOM) //dont detect mobs on centcom + if(is_centcom_level(T.z)) //dont detect mobs on centcom return 0 - if(T.z >= ZLEVEL_SPACEMAX) + if(is_away_level(T.z)) return 0 if(user != null && src == user) return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 59a9559ce80..5fd32e8c251 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -476,7 +476,7 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega toggle_ai(AI_Z_OFF) return - if (isturf(T) && !(T.z in GLOB.station_z_levels)) + if (isturf(T) && !is_station_level(T.z)) tlist = ListTargetsLazy(T.z) else tlist = ListTargets() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index 1db7855e104..0e67921f3d3 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -114,7 +114,7 @@ Difficulty: Medium if(L.stat == DEAD) visible_message("[src] butchers [L]!", "You butcher [L], restoring your health!") - if(!(z in GLOB.station_z_levels) || client) //NPC monsters won't heal while on station + if(!is_station_level(z) || client) //NPC monsters won't heal while on station if(guidance) adjustHealth(-L.maxHealth) else @@ -163,7 +163,7 @@ Difficulty: Medium // do not take my touching of it to be endorsement of it. ~mso /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/proc/quick_attack_loop() while(!QDELETED(target) && next_move <= world.time) //this is done this way because next_move can change to be sooner while we sleep. - stoplag(1) + stoplag(1) sleep((next_move - world.time) * 1.5) //but don't ask me what the fuck this is about if(QDELETED(target)) return diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 385ab2c668b..e85d503bcda 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -101,7 +101,7 @@ visible_message( "[src] devours [L]!", "You feast on [L], restoring your health!") - if(!(z in GLOB.station_z_levels) || client) //NPC monsters won't heal while on station + if(!is_station_level(z) || client) //NPC monsters won't heal while on station adjustBruteLoss(-L.maxHealth/2) L.gib() diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 616fd15dd31..310a0a5054b 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -13,7 +13,6 @@ var/has_alert = 0 var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list()) - var/alarm_z = list(ZLEVEL_STATION_PRIMARY,ZLEVEL_LAVALAND) /datum/computer_file/program/alarm_monitor/process_tick() ..() @@ -41,7 +40,7 @@ return data /datum/computer_file/program/alarm_monitor/proc/triggerAlarm(class, area/A, O, obj/source) - if(!(source.z in alarm_z)) + if(!is_station_level(source.z) && !is_mining_level(source.z)) return var/list/L = alarms[class] diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm index 2141f4fdd7f..c2cbd5afecc 100644 --- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm @@ -43,7 +43,7 @@ return for(var/obj/machinery/power/supermatter_shard/S in GLOB.machines) // Delaminating, not within coverage, not on a tile. - if(!((S.z in GLOB.station_z_levels) || S.z == ZLEVEL_MINING || S.z == T.z || !isturf(S.loc))) + if (!isturf(S.loc) || !(is_station_level(S.z) || is_mining_level(S.z) || S.z == T.z)) continue supermatters.Add(S) diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index 216d55fbd84..da108000558 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -47,7 +47,7 @@ if(holder) var/turf/T = get_turf(holder) - if((T && istype(T)) && ((T.z in GLOB.station_z_levels) || T.z == ZLEVEL_MINING)) + if((T && istype(T)) && (is_station_level(T.z) || is_mining_level(T.z))) // Computer is on station. Low/High signal depending on what type of network card you have if(long_range) return 2 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 548651f9c89..e8588a4634d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -941,7 +941,7 @@ if(!malf.can_shunt) to_chat(malf, "You cannot shunt!") return - if(!(src.z in GLOB.station_z_levels)) + if(!is_station_level(z)) return occupier = new /mob/living/silicon/ai(src, malf.laws, malf) //DEAR GOD WHY? //IKR???? occupier.adjustOxyLoss(malf.getOxyLoss()) diff --git a/code/modules/power/singularity/narsie.dm b/code/modules/power/singularity/narsie.dm index 15b76d26412..3465d354d40 100644 --- a/code/modules/power/singularity/narsie.dm +++ b/code/modules/power/singularity/narsie.dm @@ -61,7 +61,7 @@ var/mob/living/L = cult_mind.current L.narsie_act() for(var/mob/living/player in GLOB.player_list) - if(player.stat != DEAD && (player.loc.z in GLOB.station_z_levels) && !iscultist(player)) + if(player.stat != DEAD && is_station_level(player.loc.z) && !iscultist(player)) souls_needed[player] = TRUE soul_goal = round(1 + LAZYLEN(souls_needed) * 0.6) INVOKE_ASYNC(src, .proc/begin_the_end) diff --git a/code/modules/procedural_mapping/mapGenerators/lava_river.dm b/code/modules/procedural_mapping/mapGenerators/lava_river.dm index 8bdedb4b765..d825a02846b 100644 --- a/code/modules/procedural_mapping/mapGenerators/lava_river.dm +++ b/code/modules/procedural_mapping/mapGenerators/lava_river.dm @@ -1,6 +1,6 @@ /datum/mapGenerator/lavaland - var/start_z = 5 + var/start_z = ZLEVEL_LAVALAND var/min_x = 0 var/min_y = 0 var/max_x = 0 @@ -19,7 +19,7 @@ /datum/mapGeneratorModule/river var/river_type = /turf/open/lava/smooth var/river_nodes = 4 - var/start_z = 5 + var/start_z = ZLEVEL_LAVALAND /datum/mapGeneratorModule/river/generate() var/datum/mapGenerator/lavaland/L = mother diff --git a/code/modules/procedural_mapping/mapGenerators/repair.dm b/code/modules/procedural_mapping/mapGenerators/repair.dm index 9796535df7b..d6264041f0d 100644 --- a/code/modules/procedural_mapping/mapGenerators/repair.dm +++ b/code/modules/procedural_mapping/mapGenerators/repair.dm @@ -20,7 +20,7 @@ if(!istype(mother, /datum/mapGenerator/repair/reload_station_map)) return var/datum/mapGenerator/repair/reload_station_map/mother1 = mother - if(!(mother1.z in GLOB.station_z_levels)) + if(!is_station_level(mother1.z)) return //This is only for reloading station blocks! GLOB.reloading_map = TRUE var/static/dmm_suite/reloader = new @@ -87,7 +87,7 @@ /datum/mapGenerator/repair/reload_station_map/defineRegion(turf/start, turf/end) . = ..() - if(!(start.z in GLOB.station_z_levels) || !(end.z in GLOB.station_z_levels)) + if(!is_station_level(start.z) || !is_station_level(end.z)) return x_low = min(start.x, end.x) y_low = min(start.y, end.y) diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 2c1536b26ea..d90c7e5dcc0 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -668,7 +668,7 @@ /obj/item/relic/proc/do_the_teleport(mob/user) var/turf/userturf = get_turf(user) - if(loc == user && userturf.z != ZLEVEL_CENTCOM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you! + if(loc == user && !is_centcom_level(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you! visible_message("[src] twists and bends, relocating itself!") throwSmoke(userturf) do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg') diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index 2b3296ced41..0da7227d3a4 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -29,7 +29,7 @@ GLOBAL_VAR_INIT(security_level, 0) SSshuttle.emergency.modTimer(2) GLOB.security_level = SEC_LEVEL_GREEN for(var/obj/machinery/firealarm/FA in GLOB.machines) - if(FA.z in GLOB.station_z_levels) + if(is_station_level(FA.z)) FA.update_icon() if(SEC_LEVEL_BLUE) if(GLOB.security_level < SEC_LEVEL_BLUE) @@ -42,7 +42,7 @@ GLOBAL_VAR_INIT(security_level, 0) SSshuttle.emergency.modTimer(2) GLOB.security_level = SEC_LEVEL_BLUE for(var/obj/machinery/firealarm/FA in GLOB.machines) - if(FA.z in GLOB.station_z_levels) + if(is_station_level(FA.z)) FA.update_icon() if(SEC_LEVEL_RED) if(GLOB.security_level < SEC_LEVEL_RED) @@ -57,7 +57,7 @@ GLOBAL_VAR_INIT(security_level, 0) GLOB.security_level = SEC_LEVEL_RED for(var/obj/machinery/firealarm/FA in GLOB.machines) - if(FA.z in GLOB.station_z_levels) + if(is_station_level(FA.z)) FA.update_icon() for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines) pod.admin_controlled = 0 @@ -70,7 +70,7 @@ GLOBAL_VAR_INIT(security_level, 0) SSshuttle.emergency.modTimer(0.5) GLOB.security_level = SEC_LEVEL_DELTA for(var/obj/machinery/firealarm/FA in GLOB.machines) - if(FA.z in GLOB.station_z_levels) + if(is_station_level(FA.z)) FA.update_icon() for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines) pod.admin_controlled = 0 diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index b11e5893318..7b196b82894 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -189,7 +189,7 @@ All ShuttleMove procs go here /obj/machinery/computer/auxillary_base/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() - if(z == ZLEVEL_MINING) //Avoids double logging and landing on other Z-levels due to badminnery + if(is_mining_level(z)) //Avoids double logging and landing on other Z-levels due to badminnery SSblackbox.record_feedback("associative", "colonies_dropped", 1, list("x" = x, "y" = y, "z" = z)) /obj/machinery/gravity_generator/main/beforeShuttleMove(turf/newT, rotation, move_mode) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 619b4d4e05e..3b907128f32 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -391,7 +391,7 @@ mode = SHUTTLE_RECALL /obj/docking_port/mobile/proc/enterTransit() - if((SSshuttle.lockdown && (z in GLOB.station_z_levels)) || !canMove()) //emp went off, no escape + if((SSshuttle.lockdown && is_station_level(z)) || !canMove()) //emp went off, no escape mode = SHUTTLE_IDLE return previous = null diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index c2d6de2651a..eacacef9339 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( SSshuttle.supply = src /obj/docking_port/mobile/supply/canMove() - if(z in GLOB.station_z_levels) + if(is_station_level(z)) return check_blacklist(shuttle_areas) return ..() diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm index ee5a435a86c..410935db5a9 100644 --- a/code/modules/shuttle/syndicate.dm +++ b/code/modules/shuttle/syndicate.dm @@ -40,7 +40,7 @@ /obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list) if(href_list["move"]) - if(z != ZLEVEL_CENTCOM) + if(!is_centcom_level(z)) to_chat(usr, "Pods are one way!") return 0 ..() diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 30efb6d9fff..ae317ad8616 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -163,7 +163,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th return 0 var/turf/T = get_turf(user) - if(T.z == ZLEVEL_CENTCOM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel + if(is_centcom_level(T.z) && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel to_chat(user, "You can't cast this spell here.") return 0 diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index b00dff2ef7b..13216826a4f 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -31,7 +31,7 @@ /datum/station_goal/proc/get_coverage() var/list/coverage = list() for(var/obj/machinery/satellite/meteor_shield/A in GLOB.machines) - if(!A.active || !(A.z in GLOB.station_z_levels)) + if(!A.active || !is_station_level(A.z)) continue coverage |= view(A.kill_range,A) return coverage.len diff --git a/tgstation.dme b/tgstation.dme index 2d78c2f0763..2bf30087378 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -102,6 +102,7 @@ #include "code\__HELPERS\global_lists.dm" #include "code\__HELPERS\icon_smoothing.dm" #include "code\__HELPERS\icons.dm" +#include "code\__HELPERS\level_traits.dm" #include "code\__HELPERS\matrices.dm" #include "code\__HELPERS\mobs.dm" #include "code\__HELPERS\names.dm"