diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm
index 084cc7d1ab..5e7ee3a468 100644
--- a/code/__DEFINES/maps.dm
+++ b/code/__DEFINES/maps.dm
@@ -35,7 +35,7 @@ Last space-z level = empty
//zlevel defines, can be overridden for different maps in the appropriate _maps file.
#define ZLEVEL_CENTCOM 1
-#define ZLEVEL_STATION 2
+#define ZLEVEL_STATION_PRIMARY 2
#define ZLEVEL_MINING 5
#define ZLEVEL_LAVALAND 5
#define ZLEVEL_EMPTY_SPACE 12
diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm
index d3b9580f37..0ffd8d8580 100644
--- a/code/__HELPERS/priority_announce.dm
+++ b/code/__HELPERS/priority_announce.dm
@@ -39,7 +39,7 @@
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/ai/commandreport.ogg')
for(var/obj/machinery/computer/communications/C in GLOB.machines)
- if(!(C.stat & (BROKEN|NOPOWER)) && C.z == ZLEVEL_STATION)
+ if(!(C.stat & (BROKEN|NOPOWER)) && (C.z in GLOB.station_z_levels))
var/obj/item/paper/P = new /obj/item/paper(C.loc)
P.name = "paper - '[title]'"
P.info = text
diff --git a/code/_globalvars/lists/mapping.dm b/code/_globalvars/lists/mapping.dm
index 1581c904b9..63bbcf927d 100644
--- a/code/_globalvars/lists/mapping.dm
+++ b/code/_globalvars/lists/mapping.dm
@@ -4,6 +4,7 @@
#define Z_WEST 4
GLOBAL_LIST_INIT(cardinals, list(NORTH, SOUTH, EAST, WEST))
+<<<<<<< HEAD
GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
@@ -52,4 +53,57 @@ GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can
//used by jump-to-area etc. Updated by area/updateName()
GLOBAL_LIST_EMPTY(sortedAreas)
-GLOBAL_LIST_EMPTY(all_abstract_markers)
\ No newline at end of file
+GLOBAL_LIST_EMPTY(all_abstract_markers)
+=======
+GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
+GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
+
+//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
+//(Exceptions: extended, sandbox and nuke) -Errorage
+//Was list("3" = 30, "4" = 70).
+//Spacing should be a reliable method of getting rid of a body -- Urist.
+//Go away Urist, I'm restoring this to the longer list. ~Errorage
+GLOBAL_LIST_INIT(accessable_z_levels, list(1,3,4,5,6,7)) //Keep this to six maps, repeating z-levels is ok if needed
+
+GLOBAL_LIST_INIT(station_z_levels, list(ZLEVEL_STATION_PRIMARY))
+
+GLOBAL_LIST(global_map)
+ //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels.
+ //Resulting sector map looks like
+ //|_1_|_4_|
+ //|_5_|_3_|
+ //
+ //1 - SS13
+ //4 - Derelict
+ //3 - AI satellite
+ //5 - empty space
+
+GLOBAL_LIST_EMPTY(landmarks_list) //list of all landmarks created
+GLOBAL_LIST_EMPTY(start_landmarks_list) //list of all spawn points created
+GLOBAL_LIST_EMPTY(department_security_spawns) //list of all department security spawns
+GLOBAL_LIST_EMPTY(generic_event_spawns) //list of all spawns for events
+
+GLOBAL_LIST_EMPTY(wizardstart)
+GLOBAL_LIST_EMPTY(newplayer_start)
+GLOBAL_LIST_EMPTY(prisonwarp) //prisoners go to these
+GLOBAL_LIST_EMPTY(holdingfacility) //captured people go here
+GLOBAL_LIST_EMPTY(xeno_spawn)//Aliens spawn at these.
+GLOBAL_LIST_EMPTY(tdome1)
+GLOBAL_LIST_EMPTY(tdome2)
+GLOBAL_LIST_EMPTY(tdomeobserve)
+GLOBAL_LIST_EMPTY(tdomeadmin)
+GLOBAL_LIST_EMPTY(prisonwarped) //list of players already warped
+GLOBAL_LIST_EMPTY(blobstart)
+GLOBAL_LIST_EMPTY(secequipment)
+GLOBAL_LIST_EMPTY(deathsquadspawn)
+GLOBAL_LIST_EMPTY(emergencyresponseteamspawn)
+GLOBAL_LIST_EMPTY(ruin_landmarks)
+
+ //away missions
+GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can take you to
+
+ //used by jump-to-area etc. Updated by area/updateName()
+GLOBAL_LIST_EMPTY(sortedAreas)
+
+GLOBAL_LIST_EMPTY(all_abstract_markers)
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm
index 2c36e10d31..f2bb300471 100644
--- a/code/controllers/subsystem/mapping.dm
+++ b/code/controllers/subsystem/mapping.dm
@@ -117,7 +117,7 @@ SUBSYSTEM_DEF(mapping)
var/start_time = REALTIMEOFDAY
INIT_ANNOUNCE("Loading [config.map_name]...")
- TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION)
+ TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION_PRIMARY)
INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!")
if(SSdbcore.Connect())
var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]")
diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm
index 10c6f8e5c4..4e58212b44 100644
--- a/code/controllers/subsystem/minimap.dm
+++ b/code/controllers/subsystem/minimap.dm
@@ -5,7 +5,7 @@ SUBSYSTEM_DEF(minimap)
var/const/MINIMAP_SIZE = 2048
var/const/TILE_SIZE = 8
- var/list/z_levels = list(ZLEVEL_STATION)
+ var/list/z_levels = list(ZLEVEL_STATION_PRIMARY)
/datum/controller/subsystem/minimap/Initialize(timeofday)
var/hash = md5(SSmapping.config.GetFullMapPath())
diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm
index 8b8bc81ad2..2029100847 100644
--- a/code/controllers/subsystem/persistence.dm
+++ b/code/controllers/subsystem/persistence.dm
@@ -21,8 +21,45 @@ SUBSYSTEM_DEF(persistence)
..()
/datum/controller/subsystem/persistence/proc/LoadSatchels()
+<<<<<<< HEAD
secret_satchels = file("data/npc_saves/SecretSatchels[SSmapping.config.map_name].json")
if(!fexists(secret_satchels))
+=======
+ var/placed_satchel = 0
+ var/path
+ var/obj/item/storage/backpack/satchel/flat/F = new()
+ if(fexists("data/npc_saves/SecretSatchels.sav")) //legacy compatability to convert old format to new
+ var/savefile/secret_satchels = new /savefile("data/npc_saves/SecretSatchels.sav")
+ var/sav_text
+ secret_satchels[SSmapping.config.map_name] >> sav_text
+ fdel("data/npc_saves/SecretSatchels.sav")
+ if(sav_text)
+ old_secret_satchels = splittext(sav_text,"#")
+ if(old_secret_satchels.len >= 20)
+ var/satchel_string = pick_n_take(old_secret_satchels)
+ var/list/chosen_satchel = splittext(satchel_string,"|")
+ if(chosen_satchel.len == 3)
+ F.x = text2num(chosen_satchel[1])
+ F.y = text2num(chosen_satchel[2])
+ F.z = ZLEVEL_STATION_PRIMARY
+ path = text2path(chosen_satchel[3])
+ else
+ var/json_file = file("data/npc_saves/SecretSatchels[SSmapping.config.map_name].json")
+ if(!fexists(json_file))
+ return
+ var/list/json = list()
+ json = json_decode(file2text(json_file))
+ old_secret_satchels = json["data"]
+ if(old_secret_satchels.len)
+ if(old_secret_satchels.len >= 20) //guards against low drop pools assuring that one player cannot reliably find his own gear.
+ var/pos = rand(1, old_secret_satchels.len)
+ old_secret_satchels.Cut(pos, pos+1)
+ F.x = old_secret_satchels[pos]["x"]
+ F.y = old_secret_satchels[pos]["y"]
+ F.z = ZLEVEL_STATION_PRIMARY
+ path = text2path(old_secret_satchels[pos]["saved_obj"])
+ if(!ispath(path))
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
return
satchel_blacklist = typecacheof(list(/obj/item/stack/tile/plasteel, /obj/item/crowbar))
var/list/json = list()
@@ -46,7 +83,7 @@ SUBSYSTEM_DEF(persistence)
placed_satchel++
var/list/free_satchels = list()
- for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION)))) //Nontrivially expensive but it's roundstart only
+ for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY)))) //Nontrivially expensive but it's roundstart only
if(isfloorturf(T) && !istype(T, /turf/open/floor/plating/))
free_satchels += new /obj/item/storage/backpack/satchel/flat/secret(T)
if(!isemptylist(free_satchels) && ((free_satchels.len + placed_satchel) >= (50 - old_secret_satchels.len) * 0.1)) //up to six tiles, more than enough to kill anything that moves
@@ -142,7 +179,7 @@ SUBSYSTEM_DEF(persistence)
var/list/satchels = list()
for(var/A in new_secret_satchels)
var/obj/item/storage/backpack/satchel/flat/F = A
- if(QDELETED(F) || F.z != ZLEVEL_STATION || F.invisibility != INVISIBILITY_MAXIMUM)
+ if(QDELETED(F) || F.z != ZLEVEL_STATION_PRIMARY || F.invisibility != INVISIBILITY_MAXIMUM)
continue
var/list/savable_obj = list()
for(var/obj/O in F)
diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm
index f9774f8cb5..9f6f6f5fb3 100644
--- a/code/controllers/subsystem/shuttle.dm
+++ b/code/controllers/subsystem/shuttle.dm
@@ -290,7 +290,7 @@ SUBSYSTEM_DEF(shuttle)
continue
var/turf/T = get_turf(thing)
- if(T && T.z == ZLEVEL_STATION)
+ if(T && (T.z in GLOB.station_z_levels))
callShuttle = 0
break
diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index e51ef0c255..62e07f5355 100755
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -392,7 +392,7 @@ SUBSYSTEM_DEF(ticker)
if(bomb && bomb.loc)
bombloc = bomb.z
else if(!station_missed)
- bombloc = ZLEVEL_STATION
+ bombloc = ZLEVEL_STATION_PRIMARY
if(mode)
mode.explosion_in_progress = 0
diff --git a/code/datums/antagonists/datum_cult.dm b/code/datums/antagonists/datum_cult.dm
index d17b799ca2..8c05c54b21 100644
--- a/code/datums/antagonists/datum_cult.dm
+++ b/code/datums/antagonists/datum_cult.dm
@@ -40,7 +40,7 @@
if(!GLOB.summon_spots.len)
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
var/area/summon = pick(GLOB.sortedAreas - GLOB.summon_spots)
- if(summon && (summon.z == ZLEVEL_STATION) && summon.valid_territory)
+ if(summon && (summon.z in GLOB.station_z_levels) && summon.valid_territory)
GLOB.summon_spots += summon
SSticker.mode.cult_objectives += "eldergod"
diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm
index 7f09ffa48c..9be242a391 100644
--- a/code/datums/diseases/advance/advance.dm
+++ b/code/datums/diseases/advance/advance.dm
@@ -413,7 +413,7 @@
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
- if(H.z != ZLEVEL_STATION)
+ if(!(H.z in GLOB.station_z_levels))
continue
if(!H.HasDisease(D))
H.ForceContractDisease(D)
diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm
index fc943a8049..9157eebde3 100644
--- a/code/datums/helper_datums/teleport.dm
+++ b/code/datums/helper_datums/teleport.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
//wrapper
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
var/datum/teleport/instant/science/D = new
@@ -206,6 +207,216 @@
continue
if(extended_safety_checks)
+=======
+//wrapper
+/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
+ var/datum/teleport/instant/science/D = new
+ if(D.start(arglist(args)))
+ return 1
+ return 0
+
+/datum/teleport
+ var/atom/movable/teleatom //atom to teleport
+ var/atom/destination //destination to teleport to
+ var/precision = 0 //teleport precision
+ var/datum/effect_system/effectin //effect to show right before teleportation
+ var/datum/effect_system/effectout //effect to show right after teleportation
+ var/soundin //soundfile to play before teleportation
+ var/soundout //soundfile to play after teleportation
+ var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
+
+/datum/teleport/proc/start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
+ if(!initTeleport(arglist(args)))
+ return 0
+ return 1
+
+/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout)
+ if(!setTeleatom(ateleatom))
+ return 0
+ if(!setDestination(adestination))
+ return 0
+ if(!setPrecision(aprecision))
+ return 0
+ setEffects(aeffectin,aeffectout)
+ setForceTeleport(afteleport)
+ setSounds(asoundin,asoundout)
+ return 1
+
+//must succeed
+/datum/teleport/proc/setPrecision(aprecision)
+ if(isnum(aprecision))
+ precision = aprecision
+ return 1
+ return 0
+
+//must succeed
+/datum/teleport/proc/setDestination(atom/adestination)
+ if(istype(adestination))
+ destination = adestination
+ return 1
+ return 0
+
+//must succeed in most cases
+/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
+ if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
+ qdel(ateleatom)
+ return 0
+ if(istype(ateleatom))
+ teleatom = ateleatom
+ return 1
+ return 0
+
+//custom effects must be properly set up first for instant-type teleports
+//optional
+/datum/teleport/proc/setEffects(datum/effect_system/aeffectin=null,datum/effect_system/aeffectout=null)
+ effectin = istype(aeffectin) ? aeffectin : null
+ effectout = istype(aeffectout) ? aeffectout : null
+ return 1
+
+//optional
+/datum/teleport/proc/setForceTeleport(afteleport)
+ force_teleport = afteleport
+ return 1
+
+//optional
+/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
+ soundin = isfile(asoundin) ? asoundin : null
+ soundout = isfile(asoundout) ? asoundout : null
+ return 1
+
+//placeholder
+/datum/teleport/proc/teleportChecks()
+ return 1
+
+/datum/teleport/proc/playSpecials(atom/location,datum/effect_system/effect,sound)
+ if(location)
+ if(effect)
+ INVOKE_ASYNC(src, .proc/do_effect, location, effect)
+ if(sound)
+ INVOKE_ASYNC(src, .proc/do_sound, location, sound)
+
+/datum/teleport/proc/do_effect(atom/location, datum/effect_system/effect)
+ src = null
+ effect.attach(location)
+ effect.start()
+
+/datum/teleport/proc/do_sound(atom/location, sound)
+ src = null
+ playsound(location, sound, 60, 1)
+
+//do the monkey dance
+/datum/teleport/proc/doTeleport()
+
+ var/turf/destturf
+ var/turf/curturf = get_turf(teleatom)
+ destturf = get_teleport_turf(get_turf(destination), precision)
+
+ if(!destturf || !curturf || destturf.is_transition_turf())
+ return 0
+
+ var/area/A = get_area(curturf)
+ if(A.noteleport)
+ return 0
+
+ playSpecials(curturf,effectin,soundin)
+ if(force_teleport)
+ teleatom.forceMove(destturf)
+ if(ismegafauna(teleatom))
+ message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
+ playSpecials(destturf,effectout,soundout)
+ else
+ if(teleatom.Move(destturf))
+ playSpecials(destturf,effectout,soundout)
+ if(ismegafauna(teleatom))
+ message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
+ return 1
+
+/datum/teleport/proc/teleport()
+ if(teleportChecks())
+ return doTeleport()
+ return 0
+
+/datum/teleport/instant //teleports when datum is created
+
+ start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
+ if(..())
+ if(teleport())
+ return 1
+ return 0
+
+
+/datum/teleport/instant/science
+
+/datum/teleport/instant/science/setEffects(datum/effect_system/aeffectin,datum/effect_system/aeffectout)
+ if(aeffectin==null || aeffectout==null)
+ var/datum/effect_system/spark_spread/aeffect = new
+ aeffect.set_up(5, 1, teleatom)
+ effectin = effectin || aeffect
+ effectout = effectout || aeffect
+ return 1
+ else
+ return ..()
+
+/datum/teleport/instant/science/setPrecision(aprecision)
+ ..()
+ if(istype(teleatom, /obj/item/storage/backpack/holding))
+ precision = rand(1,100)
+
+ var/list/bagholding = teleatom.search_contents_for(/obj/item/storage/backpack/holding)
+ if(bagholding.len)
+ precision = max(rand(1,100)*bagholding.len,100)
+ if(isliving(teleatom))
+ var/mob/living/MM = teleatom
+ to_chat(MM, "The bluespace interface on your bag of holding interferes with the teleport!")
+ return 1
+
+// Safe location finder
+
+/proc/find_safe_turf(zlevel = ZLEVEL_STATION_PRIMARY, list/zlevels, extended_safety_checks = FALSE)
+ if(!zlevels)
+ zlevels = list(zlevel)
+ var/cycles = 1000
+ for(var/cycle in 1 to cycles)
+ // DRUNK DIALLING WOOOOOOOOO
+ var/x = rand(1, world.maxx)
+ var/y = rand(1, world.maxy)
+ var/z = pick(zlevels)
+ var/random_location = locate(x,y,z)
+
+ if(!isfloorturf(random_location))
+ continue
+ var/turf/open/floor/F = random_location
+ if(!F.air)
+ continue
+
+ var/datum/gas_mixture/A = F.air
+ var/list/A_gases = A.gases
+ var/trace_gases
+ for(var/id in A_gases)
+ if(id in GLOB.hardcoded_gases)
+ continue
+ trace_gases = TRUE
+ break
+
+ // Can most things breathe?
+ if(trace_gases)
+ continue
+ if(!(A_gases["o2"] && A_gases["o2"][MOLES] >= 16))
+ continue
+ if(A_gases["plasma"])
+ continue
+ if(A_gases["co2"] && A_gases["co2"][MOLES] >= 10)
+ continue
+
+ // Aim for goldilocks temperatures and pressure
+ if((A.temperature <= 270) || (A.temperature >= 360))
+ continue
+ var/pressure = A.return_pressure()
+ if((pressure <= 20) || (pressure >= 550))
+ continue
+
+ if(extended_safety_checks)
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
if(istype(F, /turf/open/lava)) //chasms aren't /floor, and so are pre-filtered
var/turf/open/lava/L = F
if(!L.is_safe())
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 78a402a2dc..9570fac07e 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -535,7 +535,7 @@
if(I == src)
continue
var/mob/M = I
- if(M.z == ZLEVEL_STATION && !M.stat)
+ if((M.z in GLOB.station_z_levels) && !M.stat)
last_healthy_headrev = FALSE
break
text += "head | not mindshielded | employee | [last_healthy_headrev ? "LAST " : ""]HEADREV | rev"
diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm
index f4f2fc089c..a2abdf64a1 100644
--- a/code/datums/weather/weather.dm
+++ b/code/datums/weather/weather.dm
@@ -30,7 +30,7 @@
var/area_type = /area/space //Types of area to affect
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
var/list/protected_areas = list()//Areas that are protected and excluded from the affected areas.
- var/target_z = ZLEVEL_STATION //The z-level to affect
+ var/target_z = ZLEVEL_STATION_PRIMARY //The z-level to affect
var/overlay_layer = AREA_LAYER //Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
var/aesthetic = FALSE //If the weather has no purpose other than looks
diff --git a/code/datums/weather/weather_types.dm b/code/datums/weather/weather_types.dm
index d23bf3c8a6..3368dcf1dd 100644
--- a/code/datums/weather/weather_types.dm
+++ b/code/datums/weather/weather_types.dm
@@ -17,7 +17,7 @@
area_type = /area
protected_areas = list(/area/space)
- target_z = ZLEVEL_STATION
+ target_z = ZLEVEL_STATION_PRIMARY
overlay_layer = ABOVE_OPEN_TURF_LAYER //Covers floors only
immunity_type = "lava"
@@ -48,7 +48,7 @@
end_duration = 0
area_type = /area
- target_z = ZLEVEL_STATION
+ target_z = ZLEVEL_STATION_PRIMARY
/datum/weather/advanced_darkness/update_areas()
for(var/V in impacted_areas)
@@ -142,7 +142,7 @@
area_type = /area
protected_areas = list(/area/maintenance, /area/ai_monitored/turret_protected/ai_upload, /area/ai_monitored/turret_protected/ai_upload_foyer,
/area/ai_monitored/turret_protected/ai, /area/storage/emergency/starboard, /area/storage/emergency/port, /area/shuttle)
- target_z = ZLEVEL_STATION
+ target_z = ZLEVEL_STATION_PRIMARY
immunity_type = "rad"
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 0baef4ace8..5acc64fbb8 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -75,7 +75,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
if(GLOB.teleportlocs[AR.name])
continue
var/turf/picked = safepick(get_area_turfs(AR.type))
- if (picked && (picked.z == ZLEVEL_STATION))
+ if (picked && (picked.z in GLOB.station_z_levels))
GLOB.teleportlocs[AR.name] = AR
sortTim(GLOB.teleportlocs, /proc/cmp_text_dsc)
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 38c815ee43..ce1d0b1560 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -560,7 +560,7 @@
flags_2 |= STATIONLOVING_2
/atom/movable/proc/relocate()
- var/targetturf = find_safe_turf(ZLEVEL_STATION)
+ var/targetturf = find_safe_turf(ZLEVEL_STATION_PRIMARY)
if(!targetturf)
if(GLOB.blobstart.len > 0)
targetturf = get_turf(pick(GLOB.blobstart))
@@ -592,7 +592,7 @@
/atom/movable/proc/in_bounds()
. = FALSE
var/turf/currentturf = get_turf(src)
- if(currentturf && (currentturf.z == ZLEVEL_CENTCOM || currentturf.z == ZLEVEL_STATION || currentturf.z == ZLEVEL_TRANSIT))
+ if(currentturf && (currentturf.z == ZLEVEL_CENTCOM || (currentturf.z in GLOB.station_z_levels) || currentturf.z == ZLEVEL_TRANSIT))
. = TRUE
diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm
index ab9c041efe..15dd4157fe 100644
--- a/code/game/gamemodes/antag_spawner.dm
+++ b/code/game/gamemodes/antag_spawner.dm
@@ -238,7 +238,7 @@
/obj/item/antag_spawner/slaughter_demon/attack_self(mob/user)
- if(user.z != ZLEVEL_STATION)
+ if(!(user.z in GLOB.station_z_levels))
to_chat(user, "You should probably wait until you reach the station.")
return
if(used)
diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm
index ea6bd07c58..e90626485a 100644
--- a/code/game/gamemodes/blob/blob_report.dm
+++ b/code/game/gamemodes/blob/blob_report.dm
@@ -19,7 +19,7 @@
var/nukecode = random_nukecode()
for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines)
if(bomb && bomb.r_code)
- if(bomb.z == ZLEVEL_STATION)
+ if(bomb.z in GLOB.station_z_levels)
bomb.r_code = nukecode
intercepttext += "NanoTrasen Update: Biohazard Alert.
"
@@ -91,7 +91,7 @@
if(count_territories)
var/list/valid_territories = list()
for(var/area/A in world) //First, collect all area types on the station zlevel
- if(A.z == ZLEVEL_STATION)
+ if(A.z in GLOB.station_z_levels)
if(!(A.type in valid_territories) && A.valid_territory)
valid_territories |= A.type
if(valid_territories.len)
diff --git a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm
index d6e56f38d5..d8281242ef 100644
--- a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm
+++ b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm
@@ -31,7 +31,7 @@
var/mob/living/silicon/ai/AI = ai
if(AI.deployed_shell && is_servant_of_ratvar(AI.deployed_shell))
continue
- if(is_servant_of_ratvar(AI) || !isturf(AI.loc) || AI.z != ZLEVEL_STATION || AI.stat == DEAD)
+ if(is_servant_of_ratvar(AI) || !isturf(AI.loc) || !(AI.z in GLOB.station_z_levels) || AI.stat == DEAD)
continue
.++
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 3f7e826017..a99e74982a 100644
--- a/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm
+++ b/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm
@@ -196,7 +196,7 @@
fabrication_values["power_cost"] = 0
var/turf/Y = get_turf(user)
- if(!Y || (Y.z != ZLEVEL_STATION && Y.z != ZLEVEL_CENTCOM && Y.z != ZLEVEL_MINING && Y.z != ZLEVEL_LAVALAND))
+ if(!Y || (!(Y.z in GLOB.station_z_levels) && Y.z != ZLEVEL_CENTCOM && Y.z != ZLEVEL_MINING && Y.z != ZLEVEL_LAVALAND))
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_scripture.dm b/code/game/gamemodes/clock_cult/clock_scripture.dm
index 318d3e243d..806d08dffb 100644
--- a/code/game/gamemodes/clock_cult/clock_scripture.dm
+++ b/code/game/gamemodes/clock_cult/clock_scripture.dm
@@ -158,7 +158,7 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or
/datum/clockwork_scripture/proc/check_offstation_penalty()
var/turf/T = get_turf(invoker)
- if(!T || (T.z != ZLEVEL_STATION && T.z != ZLEVEL_CENTCOM && T.z != ZLEVEL_MINING && T.z != ZLEVEL_LAVALAND))
+ if(!T || (!(T.z in GLOB.station_z_levels) && T.z != ZLEVEL_CENTCOM && T.z != ZLEVEL_MINING && T.z != ZLEVEL_LAVALAND))
channel_time *= 2
for(var/i in consumed_components)
if(consumed_components[i])
diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
index d0b7f11eb4..2930088ca2 100644
--- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
+++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
@@ -175,7 +175,7 @@
to_chat(invoker, "\"It is too late to construct one of these, champion.\"")
return FALSE
var/turf/T = get_turf(invoker)
- if(!T || T.z != ZLEVEL_STATION)
+ if(!T || !(T.z in GLOB.station_z_levels))
to_chat(invoker, "\"You must be on the station to construct one of these, champion.\"")
return FALSE
return ..()
diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm
index e7beff846f..c7daef1450 100644
--- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm
+++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm
@@ -33,7 +33,7 @@
return FALSE
var/area/A = get_area(invoker)
var/turf/T = get_turf(invoker)
- if(!T || T.z != ZLEVEL_STATION || istype(A, /area/shuttle) || !A.blob_allowed)
+ if(!T || !(T.z in GLOB.station_z_levels) || istype(A, /area/shuttle) || !A.blob_allowed)
to_chat(invoker, "You must be on the station to activate the Ark!")
return FALSE
if(GLOB.clockwork_gateway_activated)
diff --git a/code/game/gamemodes/clock_cult/clock_structures/prolonging_prism.dm b/code/game/gamemodes/clock_cult/clock_structures/prolonging_prism.dm
index cf730189e3..d416860ea1 100644
--- a/code/game/gamemodes/clock_cult/clock_structures/prolonging_prism.dm
+++ b/code/game/gamemodes/clock_cult/clock_structures/prolonging_prism.dm
@@ -48,7 +48,7 @@
if(active)
return 0
var/turf/T = get_turf(src)
- if(!T || T.z != ZLEVEL_STATION)
+ if(!T || !(T.z in GLOB.station_z_levels))
to_chat(user, "[src] must be on the station to function!")
return 0
if(SSshuttle.emergency.mode != SHUTTLE_CALL)
@@ -63,7 +63,7 @@
/obj/structure/destructible/clockwork/powered/prolonging_prism/process()
var/turf/own_turf = get_turf(src)
- if(SSshuttle.emergency.mode != SHUTTLE_CALL || delay_remaining <= 0 || !own_turf || own_turf.z != ZLEVEL_STATION)
+ if(SSshuttle.emergency.mode != SHUTTLE_CALL || delay_remaining <= 0 || !own_turf || !(own_turf.z in GLOB.station_z_levels))
forced_disable(FALSE)
return
. = ..()
@@ -97,7 +97,7 @@
mean_x = Ceiling(mean_x)
else
mean_x = Floor(mean_x)
- var/turf/semi_random_center_turf = locate(mean_x, mean_y, ZLEVEL_STATION)
+ var/turf/semi_random_center_turf = locate(mean_x, mean_y, ZLEVEL_STATION_PRIMARY)
for(var/t in getline(src, semi_random_center_turf))
prism_turfs[t] = TRUE
var/placement_style = prob(50)
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index 06407079ce..f7c871168f 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -104,7 +104,7 @@
if(!GLOB.summon_spots.len)
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
var/area/summon = pick(GLOB.sortedAreas - GLOB.summon_spots)
- if((summon.z == ZLEVEL_STATION) && summon.valid_territory)
+ if((summon.z in GLOB.station_z_levels) && summon.valid_territory)
GLOB.summon_spots += summon
cult_objectives += "eldergod"
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index 06f0910c19..bcf4afb147 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -257,8 +257,15 @@ This file contains the arcane tome files.
to_chat(user, "There is already a rune here.")
return FALSE
+<<<<<<< HEAD
if(T.z != ZLEVEL_STATION && T.z != ZLEVEL_MINING)
to_chat(user, "The veil is not weak enough here.")
+=======
+
+ if(!(T.z in GLOB.station_z_levels) && T.z != ZLEVEL_MINING)
+ to_chat(user, "The veil is not weak enough here.")
+
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
return FALSE
return TRUE
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index 936afe9090..089265d2fb 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -465,7 +465,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 != ZLEVEL_STATION)
+ if(!(z in GLOB.station_z_levels))
return
if(locate(/obj/singularity/narsie) in GLOB.poi_list)
diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm
index a56a2d6647..49eeeb2e6f 100644
--- a/code/game/gamemodes/events.dm
+++ b/code/game/gamemodes/events.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/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)
@@ -60,10 +61,75 @@
S.update_icon()
S.power_change()
for(var/area/A in world)
+=======
+/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))
+ continue
+ S.charge = 0
+ S.output_level = 0
+ S.output_attempt = 0
+ S.update_icon()
+ S.power_change()
+
+ var/list/skipped_areas = list(/area/engine/engineering, /area/engine/supermatter, /area/engine/atmospherics_engine, /area/ai_monitored/turret_protected/ai)
+
+ for(var/area/A in world)
+ if( !A.requires_power || A.always_unpowered )
+ continue
+
+ var/skip = 0
+ for(var/area_type in skipped_areas)
+ if(istype(A,area_type))
+ skip = 1
+ 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.
+ skip = 1
+ break
+ if(skip) continue
+ A.power_light = FALSE
+ A.power_equip = FALSE
+ A.power_environ = FALSE
+ A.power_change()
+
+ for(var/obj/machinery/power/apc/C in GLOB.apcs_list)
+ if(C.cell && (C.z in GLOB.station_z_levels))
+ var/area/A = C.area
+
+ var/skip = 0
+ for(var/area_type in skipped_areas)
+ if(istype(A,area_type))
+ skip = 1
+ break
+ if(skip) continue
+
+ C.cell.charge = 0
+
+/proc/power_restore()
+
+ 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))
+ 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))
+ continue
+ S.charge = S.capacity
+ S.output_level = S.output_level_max
+ S.output_attempt = 1
+ S.update_icon()
+ S.power_change()
+ for(var/area/A in world)
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
if(!istype(A, /area/space) && !istype(A, /area/shuttle) && !istype(A, /area/arrival))
A.power_light = TRUE
A.power_equip = TRUE
A.power_environ = TRUE
+<<<<<<< HEAD
A.power_change()
/proc/power_restore_quick()
@@ -78,3 +144,19 @@
S.update_icon()
S.power_change()
+=======
+ A.power_change()
+
+/proc/power_restore_quick()
+
+ 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))
+ continue
+ S.charge = S.capacity
+ S.output_level = S.output_level_max
+ S.output_attempt = 1
+ S.update_icon()
+ S.power_change()
+
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index 1aee6ee7d3..3e08bf91f3 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/*
@@ -591,3 +592,565 @@
for(var/V in station_goals)
var/datum/station_goal/G = V
G.print_result()
+=======
+
+
+/*
+ * GAMEMODES (by Rastaf0)
+ *
+ * In the new mode system all special roles are fully supported.
+ * You can have proper wizards/traitors/changelings/cultists during any mode.
+ * Only two things really depends on gamemode:
+ * 1. Starting roles, equipment and preparations
+ * 2. Conditions of finishing the round.
+ *
+ */
+
+
+/datum/game_mode
+ var/name = "invalid"
+ var/config_tag = null
+ var/votable = 1
+ var/probability = 0
+ var/station_was_nuked = 0 //see nuclearbomb.dm and malfunction.dm
+ var/explosion_in_progress = 0 //sit back and relax
+ var/round_ends_with_antag_death = 0 //flags the "one verse the station" antags as such
+ var/list/datum/mind/modePlayer = new
+ var/list/datum/mind/antag_candidates = list() // List of possible starting antags goes here
+ var/list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist
+ var/list/protected_jobs = list() // Jobs that can't be traitors because
+ var/required_players = 0
+ var/maximum_players = -1 // -1 is no maximum, positive numbers limit the selection of a mode on overstaffed stations
+ var/required_enemies = 0
+ var/recommended_enemies = 0
+ var/antag_flag = null //preferences flag such as BE_WIZARD that need to be turned on for players to be antag
+ var/mob/living/living_antag_player = null
+ var/list/datum/game_mode/replacementmode = null
+ var/round_converted = 0 //0: round not converted, 1: round going to convert, 2: round converted
+ var/reroll_friendly //During mode conversion only these are in the running
+ var/continuous_sanity_checked //Catches some cases where config options could be used to suggest that modes without antagonists should end when all antagonists die
+ var/enemy_minimum_age = 7 //How many days must players have been playing before they can play this antagonist
+
+ var/announce_span = "warning" //The gamemode's name will be in this span during announcement.
+ var/announce_text = "This gamemode forgot to set a descriptive text! Uh oh!" //Used to describe a gamemode when it's announced.
+
+ var/const/waittime_l = 600
+ var/const/waittime_h = 1800 // started at 1800
+
+ var/list/datum/station_goal/station_goals = list()
+
+ var/allow_persistence_save = TRUE
+
+/datum/game_mode/proc/announce() //Shows the gamemode's name and a fast description.
+ to_chat(world, "The gamemode is: [name]!")
+ to_chat(world, "[announce_text]")
+
+
+///Checks to see if the game can be setup and ran with the current number of players or whatnot.
+/datum/game_mode/proc/can_start()
+ var/playerC = 0
+ for(var/mob/dead/new_player/player in GLOB.player_list)
+ if((player.client)&&(player.ready == PLAYER_READY_TO_PLAY))
+ playerC++
+ if(!GLOB.Debug2)
+ if(playerC < required_players || (maximum_players >= 0 && playerC > maximum_players))
+ return 0
+ antag_candidates = get_players_for_role(antag_flag)
+ if(!GLOB.Debug2)
+ if(antag_candidates.len < required_enemies)
+ return 0
+ return 1
+ else
+ message_admins("DEBUG: GAME STARTING WITHOUT PLAYER NUMBER CHECKS, THIS WILL PROBABLY BREAK SHIT.")
+ return 1
+
+
+///Attempts to select players for special roles the mode might have.
+/datum/game_mode/proc/pre_setup()
+ return 1
+
+
+///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things
+/datum/game_mode/proc/post_setup(report) //Gamemodes can override the intercept report. Passing TRUE as the argument will force a report.
+ if(!report)
+ report = config.intercept
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME)
+
+ if(SSdbcore.Connect())
+ var/sql
+ if(SSticker.mode)
+ sql += "game_mode = '[SSticker.mode]'"
+ if(GLOB.revdata.originmastercommit)
+ if(sql)
+ sql += ", "
+ sql += "commit_hash = '[GLOB.revdata.originmastercommit]'"
+ if(sql)
+ var/datum/DBQuery/query_round_game_mode = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET [sql] WHERE id = [GLOB.round_id]")
+ query_round_game_mode.Execute()
+ if(report)
+ addtimer(CALLBACK(src, .proc/send_intercept, 0), rand(waittime_l, waittime_h))
+ generate_station_goals()
+ return 1
+
+
+///Handles late-join antag assignments
+/datum/game_mode/proc/make_antag_chance(mob/living/carbon/human/character)
+ if(replacementmode && round_converted == 2)
+ replacementmode.make_antag_chance(character)
+ return
+
+
+///Allows rounds to basically be "rerolled" should the initial premise fall through. Also known as mulligan antags.
+/datum/game_mode/proc/convert_roundtype()
+ set waitfor = FALSE
+ var/list/living_crew = list()
+
+ for(var/mob/Player in GLOB.mob_list)
+ if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) && !isbrain(Player) && Player.client)
+ living_crew += Player
+ if(living_crew.len / GLOB.joined_player_list.len <= config.midround_antag_life_check) //If a lot of the player base died, we start fresh
+ message_admins("Convert_roundtype failed due to too many dead people. Limit is [config.midround_antag_life_check * 100]% living crew")
+ return null
+
+ var/list/datum/game_mode/runnable_modes = config.get_runnable_midround_modes(living_crew.len)
+ var/list/datum/game_mode/usable_modes = list()
+ for(var/datum/game_mode/G in runnable_modes)
+ if(G.reroll_friendly && living_crew >= G.required_players)
+ usable_modes += G
+ else
+ qdel(G)
+
+ if(!usable_modes)
+ message_admins("Convert_roundtype failed due to no valid modes to convert to. Please report this error to the Coders.")
+ return null
+
+ replacementmode = pickweight(usable_modes)
+
+ switch(SSshuttle.emergency.mode) //Rounds on the verge of ending don't get new antags, they just run out
+ if(SHUTTLE_STRANDED, SHUTTLE_ESCAPE)
+ return 1
+ if(SHUTTLE_CALL)
+ if(SSshuttle.emergency.timeLeft(1) < initial(SSshuttle.emergencyCallTime)*0.5)
+ return 1
+
+ if(world.time >= (config.midround_antag_time_check * 600))
+ message_admins("Convert_roundtype failed due to round length. Limit is [config.midround_antag_time_check] minutes.")
+ return null
+
+ var/list/antag_candidates = list()
+
+ for(var/mob/living/carbon/human/H in living_crew)
+ if(H.client && H.client.prefs.allow_midround_antag)
+ antag_candidates += H
+
+ if(!antag_candidates)
+ message_admins("Convert_roundtype failed due to no antag candidates.")
+ return null
+
+ antag_candidates = shuffle(antag_candidates)
+
+ if(config.protect_roles_from_antagonist)
+ replacementmode.restricted_jobs += replacementmode.protected_jobs
+ if(config.protect_assistant_from_antagonist)
+ replacementmode.restricted_jobs += "Assistant"
+
+ message_admins("The roundtype will be converted. If you have other plans for the station or feel the station is too messed up to inhabit stop the creation of antags or end the round now.")
+
+ . = 1
+ sleep(rand(600,1800))
+ if(!SSticker.IsRoundInProgress())
+ message_admins("Roundtype conversion cancelled, the game appears to have finished!")
+ round_converted = 0
+ return
+ //somewhere between 1 and 3 minutes from now
+ if(!config.midround_antag[SSticker.mode.config_tag])
+ round_converted = 0
+ return 1
+ for(var/mob/living/carbon/human/H in antag_candidates)
+ replacementmode.make_antag_chance(H)
+ round_converted = 2
+ message_admins("-- IMPORTANT: The roundtype has been converted to [replacementmode.name], antagonists may have been created! --")
+
+
+///Called by the gameSSticker
+/datum/game_mode/process()
+ return 0
+
+
+/datum/game_mode/proc/check_finished(force_ending) //to be called by SSticker
+ if(replacementmode && round_converted == 2)
+ return replacementmode.check_finished()
+ if(SSshuttle.emergency && (SSshuttle.emergency.mode == SHUTTLE_ENDGAME))
+ return TRUE
+ if(station_was_nuked)
+ return TRUE
+ if(!round_converted && (!config.continuous[config_tag] || (config.continuous[config_tag] && config.midround_antag[config_tag]))) //Non-continuous or continous with replacement antags
+ if(!continuous_sanity_checked) //make sure we have antags to be checking in the first place
+ for(var/mob/Player in GLOB.mob_list)
+ if(Player.mind)
+ if(Player.mind.special_role)
+ continuous_sanity_checked = 1
+ return 0
+ if(!continuous_sanity_checked)
+ message_admins("The roundtype ([config_tag]) has no antagonists, continuous round has been defaulted to on and midround_antag has been defaulted to off.")
+ config.continuous[config_tag] = 1
+ config.midround_antag[config_tag] = 0
+ SSshuttle.clearHostileEnvironment(src)
+ return 0
+
+
+ if(living_antag_player && living_antag_player.mind && isliving(living_antag_player) && living_antag_player.stat != DEAD && !isnewplayer(living_antag_player) &&!isbrain(living_antag_player))
+ return 0 //A resource saver: once we find someone who has to die for all antags to be dead, we can just keep checking them, cycling over everyone only when we lose our mark.
+
+ for(var/mob/Player in GLOB.living_mob_list)
+ if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) &&!isbrain(Player) && Player.client)
+ if(Player.mind.special_role) //Someone's still antaging!
+ living_antag_player = Player
+ return 0
+
+ if(!config.continuous[config_tag] || force_ending)
+ return 1
+
+ else
+ round_converted = convert_roundtype()
+ if(!round_converted)
+ if(round_ends_with_antag_death)
+ return 1
+ else
+ config.midround_antag[config_tag] = 0
+ return 0
+
+ return 0
+
+
+/datum/game_mode/proc/declare_completion()
+ var/clients = 0
+ var/surviving_humans = 0
+ var/surviving_total = 0
+ var/ghosts = 0
+ var/escaped_humans = 0
+ var/escaped_total = 0
+
+ for(var/mob/M in GLOB.player_list)
+ if(M.client)
+ clients++
+ if(ishuman(M))
+ if(!M.stat)
+ surviving_humans++
+ if(M.z == ZLEVEL_CENTCOM)
+ escaped_humans++
+ if(!M.stat)
+ surviving_total++
+ if(M.z == ZLEVEL_CENTCOM)
+ escaped_total++
+
+
+ if(isobserver(M))
+ ghosts++
+
+ if(clients > 0)
+ SSblackbox.set_val("round_end_clients",clients)
+ if(ghosts > 0)
+ SSblackbox.set_val("round_end_ghosts",ghosts)
+ if(surviving_humans > 0)
+ SSblackbox.set_val("survived_human",surviving_humans)
+ if(surviving_total > 0)
+ SSblackbox.set_val("survived_total",surviving_total)
+ if(escaped_humans > 0)
+ SSblackbox.set_val("escaped_human",escaped_humans)
+ if(escaped_total > 0)
+ SSblackbox.set_val("escaped_total",escaped_total)
+ send2irc("Server", "Round just ended.")
+ if(cult.len && !istype(SSticker.mode, /datum/game_mode/cult))
+ datum_cult_completion()
+
+ return 0
+
+
+/datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere.
+ return 0
+
+
+/datum/game_mode/proc/send_intercept()
+ var/intercepttext = "Central Command Status Summary
"
+ intercepttext += "Central Command has intercepted and partially decoded a Syndicate transmission with vital information regarding their movements. The following report outlines the most \
+ likely threats to appear in your sector."
+ var/list/possible_modes = list()
+ possible_modes.Add("blob", "changeling", "clock_cult", "cult", "extended", "malf", "nuclear", "revolution", "traitor", "wizard")
+ possible_modes -= name //remove the current gamemode to prevent it from being randomly deleted, it will be readded later
+
+ for(var/i in 1 to 6) //Remove a few modes to leave four
+ possible_modes -= pick(possible_modes)
+
+ possible_modes |= name //Re-add the actual gamemode - the intercept will thus always have the correct mode in its list
+ possible_modes = shuffle(possible_modes) //Meta prevention
+
+ var/datum/intercept_text/i_text = new /datum/intercept_text
+ for(var/V in possible_modes)
+ intercepttext += i_text.build(V)
+
+ if(station_goals.len)
+ intercepttext += "
Special Orders for [station_name()]:"
+ for(var/datum/station_goal/G in station_goals)
+ G.on_report()
+ intercepttext += G.get_report()
+
+ print_command_report(intercepttext, "Central Command Status Summary", announce=FALSE)
+ priority_announce("A summary has been copied and printed to all communications consoles.", "Enemy communication intercepted. Security level elevated.", 'sound/ai/intercept.ogg')
+ if(GLOB.security_level < SEC_LEVEL_BLUE)
+ set_security_level(SEC_LEVEL_BLUE)
+
+
+/datum/game_mode/proc/get_players_for_role(role)
+ var/list/players = list()
+ var/list/candidates = list()
+ var/list/drafted = list()
+ var/datum/mind/applicant = null
+
+ // Ultimate randomizing code right here
+ for(var/mob/dead/new_player/player in GLOB.player_list)
+ if(player.client && player.ready == PLAYER_READY_TO_PLAY)
+ players += player
+
+ // Shuffling, the players list is now ping-independent!!!
+ // Goodbye antag dante
+ players = shuffle(players)
+
+ for(var/mob/dead/new_player/player in players)
+ if(player.client && player.ready == PLAYER_READY_TO_PLAY)
+ if(role in player.client.prefs.be_special)
+ if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, role)) //Nodrak/Carn: Antag Job-bans
+ if(age_check(player.client)) //Must be older than the minimum age
+ candidates += player.mind // Get a list of all the people who want to be the antagonist for this round
+
+ if(restricted_jobs)
+ for(var/datum/mind/player in candidates)
+ for(var/job in restricted_jobs) // Remove people who want to be antagonist but have a job already that precludes it
+ if(player.assigned_role == job)
+ candidates -= player
+
+ if(candidates.len < recommended_enemies)
+ for(var/mob/dead/new_player/player in players)
+ if(player.client && player.ready == PLAYER_READY_TO_PLAY)
+ if(!(role in player.client.prefs.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one
+ if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, role)) //Nodrak/Carn: Antag Job-bans
+ drafted += player.mind
+
+ if(restricted_jobs)
+ for(var/datum/mind/player in drafted) // Remove people who can't be an antagonist
+ for(var/job in restricted_jobs)
+ if(player.assigned_role == job)
+ drafted -= player
+
+ drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie
+
+ while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates
+ if(drafted.len > 0)
+ applicant = pick(drafted)
+ if(applicant)
+ candidates += applicant
+ drafted.Remove(applicant)
+
+ else // Not enough scrubs, ABORT ABORT ABORT
+ break
+
+ if(restricted_jobs)
+ for(var/datum/mind/player in drafted) // Remove people who can't be an antagonist
+ for(var/job in restricted_jobs)
+ if(player.assigned_role == job)
+ drafted -= player
+
+ drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie
+
+ while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates
+ if(drafted.len > 0)
+ applicant = pick(drafted)
+ if(applicant)
+ candidates += applicant
+ drafted.Remove(applicant)
+
+ else // Not enough scrubs, ABORT ABORT ABORT
+ break
+
+ return candidates // Returns: The number of people who had the antagonist role set to yes, regardless of recomended_enemies, if that number is greater than recommended_enemies
+ // recommended_enemies if the number of people with that role set to yes is less than recomended_enemies,
+ // Less if there are not enough valid players in the game entirely to make recommended_enemies.
+
+
+
+/datum/game_mode/proc/num_players()
+ . = 0
+ for(var/mob/dead/new_player/P in GLOB.player_list)
+ if(P.client && P.ready == PLAYER_READY_TO_PLAY)
+ . ++
+
+///////////////////////////////////
+//Keeps track of all living heads//
+///////////////////////////////////
+/datum/game_mode/proc/get_living_heads()
+ . = list()
+ for(var/mob/living/carbon/human/player in GLOB.mob_list)
+ if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.command_positions))
+ . |= player.mind
+
+
+////////////////////////////
+//Keeps track of all heads//
+////////////////////////////
+/datum/game_mode/proc/get_all_heads()
+ . = list()
+ for(var/mob/player in GLOB.mob_list)
+ if(player.mind && (player.mind.assigned_role in GLOB.command_positions))
+ . |= player.mind
+
+//////////////////////////////////////////////
+//Keeps track of all living security members//
+//////////////////////////////////////////////
+/datum/game_mode/proc/get_living_sec()
+ . = list()
+ for(var/mob/living/carbon/human/player in GLOB.mob_list)
+ if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.security_positions))
+ . |= player.mind
+
+////////////////////////////////////////
+//Keeps track of all security members//
+////////////////////////////////////////
+/datum/game_mode/proc/get_all_sec()
+ . = list()
+ for(var/mob/living/carbon/human/player in GLOB.mob_list)
+ if(player.mind && (player.mind.assigned_role in GLOB.security_positions))
+ . |= player.mind
+
+//////////////////////////
+//Reports player logouts//
+//////////////////////////
+/proc/display_roundstart_logout_report()
+ var/msg = "Roundstart logout report\n\n"
+ for(var/mob/living/L in GLOB.mob_list)
+
+ if(L.ckey)
+ var/found = 0
+ for(var/client/C in GLOB.clients)
+ if(C.ckey == L.ckey)
+ found = 1
+ break
+ if(!found)
+ msg += "[L.name] ([L.ckey]), the [L.job] (Disconnected)\n"
+
+
+ if(L.ckey && L.client)
+ if(L.client.inactivity >= (ROUNDSTART_LOGOUT_REPORT_TIME / 2)) //Connected, but inactive (alt+tabbed or something)
+ msg += "[L.name] ([L.ckey]), the [L.job] (Connected, Inactive)\n"
+ continue //AFK client
+ if(L.stat)
+ if(L.suiciding) //Suicider
+ msg += "[L.name] ([L.ckey]), the [L.job] (Suicide)\n"
+ continue //Disconnected client
+ if(L.stat == UNCONSCIOUS)
+ msg += "[L.name] ([L.ckey]), the [L.job] (Dying)\n"
+ continue //Unconscious
+ if(L.stat == DEAD)
+ msg += "[L.name] ([L.ckey]), the [L.job] (Dead)\n"
+ continue //Dead
+
+ continue //Happy connected client
+ for(var/mob/dead/observer/D in GLOB.mob_list)
+ if(D.mind && D.mind.current == L)
+ if(L.stat == DEAD)
+ if(L.suiciding) //Suicider
+ msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Suicide)\n"
+ continue //Disconnected client
+ else
+ msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Dead)\n"
+ continue //Dead mob, ghost abandoned
+ else
+ if(D.can_reenter_corpse)
+ continue //Adminghost, or cult/wizard ghost
+ else
+ msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Ghosted)\n"
+ continue //Ghosted while alive
+
+
+
+ for(var/mob/M in GLOB.mob_list)
+ if(M.client && M.client.holder)
+ to_chat(M, msg)
+
+/datum/game_mode/proc/printplayer(datum/mind/ply, fleecheck)
+ var/text = "
[ply.key] was [ply.name] the [ply.assigned_role] and"
+ if(ply.current)
+ if(ply.current.stat == DEAD)
+ text += " died"
+ else
+ text += " survived"
+ if(fleecheck && (!(ply.current.z in GLOB.station_z_levels)))
+ text += " while fleeing the station"
+ if(ply.current.real_name != ply.name)
+ text += " as [ply.current.real_name]"
+ else
+ text += " had their body destroyed"
+ return text
+
+/datum/game_mode/proc/printobjectives(datum/mind/ply)
+ var/text = ""
+ var/count = 1
+ for(var/datum/objective/objective in ply.objectives)
+ if(objective.check_completion())
+ text += "
Objective #[count]: [objective.explanation_text] Success!"
+ else
+ text += "
Objective #[count]: [objective.explanation_text] Fail."
+ count++
+ return text
+
+//If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1
+/datum/game_mode/proc/age_check(client/C)
+ if(get_remaining_days(C) == 0)
+ return 1 //Available in 0 days = available right now = player is old enough to play.
+ return 0
+
+
+/datum/game_mode/proc/get_remaining_days(client/C)
+ if(!C)
+ return 0
+ if(!config.use_age_restriction_for_jobs)
+ return 0
+ if(!isnum(C.player_age))
+ return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced
+ if(!isnum(enemy_minimum_age))
+ return 0
+
+ return max(0, enemy_minimum_age - C.player_age)
+
+/datum/game_mode/proc/replace_jobbaned_player(mob/living/M, role_type, pref)
+ var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as a [role_type]?", "[role_type]", null, pref, 50, M)
+ var/mob/dead/observer/theghost = null
+ if(candidates.len)
+ theghost = pick(candidates)
+ to_chat(M, "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!")
+ message_admins("[key_name_admin(theghost)] has taken control of ([key_name_admin(M)]) to replace a jobbaned player.")
+ M.ghostize(0)
+ M.key = theghost.key
+
+/datum/game_mode/proc/remove_antag_for_borging(datum/mind/newborgie)
+ SSticker.mode.remove_cultist(newborgie, 0, 0)
+ SSticker.mode.remove_revolutionary(newborgie, 0)
+
+/datum/game_mode/proc/generate_station_goals()
+ var/list/possible = list()
+ for(var/T in subtypesof(/datum/station_goal))
+ var/datum/station_goal/G = T
+ if(config_tag in initial(G.gamemode_blacklist))
+ continue
+ possible += T
+ var/goal_weights = 0
+ while(possible.len && goal_weights < STATION_GOAL_BUDGET)
+ var/datum/station_goal/picked = pick_n_take(possible)
+ goal_weights += initial(picked.weight)
+ station_goals += new picked
+
+
+/datum/game_mode/proc/declare_station_goal_completion()
+ for(var/V in station_goals)
+ var/datum/station_goal/G = V
+ G.print_result()
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 24d5311af3..0425d7ecd0 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -232,7 +232,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 != ZLEVEL_STATION)
+ if(!istype(T) || !(T.z in GLOB.station_z_levels))
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 != ZLEVEL_STATION)
+ if(!T || !(T.z in GLOB.station_z_levels))
minor_announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", TRUE)
SSshuttle.clearHostileEnvironment(src)
qdel(src)
@@ -374,7 +374,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
milestones[key] = TRUE
minor_announce("[key] SECONDS UNTIL DOOMSDAY DEVICE ACTIVATION!", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", TRUE)
-/obj/machinery/doomsday_device/proc/detonate(z_level = ZLEVEL_STATION)
+/obj/machinery/doomsday_device/proc/detonate(z_level = ZLEVEL_STATION_PRIMARY)
sound_to_playing_players('sound/machines/alarm.ogg')
sleep(100)
for(var/mob/living/L in GLOB.mob_list)
@@ -426,7 +426,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 != ZLEVEL_STATION)
+ if(!(D.z in GLOB.station_z_levels))
continue
INVOKE_ASYNC(D, /obj/machinery/door.proc/hostile_lockdown, src)
addtimer(CALLBACK(D, /obj/machinery/door.proc/disable_lockdown), 900)
@@ -504,7 +504,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 != ZLEVEL_STATION)
+ if(!(F.z in GLOB.station_z_levels))
continue
F.emagged = TRUE
to_chat(owner, "All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.")
@@ -531,7 +531,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 != ZLEVEL_STATION)
+ if(!(AA.z in GLOB.station_z_levels))
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.")
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index 0265b37194..3bb3c8b43e 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -31,15 +31,15 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
var/max_i = 10//number of tries to spawn meteor.
while(!isspaceturf(pickedstart))
var/startSide = pick(GLOB.cardinals)
- pickedstart = spaceDebrisStartLoc(startSide, ZLEVEL_STATION)
- pickedgoal = spaceDebrisFinishLoc(startSide, ZLEVEL_STATION)
+ pickedstart = spaceDebrisStartLoc(startSide, ZLEVEL_STATION_PRIMARY)
+ pickedgoal = spaceDebrisFinishLoc(startSide, ZLEVEL_STATION_PRIMARY)
max_i--
if(max_i<=0)
return
var/Me = pickweight(meteortypes)
var/obj/effect/meteor/M = new Me(pickedstart)
M.dest = pickedgoal
- M.z_original = ZLEVEL_STATION
+ M.z_original = ZLEVEL_STATION_PRIMARY
spawn(0)
walk_towards(M, M.dest, 1)
@@ -96,7 +96,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
pass_flags = PASSTABLE
var/heavy = 0
var/meteorsound = 'sound/effects/meteorimpact.ogg'
- var/z_original = ZLEVEL_STATION
+ var/z_original = ZLEVEL_STATION_PRIMARY
var/threat = 0 // used for determining which meteors are most interesting
var/lifetime = DEFAULT_METEOR_LIFETIME
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm
index ffd1b88d25..97893d6d2e 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm
@@ -9,7 +9,7 @@
var/datum/action/innate/vest_disguise_swap/vest_disguise_action = new
var/datum/action/innate/set_droppoint/set_droppoint_action = new
var/obj/machinery/abductor/console/console
- z_lock = ZLEVEL_STATION
+ z_lock = ZLEVEL_STATION_PRIMARY
icon = 'icons/obj/abductor.dmi'
icon_state = "camera"
diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
index 50b7c93509..91c9b39989 100644
--- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
+++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
@@ -462,7 +462,7 @@
if(target == src)
return
- if(z != ZLEVEL_STATION && z != ZLEVEL_LAVALAND)
+ if(!(z in GLOB.station_z_levels) && z != ZLEVEL_LAVALAND)
to_chat(src, "Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area.")
return
@@ -473,8 +473,8 @@
var/turf/open/floor/F
switch(z) //Only the station/lavaland
- if(ZLEVEL_STATION)
- F =find_safe_turf(zlevels = ZLEVEL_STATION, extended_safety_checks = TRUE)
+ if(ZLEVEL_STATION_PRIMARY)
+ F =find_safe_turf(zlevels = ZLEVEL_STATION_PRIMARY, extended_safety_checks = TRUE)
if(ZLEVEL_LAVALAND)
F = find_safe_turf(zlevels = ZLEVEL_LAVALAND, extended_safety_checks = TRUE)
if(!F)
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index ee611349f8..92230fdbfd 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -435,7 +435,7 @@
var/off_station = 0
var/turf/bomb_location = get_turf(src)
var/area/A = get_area(bomb_location)
- if(bomb_location && (bomb_location.z == ZLEVEL_STATION))
+ if(bomb_location && (bomb_location.z in GLOB.station_z_levels))
if(istype(A, /area/space))
off_station = NUKE_MISS_STATION
if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)))
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 4bc43a6acb..baf0f69ab9 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -126,7 +126,7 @@
if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey)
return 1
var/turf/T = get_turf(target.current)
- if(T && (T.z > ZLEVEL_STATION) || (target.current.client && target.current.client.is_afk())) //If they leave the station or go afk they count as dead for this
+ if(T && (!(T.z in GLOB.station_z_levels)) || (target.current.client && target.current.client.is_afk())) //If they leave the station or go afk they count as dead for this
return 2
return 0
return 1
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index f393dc5338..55fc571459 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -335,7 +335,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 != DEAD) && T && (T.z == ZLEVEL_STATION))
+ if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != DEAD) && T && (T.z in GLOB.station_z_levels))
if(ishuman(rev_mind.current))
return 0
return 1
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index d56837b9ef..bc6833f84a 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -47,7 +47,7 @@
GLOB.cameranet.addCamera(src)
proximity_monitor = new(src, 1)
- if(mapload && z == ZLEVEL_STATION && prob(3) && !start_active)
+ if(mapload && (z in GLOB.station_z_levels) && prob(3) && !start_active)
toggle_cam()
/obj/machinery/camera/Destroy()
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index bf67e05f11..bd203772cb 100755
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -54,7 +54,7 @@
/obj/machinery/computer/communications/Topic(href, href_list)
if(..())
return
- if (z != ZLEVEL_STATION && z != ZLEVEL_CENTCOM) //Can only use on centcom and SS13
+ if(!(z in GLOB.station_z_levels) && z != ZLEVEL_CENTCOM) //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)
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index 56a6320640..a7626258ae 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 == ZLEVEL_STATION && !isspaceturf(M.loc))
+ if((Tr.z in GLOB.station_z_levels) && !isspaceturf(M.loc))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 2b66b23db3..518cd8ab09 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -61,7 +61,7 @@
if(stat & NOPOWER)
return
- if(src.z == ZLEVEL_STATION)
+ if(src.z in GLOB.station_z_levels)
add_overlay("overlay_[GLOB.security_level]")
else
//var/green = SEC_LEVEL_GREEN
@@ -121,7 +121,7 @@
var/list/data = list()
data["emagged"] = emagged
- if(src.z == ZLEVEL_STATION)
+ if(src.z in GLOB.station_z_levels)
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 4cfc6809cc..5d6370188b 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 == ZLEVEL_STATION)
+ if(SSshuttle.supply.z in GLOB.station_z_levels)
line1 = "CARGO"
line2 = "Docked"
else
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 9077283a68..5638b92b99 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -106,7 +106,7 @@
// Off-Site Relays
//
-// You are able to send/receive signals from the station's z level (changeable in the ZLEVEL_STATION #define) if
+// You are able to send/receive signals from the station's z level (changeable in the ZLEVEL_STATION_PRIMARY #define) if
/obj/machinery/telecomms/relay/proc/toggle_level()
@@ -114,7 +114,7 @@
var/turf/position = get_turf(src)
// Toggle on/off getting signals from the station or the current Z level
- if(listening_level == ZLEVEL_STATION) // equals the station
+ if(listening_level in GLOB.station_z_levels) // equals the station
listening_level = position.z
return TRUE
return FALSE
diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm
index de9f6ed44b..8e98465598 100644
--- a/code/game/objects/items/devices/PDA/cart.dm
+++ b/code/game/objects/items/devices/PDA/cart.dm
@@ -437,14 +437,14 @@ Code:
switch(SSshuttle.supply.mode)
if(SHUTTLE_CALL)
menu += "Moving to "
- if(SSshuttle.supply.z != ZLEVEL_STATION)
+ if(!(SSshuttle.supply.z in GLOB.station_z_levels))
menu += "station"
else
menu += "centcom"
menu += " ([SSshuttle.supply.timeLeft(600)] Mins)"
else
menu += "At "
- if(SSshuttle.supply.z != ZLEVEL_STATION)
+ if(!(SSshuttle.supply.z in GLOB.station_z_levels))
menu += "centcom"
else
menu += "station"
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index b88451b724..f8b225a105 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -624,7 +624,7 @@
if(3)
var/count = 0
for(var/mob/living/carbon/monkey/Monkey in world)
- if(Monkey.z == ZLEVEL_STATION)
+ if(Monkey.z in GLOB.station_z_levels)
count++
return "Kill all [count] of the monkeys on the station"
if(4)
diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm
index 70c7346369..b74ba95cde 100644
--- a/code/modules/admin/secrets.dm
+++ b/code/modules/admin/secrets.dm
@@ -454,7 +454,7 @@
return
SSblackbox.add_details("admin_secrets_fun_used","Egalitarian Station")
for(var/obj/machinery/door/airlock/W in GLOB.machines)
- if(W.z == ZLEVEL_STATION && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
+ 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))
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 362ce2a1d8..d3bcde7c89 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -509,7 +509,7 @@ GLOBAL_PROTECT(AdminProcCallCount)
for(var/area/A in world)
if(on_station)
var/turf/picked = safepick(get_area_turfs(A.type))
- if(picked && (picked.z == ZLEVEL_STATION))
+ if(picked && (picked.z in GLOB.station_z_levels))
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 c8df7f56f1..48705ad854 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -80,7 +80,7 @@
for(var/mob/living/carbon/human/applicant in GLOB.player_list)
if(ROLE_CHANGELING in applicant.client.prefs.be_special)
var/turf/T = get_turf(applicant)
- if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION)
+ if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && (T.z in GLOB.station_z_levels))
if(!jobban_isbanned(applicant, ROLE_CHANGELING) && !jobban_isbanned(applicant, "Syndicate"))
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
@@ -113,7 +113,7 @@
for(var/mob/living/carbon/human/applicant in GLOB.player_list)
if(ROLE_REV in applicant.client.prefs.be_special)
var/turf/T = get_turf(applicant)
- if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION)
+ if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && (T.z in GLOB.station_z_levels))
if(!jobban_isbanned(applicant, ROLE_REV) && !jobban_isbanned(applicant, "Syndicate"))
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
@@ -155,7 +155,7 @@
for(var/mob/living/carbon/human/applicant in GLOB.player_list)
if(ROLE_CULTIST in applicant.client.prefs.be_special)
var/turf/T = get_turf(applicant)
- if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION)
+ if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && (T.z in GLOB.station_z_levels))
if(!jobban_isbanned(applicant, ROLE_CULTIST) && !jobban_isbanned(applicant, "Syndicate"))
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
@@ -188,7 +188,7 @@
for(var/mob/living/carbon/human/applicant in GLOB.player_list)
if(ROLE_SERVANT_OF_RATVAR in applicant.client.prefs.be_special)
var/turf/T = get_turf(applicant)
- if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION)
+ if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && (T.z in GLOB.station_z_levels))
if(!jobban_isbanned(applicant, ROLE_SERVANT_OF_RATVAR) && !jobban_isbanned(applicant, "Syndicate"))
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
diff --git a/code/modules/awaymissions/signpost.dm b/code/modules/awaymissions/signpost.dm
index 00012f8a40..f6fd4d9071 100644
--- a/code/modules/awaymissions/signpost.dm
+++ b/code/modules/awaymissions/signpost.dm
@@ -5,11 +5,12 @@
anchored = TRUE
density = TRUE
var/question = "Travel back?"
- var/zlevels = list(ZLEVEL_STATION)
+ var/list/zlevels = list()
/obj/structure/signpost/New()
. = ..()
set_light(2)
+ zlevels = GLOB.station_z_levels
/obj/structure/signpost/attackby(obj/item/W, mob/user, params)
return attack_hand(user)
diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm
index 161fcd8c16..545b72a1bc 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 == ZLEVEL_STATION && !temp_vent.welded)
+ if((temp_vent.loc.z in GLOB.station_z_levels) && !temp_vent.welded)
var/datum/pipeline/temp_vent_parent = temp_vent.PARENT1
//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 d655337ba6..461ffecd3f 100644
--- a/code/modules/events/brand_intelligence.dm
+++ b/code/modules/events/brand_intelligence.dm
@@ -27,7 +27,7 @@
/datum/round_event/brand_intelligence/start()
for(var/obj/machinery/vending/V in GLOB.machines)
- if(V.z != ZLEVEL_STATION)
+ if(!(V.z in GLOB.station_z_levels))
continue
vendingMachines.Add(V)
if(!vendingMachines.len)
diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm
index dbac242321..a3ce69e0bd 100644
--- a/code/modules/events/disease_outbreak.dm
+++ b/code/modules/events/disease_outbreak.dm
@@ -25,7 +25,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
- if(T.z != ZLEVEL_STATION)
+ if(!(T.z in GLOB.station_z_levels))
continue
if(!H.client)
continue
diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm
index c6ba4d1bd0..f1af035a29 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 == ZLEVEL_STATION)
+ if(C.cell && (C.z in GLOB.station_z_levels))
C.energy_fail(rand(30,120))
\ No newline at end of file
diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm
index ae58ece0bb..c5a9c1a142 100644
--- a/code/modules/events/holiday/xmas.dm
+++ b/code/modules/events/holiday/xmas.dm
@@ -25,7 +25,7 @@
/datum/round_event/presents/start()
for(var/obj/structure/flora/tree/pine/xmas in world)
- if(xmas.z != ZLEVEL_STATION)
+ if(!(xmas.z in GLOB.station_z_levels))
continue
for(var/turf/open/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm
index f3a21445d3..0fc6a58499 100644
--- a/code/modules/events/immovable_rod.dm
+++ b/code/modules/events/immovable_rod.dm
@@ -21,6 +21,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
/datum/round_event/immovable_rod/start()
var/startside = pick(GLOB.cardinals)
+<<<<<<< HEAD
var/turf/startT = spaceDebrisStartLoc(startside, ZLEVEL_STATION)
var/turf/endT = spaceDebrisFinishLoc(startside, ZLEVEL_STATION)
new /obj/effect/immovablerod(startT, endT)
@@ -31,6 +32,18 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
icon = 'icons/obj/objects.dmi'
icon_state = "immrod"
throwforce = 100
+=======
+ var/turf/startT = spaceDebrisStartLoc(startside, ZLEVEL_STATION_PRIMARY)
+ var/turf/endT = spaceDebrisFinishLoc(startside, ZLEVEL_STATION_PRIMARY)
+ new /obj/effect/immovablerod(startT, endT)
+
+/obj/effect/immovablerod
+ name = "immovable rod"
+ desc = "What the fuck is that?"
+ icon = 'icons/obj/objects.dmi'
+ icon_state = "immrod"
+ throwforce = 100
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
density = TRUE
anchored = TRUE
var/z_original = 0
diff --git a/code/modules/events/portal_storm.dm b/code/modules/events/portal_storm.dm
index 9658d8b144..552179343c 100644
--- a/code/modules/events/portal_storm.dm
+++ b/code/modules/events/portal_storm.dm
@@ -40,7 +40,7 @@
storm = storm = mutable_appearance('icons/obj/tesla_engine/energy_ball.dmi', "energy_ball_fast", FLY_LAYER)
storm.color = "#00FF00"
- station_areas = get_areas_in_z(ZLEVEL_STATION)
+ station_areas = get_areas_in_z(ZLEVEL_STATION_PRIMARY)
number_of_bosses = 0
for(var/boss in boss_types)
diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm
index e4f2b6b1a7..54f7532923 100644
--- a/code/modules/events/radiation_storm.dm
+++ b/code/modules/events/radiation_storm.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/datum/round_event_control/radiation_storm
name = "Radiation Storm"
typepath = /datum/round_event/radiation_storm
@@ -18,3 +19,24 @@
/datum/round_event/radiation_storm/start()
SSweather.run_weather("radiation storm",ZLEVEL_STATION)
make_maint_all_access()
+=======
+/datum/round_event_control/radiation_storm
+ name = "Radiation Storm"
+ typepath = /datum/round_event/radiation_storm
+ max_occurrences = 1
+
+/datum/round_event/radiation_storm
+
+
+/datum/round_event/radiation_storm/setup()
+ startWhen = 3
+ endWhen = startWhen + 1
+ announceWhen = 1
+
+/datum/round_event/radiation_storm/announce()
+ priority_announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/ai/radiation.ogg')
+ //sound not longer matches the text, but an audible warning is probably good
+
+/datum/round_event/radiation_storm/start()
+ SSweather.run_weather("radiation storm",ZLEVEL_STATION_PRIMARY)
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm
index a425c540b3..253ef6a639 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.living_mob_list)
var/turf/T = get_turf(L)
- if(T.z != ZLEVEL_STATION)
+ if(!(T.z in GLOB.station_z_levels))
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 a3296ebab6..3469fd8a88 100644
--- a/code/modules/events/spider_infestation.dm
+++ b/code/modules/events/spider_infestation.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/datum/round_event_control/spider_infestation
name = "Spider Infestation"
typepath = /datum/round_event/spider_infestation
@@ -35,3 +36,42 @@
spawn_atom_to_turf(spawn_type, vent, 1, FALSE)
vents -= vent
spawncount--
+=======
+/datum/round_event_control/spider_infestation
+ name = "Spider Infestation"
+ typepath = /datum/round_event/spider_infestation
+ weight = 5
+ max_occurrences = 1
+ min_players = 15
+
+/datum/round_event/spider_infestation
+ announceWhen = 400
+
+ var/spawncount = 1
+
+
+/datum/round_event/spider_infestation/setup()
+ announceWhen = rand(announceWhen, announceWhen + 50)
+ spawncount = rand(5, 8)
+
+/datum/round_event/spider_infestation/announce()
+ priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", 'sound/ai/aliens.ogg')
+
+
+/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)
+ var/datum/pipeline/temp_vent_parent = temp_vent.PARENT1
+ if(temp_vent_parent.other_atmosmch.len > 20)
+ vents += temp_vent
+
+ while((spawncount >= 1) && vents.len)
+ var/obj/vent = pick(vents)
+ var/spawn_type = /obj/structure/spider/spiderling
+ if(prob(66))
+ spawn_type = /obj/structure/spider/spiderling/nurse
+ spawn_atom_to_turf(spawn_type, vent, 1, FALSE)
+ vents -= vent
+ spawncount--
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm
index 2039e58caa..ab7c63cdb0 100644
--- a/code/modules/events/vent_clog.dm
+++ b/code/modules/events/vent_clog.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/datum/round_event_control/vent_clog
name = "Clogged Vents"
typepath = /datum/round_event/vent_clog
@@ -47,3 +48,54 @@
while(cockroaches)
new /mob/living/simple_animal/cockroach(get_turf(vent))
cockroaches--
+=======
+/datum/round_event_control/vent_clog
+ name = "Clogged Vents"
+ typepath = /datum/round_event/vent_clog
+ weight = 35
+
+/datum/round_event/vent_clog
+ announceWhen = 1
+ startWhen = 5
+ endWhen = 35
+ var/interval = 2
+ var/list/vents = list()
+ var/list/gunk = list("water","carbon","flour","radium","toxin","cleaner","nutriment","condensedcapsaicin","mushroomhallucinogen","lube",
+ "plantbgone","banana","charcoal","space_drugs","morphine","holywater","ethanol","hot_coco","sacid")
+
+/datum/round_event/vent_clog/announce()
+ priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejection of contents may occur.", "Atmospherics alert")
+
+
+/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)
+ var/datum/pipeline/temp_vent_parent = temp_vent.PARENT1
+ if(temp_vent_parent.other_atmosmch.len > 20)
+ vents += temp_vent
+ if(!vents.len)
+ return kill()
+
+/datum/round_event/vent_clog/tick()
+ if(activeFor % interval == 0)
+ var/obj/machinery/atmospherics/components/unary/vent = pick_n_take(vents)
+ while(vent && vent.welded)
+ vent = pick_n_take(vents)
+
+ if(vent && vent.loc)
+ var/datum/reagents/R = new/datum/reagents(50)
+ R.my_atom = vent
+ R.add_reagent(pick(gunk), 50)
+
+ var/datum/effect_system/smoke_spread/chem/smoke = new
+ smoke.set_up(R, 1, vent, silent = 1)
+ playsound(vent.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
+ smoke.start()
+ qdel(R)
+
+ var/cockroaches = prob(33) ? 3 : 0
+ while(cockroaches)
+ new /mob/living/simple_animal/cockroach(get_turf(vent))
+ cockroaches--
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/modules/events/wizard/advanced_darkness.dm b/code/modules/events/wizard/advanced_darkness.dm
index e6d20ad70d..0f68bb936e 100644
--- a/code/modules/events/wizard/advanced_darkness.dm
+++ b/code/modules/events/wizard/advanced_darkness.dm
@@ -13,4 +13,4 @@
/datum/round_event/wizard/darkness/start()
if(!started)
started = TRUE
- SSweather.run_weather("advanced darkness", ZLEVEL_STATION)
+ SSweather.run_weather("advanced darkness", ZLEVEL_STATION_PRIMARY)
diff --git a/code/modules/events/wizard/curseditems.dm b/code/modules/events/wizard/curseditems.dm
index 1dba06f239..f5b6ae1cc1 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.living_mob_list)
- if(ruins_spaceworthiness && (H.z != ZLEVEL_STATION || isspaceturf(H.loc) || isplasmaman(H)))
+ if(ruins_spaceworthiness && !(H.z in GLOB.station_z_levels) || isspaceturf(H.loc) || isplasmaman(H))
continue //#savetheminers
if(ruins_wizard_loadout && H.mind && ((H.mind in SSticker.mode.wizards) || (H.mind in SSticker.mode.apprentices)))
continue
diff --git a/code/modules/events/wizard/lava.dm b/code/modules/events/wizard/lava.dm
index 190752cc68..a4426ce928 100644
--- a/code/modules/events/wizard/lava.dm
+++ b/code/modules/events/wizard/lava.dm
@@ -12,4 +12,4 @@
/datum/round_event/wizard/lava/start()
if(!started)
started = TRUE
- SSweather.run_weather("the floor is lava", ZLEVEL_STATION)
+ SSweather.run_weather("the floor is lava", ZLEVEL_STATION_PRIMARY)
diff --git a/code/modules/events/wizard/petsplosion.dm b/code/modules/events/wizard/petsplosion.dm
index 05582043b9..5654cbfe04 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.living_mob_list)
- if(!ishostile(F) && F.z == ZLEVEL_STATION)
+ if(!ishostile(F) && (F.z in GLOB.station_z_levels))
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.living_mob_list) //If you cull the heard before the next replication, things will be easier for you
- if(!ishostile(F) && F.z == ZLEVEL_STATION)
+ if(!ishostile(F) && (F.z in GLOB.station_z_levels))
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 e04cb2da2b..568a8fbc72 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.living_mob_list)
- if(H.z != ZLEVEL_STATION)
+ if(!(H.z in GLOB.station_z_levels))
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 167eb77cfc..6404307d34 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 == ZLEVEL_STATION)
+ if(T.z in GLOB.station_z_levels)
pick_turfs += T
for(var/i = 1, i <= number_of_wormholes, i++)
diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm
index fbe5a1fb30..a28f450087 100644
--- a/code/modules/mining/aux_base.dm
+++ b/code/modules/mining/aux_base.dm
@@ -37,7 +37,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 == ZLEVEL_STATION ? "Docking clamps engaged. Standing by." : "Mining Shuttle Uplink: [M ? M.getStatusText() : "*OFFLINE*"]"]
"
+ var/dat = "[(z in GLOB.station_z_levels) ? "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)
@@ -47,7 +47,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 == ZLEVEL_STATION) //Only available if miners are lazy and did not set an LZ using the remote.
+ if(!destination_found && (z in GLOB.station_z_levels)) //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
\
@@ -86,7 +86,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
return
if(href_list["move"])
- if(z != ZLEVEL_STATION && shuttleId == "colony_drop")
+ if(!(z in GLOB.station_z_levels && shuttleId == "colony_drop"))
to_chat(usr, "You can't move the base again!")
return
var/shuttle_error = SSshuttle.moveShuttle(shuttleId, href_list["move"], 1)
@@ -200,7 +200,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 == ZLEVEL_STATION)
+ if(A.z in GLOB.station_z_levels)
AB = A
break
if(!AB)
diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm
index 56b7fe3175..1b245c209f 100644
--- a/code/modules/mining/aux_base_camera.dm
+++ b/code/modules/mining/aux_base_camera.dm
@@ -151,8 +151,7 @@
to_chat(owner, "You can only build within the mining base!")
return FALSE
-
- if(build_target.z != ZLEVEL_STATION)
+ if(!(build_target.z in GLOB.station_z_levels))
to_chat(owner, "The mining base has launched and can no longer be modified.")
return FALSE
diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm
index 00fdbfb561..e0197cc4e3 100644
--- a/code/modules/mining/equipment/wormhole_jaunter.dm
+++ b/code/modules/mining/equipment/wormhole_jaunter.dm
@@ -41,7 +41,7 @@
for(var/obj/item/device/radio/beacon/B in GLOB.teleportbeacons)
var/turf/T = get_turf(B)
- if(T.z == ZLEVEL_STATION)
+ if(T.z in GLOB.station_z_levels)
destinations += B
return destinations
@@ -93,7 +93,7 @@
/obj/effect/portal/wormhole/jaunt_tunnel/teleport(atom/movable/M)
if(!ismob(M) && !isobj(M)) //No don't teleport lighting and effects!
return
-
+
if(M.anchored && (!ismob(M) || (istype(M, /obj/mecha) && !mech_sized)))
return
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 9726022afc..abead3ab9a 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 != ZLEVEL_STATION)
+ if(!(z in GLOB.station_z_levels))
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 71010d252e..15d05d37fe 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -69,7 +69,7 @@
var/global/list/dumb_rev_heads = list()
/obj/machinery/computer/shuttle/mining/attack_hand(mob/user)
- if(user.z == ZLEVEL_STATION && user.mind && (user.mind in SSticker.mode.head_revolutionaries) && !(user.mind in dumb_rev_heads))
+ if((user.z in GLOB.station_z_levels) && user.mind && (user.mind in SSticker.mode.head_revolutionaries) && !(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/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 75d7f637cd..2525dcbd78 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -106,7 +106,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
if(turfs.len)
T = pick(turfs)
else
- T = locate(round(world.maxx/2), round(world.maxy/2), ZLEVEL_STATION) //middle of the station
+ T = locate(round(world.maxx/2), round(world.maxy/2), ZLEVEL_STATION_PRIMARY) //middle of the station
loc = T
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 9d8d2b704b..e2a257e0ce 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -422,7 +422,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
if(drunkenness >= 91)
adjustBrainLoss(0.4)
if(prob(20) && !stat)
- if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && z == ZLEVEL_STATION) //QoL mainly
+ if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && (z in GLOB.station_z_levels)) //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/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm
index a63e4cf89f..815b20c0c5 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 != ZLEVEL_STATION && !client) //NPC monsters won't heal while on station
+ if(!(z in GLOB.station_z_levels && !client)) //NPC monsters won't heal while on station
if(guidance)
adjustHealth(-L.maxHealth)
else
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 02ca4a4e26..c4618db620 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 != ZLEVEL_STATION && !client) //NPC monsters won't heal while on station
+ if(!(z in GLOB.station_z_levels && !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 fc050545a5..616fd15dd3 100644
--- a/code/modules/modular_computers/file_system/programs/alarm.dm
+++ b/code/modules/modular_computers/file_system/programs/alarm.dm
@@ -13,7 +13,7 @@
var/has_alert = 0
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
- var/alarm_z = list(ZLEVEL_STATION,ZLEVEL_LAVALAND)
+ var/alarm_z = list(ZLEVEL_STATION_PRIMARY,ZLEVEL_LAVALAND)
/datum/computer_file/program/alarm_monitor/process_tick()
..()
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 c12c83aaed..f4d0abad6d 100644
--- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm
+++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm
@@ -44,7 +44,7 @@
//var/valid_z_levels = (GetConnectedZlevels(T.z) & using_map.station_levels)
for(var/obj/machinery/power/supermatter_shard/S in GLOB.machines)
// Delaminating, not within coverage, not on a tile.
- if(!(S.z == ZLEVEL_STATION || S.z == ZLEVEL_MINING || S.z == T.z) || !istype(S.loc, /turf/))
+ if(!(S.z in GLOB.station_z_levels || S.z == ZLEVEL_MINING || S.z == T.z) || !istype(S.loc, /turf/))
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 24c1580ea2..8ed67d761b 100644
--- a/code/modules/modular_computers/hardware/network_card.dm
+++ b/code/modules/modular_computers/hardware/network_card.dm
@@ -48,7 +48,7 @@
if(holder)
var/turf/T = get_turf(holder)
- if((T && istype(T)) && (T.z == ZLEVEL_STATION || T.z == ZLEVEL_MINING))
+ if((T && istype(T)) && ((T.z in GLOB.station_z_levels) || T.z == ZLEVEL_MINING))
// 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 3b070f1384..63321bae21 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -840,7 +840,7 @@
if(!malf.can_shunt)
to_chat(malf, "You cannot shunt!")
return
- if(src.z != ZLEVEL_STATION)
+ if(!(src.z in GLOB.station_z_levels))
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 df969d869e..381dcbaa75 100644
--- a/code/modules/power/singularity/narsie.dm
+++ b/code/modules/power/singularity/narsie.dm
@@ -54,7 +54,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 == ZLEVEL_STATION && !iscultist(player))
+ if(player.stat != DEAD && (player.loc.z in GLOB.station_z_levels) && !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/repair.dm b/code/modules/procedural_mapping/mapGenerators/repair.dm
index f9b94bba89..9796535df7 100644
--- a/code/modules/procedural_mapping/mapGenerators/repair.dm
+++ b/code/modules/procedural_mapping/mapGenerators/repair.dm
@@ -20,11 +20,11 @@
if(!istype(mother, /datum/mapGenerator/repair/reload_station_map))
return
var/datum/mapGenerator/repair/reload_station_map/mother1 = mother
- if(mother1.z != ZLEVEL_STATION)
+ if(!(mother1.z in GLOB.station_z_levels))
return //This is only for reloading station blocks!
GLOB.reloading_map = TRUE
var/static/dmm_suite/reloader = new
- var/list/bounds = reloader.load_map(file(SSmapping.config.GetFullMapPath()),measureOnly = FALSE, no_changeturf = FALSE,x_offset = 0, y_offset = 0, z_offset = ZLEVEL_STATION, cropMap=TRUE, lower_crop_x = mother1.x_low, lower_crop_y = mother1.y_low, upper_crop_x = mother1.x_high, upper_crop_y = mother1.y_high)
+ var/list/bounds = reloader.load_map(file(SSmapping.config.GetFullMapPath()),measureOnly = FALSE, no_changeturf = FALSE,x_offset = 0, y_offset = 0, z_offset = ZLEVEL_STATION_PRIMARY, cropMap=TRUE, lower_crop_x = mother1.x_low, lower_crop_y = mother1.y_low, upper_crop_x = mother1.x_high, upper_crop_y = mother1.y_high)
var/list/obj/machinery/atmospherics/atmos_machines = list()
var/list/obj/structure/cable/cables = list()
@@ -87,13 +87,13 @@
/datum/mapGenerator/repair/reload_station_map/defineRegion(turf/start, turf/end)
. = ..()
- if(start.z != ZLEVEL_STATION || end.z != ZLEVEL_STATION)
+ if(!(start.z in GLOB.station_z_levels) || !(end.z in GLOB.station_z_levels))
return
x_low = min(start.x, end.x)
y_low = min(start.y, end.y)
x_high = max(start.x, end.x)
y_high = max(start.y, end.y)
- z = ZLEVEL_STATION
+ z = ZLEVEL_STATION_PRIMARY
GLOBAL_VAR_INIT(reloading_map, FALSE)
diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm
index a3e190814e..b13a746ab5 100644
--- a/code/modules/security_levels/security_levels.dm
+++ b/code/modules/security_levels/security_levels.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
GLOBAL_VAR_INIT(security_level, 0)
//0 = code green
//1 = code blue
@@ -132,3 +133,133 @@ GLOBAL_VAR_INIT(security_level, 0)
/mob/verb/set_thing3()
set_security_level(3)
*/
+=======
+GLOBAL_VAR_INIT(security_level, 0)
+//0 = code green
+//1 = code blue
+//2 = code red
+//3 = code delta
+
+//config.alert_desc_blue_downto
+
+/proc/set_security_level(level)
+ switch(level)
+ if("green")
+ level = SEC_LEVEL_GREEN
+ if("blue")
+ level = SEC_LEVEL_BLUE
+ if("red")
+ level = SEC_LEVEL_RED
+ if("delta")
+ level = SEC_LEVEL_DELTA
+
+ //Will not be announced if you try to set to the same level as it already is
+ if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
+ switch(level)
+ if(SEC_LEVEL_GREEN)
+ minor_announce(config.alert_desc_green, "Attention! Security level lowered to green:")
+ if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
+ if(GLOB.security_level >= SEC_LEVEL_RED)
+ SSshuttle.emergency.modTimer(4)
+ else
+ 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)
+ FA.update_icon()
+ if(SEC_LEVEL_BLUE)
+ if(GLOB.security_level < SEC_LEVEL_BLUE)
+ minor_announce(config.alert_desc_blue_upto, "Attention! Security level elevated to blue:",1)
+ if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
+ SSshuttle.emergency.modTimer(0.5)
+ else
+ minor_announce(config.alert_desc_blue_downto, "Attention! Security level lowered to blue:")
+ if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
+ 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)
+ FA.update_icon()
+ if(SEC_LEVEL_RED)
+ if(GLOB.security_level < SEC_LEVEL_RED)
+ minor_announce(config.alert_desc_red_upto, "Attention! Code red!",1)
+ if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
+ if(GLOB.security_level == SEC_LEVEL_GREEN)
+ SSshuttle.emergency.modTimer(0.25)
+ else
+ SSshuttle.emergency.modTimer(0.5)
+ else
+ minor_announce(config.alert_desc_red_downto, "Attention! Code red!")
+ GLOB.security_level = SEC_LEVEL_RED
+
+ /* - At the time of commit, setting status displays didn't work properly
+ var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
+ if(CC)
+ CC.post_status("alert", "redalert")*/
+
+ for(var/obj/machinery/firealarm/FA in GLOB.machines)
+ if(FA.z in GLOB.station_z_levels)
+ FA.update_icon()
+ for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
+ pod.admin_controlled = 0
+ if(SEC_LEVEL_DELTA)
+ minor_announce(config.alert_desc_delta, "Attention! Delta security level reached!",1)
+ if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
+ if(GLOB.security_level == SEC_LEVEL_GREEN)
+ SSshuttle.emergency.modTimer(0.25)
+ else if(GLOB.security_level == SEC_LEVEL_BLUE)
+ 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)
+ FA.update_icon()
+ for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
+ pod.admin_controlled = 0
+ else
+ return
+
+/proc/get_security_level()
+ switch(GLOB.security_level)
+ if(SEC_LEVEL_GREEN)
+ return "green"
+ if(SEC_LEVEL_BLUE)
+ return "blue"
+ if(SEC_LEVEL_RED)
+ return "red"
+ if(SEC_LEVEL_DELTA)
+ return "delta"
+
+/proc/num2seclevel(num)
+ switch(num)
+ if(SEC_LEVEL_GREEN)
+ return "green"
+ if(SEC_LEVEL_BLUE)
+ return "blue"
+ if(SEC_LEVEL_RED)
+ return "red"
+ if(SEC_LEVEL_DELTA)
+ return "delta"
+
+/proc/seclevel2num(seclevel)
+ switch( lowertext(seclevel) )
+ if("green")
+ return SEC_LEVEL_GREEN
+ if("blue")
+ return SEC_LEVEL_BLUE
+ if("red")
+ return SEC_LEVEL_RED
+ if("delta")
+ return SEC_LEVEL_DELTA
+
+
+/*DEBUG
+/mob/verb/set_thing0()
+ set_security_level(0)
+/mob/verb/set_thing1()
+ set_security_level(1)
+/mob/verb/set_thing2()
+ set_security_level(2)
+/mob/verb/set_thing3()
+ set_security_level(3)
+*/
+>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm
index 32324ea233..9199e5eb14 100644
--- a/code/modules/shuttle/navigation_computer.dm
+++ b/code/modules/shuttle/navigation_computer.dm
@@ -1,7 +1,7 @@
/obj/machinery/computer/camera_advanced/shuttle_docker
name = "navigation computer"
desc = "Used to designate a precise transit location for a spacecraft."
- z_lock = ZLEVEL_STATION
+ z_lock = ZLEVEL_STATION_PRIMARY
jump_action = null
var/datum/action/innate/shuttledocker_rotate/rotate_action = new
var/datum/action/innate/shuttledocker_place/place_action = new
diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm
index f035777df5..704b598ba1 100644
--- a/code/modules/shuttle/shuttle.dm
+++ b/code/modules/shuttle/shuttle.dm
@@ -410,7 +410,7 @@
mode = SHUTTLE_RECALL
/obj/docking_port/mobile/proc/enterTransit()
- if(SSshuttle.lockdown && z == ZLEVEL_STATION) //emp went off, no escape
+ if(SSshuttle.lockdown && (z in GLOB.station_z_levels)) //emp went off, no escape
return
previous = null
// if(!destination)
@@ -574,7 +574,7 @@
if(move_mode & MOVE_AREA)
areas_to_move[old_area] = TRUE
-
+
old_turfs[place] = move_mode
/*******************************************All onShuttleMove procs******************************************/
diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm
index 6ef04dcaba..8f208cb3ad 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 == ZLEVEL_STATION)
+ if(z in GLOB.station_z_levels)
return check_blacklist(shuttle_areas)
return ..()
diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm
index f9d90dd342..b21df4000c 100644
--- a/code/modules/shuttle/syndicate.dm
+++ b/code/modules/shuttle/syndicate.dm
@@ -47,7 +47,7 @@
desc = "Used to designate a precise transit location for the syndicate shuttle."
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
- z_lock = ZLEVEL_STATION
+ z_lock = ZLEVEL_STATION_PRIMARY
shuttleId = "syndicate"
shuttlePortId = "syndicate_custom"
shuttlePortName = "custom location"
diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm
index 94cf2dfe9c..6639297e23 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 != ZLEVEL_STATION)
+ if(!A.active || !(A.z in GLOB.station_z_levels))
continue
coverage |= view(A.kill_range,A)
return coverage.len