mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Merge pull request #5268 from Crazylemon64/space_allocation
Removes most hard-coded z level checks
This commit is contained in:
@@ -1980,8 +1980,7 @@
|
||||
return
|
||||
else
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
// TODO: Tie into space manager
|
||||
if((F.z in config.station_levels))
|
||||
if(is_station_level(F.z))
|
||||
spawn(0)
|
||||
if(!F.receivefax(P))
|
||||
to_chat(src.owner, "\red Message transmission to [F.department] failed.")
|
||||
@@ -2328,8 +2327,7 @@
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
var/turf/loc = find_loc(H)
|
||||
var/security = 0
|
||||
// TODO: Tie into space manager
|
||||
if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
|
||||
if(!is_station_level(loc.z) || prisonwarped.Find(H))
|
||||
|
||||
//don't warp them if they aren't ready or are already there
|
||||
continue
|
||||
@@ -2566,8 +2564,7 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","EgL")
|
||||
for(var/obj/machinery/door/airlock/W in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
||||
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
||||
W.req_access = list()
|
||||
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
|
||||
command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
|
||||
@@ -373,8 +373,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
for(var/I in singularities)
|
||||
var/obj/singularity/S = I
|
||||
// TODO: Tie into space manager
|
||||
if(S.z == ZLEVEL_CENTCOMM || S.z >= MAX_Z)
|
||||
if(!is_level_reachable(S.z))
|
||||
continue
|
||||
qdel(S)
|
||||
log_admin("[key_name(src)] has deleted all Singularities and Tesla orbs.")
|
||||
|
||||
@@ -81,8 +81,7 @@ var/list/sounds_cache = list()
|
||||
|
||||
for(var/O in global_intercoms)
|
||||
var/obj/item/device/radio/intercom/I = O
|
||||
// TODO: Tie into space manager
|
||||
if(I.z != ZLEVEL_STATION && !ignore_z)
|
||||
if(!is_station_level(I.z) && !ignore_z)
|
||||
continue
|
||||
if(!I.on && !ignore_power)
|
||||
continue
|
||||
|
||||
@@ -59,7 +59,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
|
||||
var/map = pick(potentialRandomZlevels)
|
||||
var/file = file(map)
|
||||
if(isfile(file))
|
||||
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED)
|
||||
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT))
|
||||
space_manager.add_dirt(zlev)
|
||||
maploader.load_map(file, z_offset = zlev)
|
||||
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
|
||||
|
||||
@@ -115,8 +115,7 @@
|
||||
to_chat(H, "<span class='warning'>You cannot teleport into solid walls.</span>")
|
||||
return 0*///Who the fuck cares? Ninjas in walls are cool.
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(T.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(T.z))
|
||||
to_chat(H, "<span class='warning'>You cannot use your teleporter on this Z-level.</span>")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -181,8 +181,7 @@
|
||||
|
||||
//proc/camera_list(var/datum/file/camnet_key/key)
|
||||
get_machines(var/datum/file/camnet_key/key)
|
||||
// TODO: Tie into space manager
|
||||
if(!computer || computer.z > ZLEVEL_DERELICT)
|
||||
if(!computer || !is_away_level(computer.z))
|
||||
return null
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
@@ -59,8 +59,7 @@
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.radio || ..(href,href_list) )
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(!(computer.z in config.station_levels))
|
||||
if(!is_station_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
|
||||
// TODO: Tie into space manager
|
||||
if(user.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(user.z))
|
||||
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(computer.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
var/dat
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
if(!T.implanted) continue
|
||||
var/loc_display = "Unknown"
|
||||
var/mob/living/carbon/M = T.imp_in
|
||||
// TODO: Tie into space manager
|
||||
if(M.z == ZLEVEL_STATION && !istype(M.loc, /turf/space))
|
||||
if(is_station_level(M.z) && !istype(M.loc, /turf/space))
|
||||
var/turf/mob_loc = get_turf(M)
|
||||
loc_display = mob_loc.loc
|
||||
dat += "ID: [T.id] | Location: [loc_display]<BR>"
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
|
||||
interact()
|
||||
// TODO: Tie into space manager
|
||||
if(!interactable() || computer.z > ZLEVEL_DERELICT)
|
||||
if(!interactable() || is_away_level(computer.z))
|
||||
return
|
||||
var/dat
|
||||
if(src.temp)
|
||||
|
||||
@@ -57,8 +57,7 @@
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(computer.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
var/dat
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
for(var/obj/O in radio_connection.devices)
|
||||
if(istype(O,typekey))
|
||||
T = get_turf(O)
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the radio system cooperate with the space manager
|
||||
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
|
||||
result |= O
|
||||
return result
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
/datum/event/alien_infestation/start()
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
var/obj/item/device/radio/beacon/chosen
|
||||
var/list/possible = list()
|
||||
for(var/obj/item/device/radio/beacon/W in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(W.z in config.station_levels))
|
||||
if(!is_station_level(W.z))
|
||||
continue
|
||||
possible += W
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
/datum/event/brand_intelligence/start()
|
||||
for(var/obj/machinery/vending/V in machines)
|
||||
// TODO: Tie into space manager
|
||||
if(V.z != ZLEVEL_STATION) continue
|
||||
if(!is_station_level(V.z)) continue
|
||||
vendingMachines.Add(V)
|
||||
|
||||
if(!vendingMachines.len)
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if(T.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(T.z))
|
||||
continue
|
||||
var/foundAlready = 0 // don't infect someone that already has the virus
|
||||
for(var/datum/disease/D in H.viruses)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
goal = locate(endx, endy, 1)
|
||||
src.x = startx
|
||||
src.y = starty
|
||||
src.z = ZLEVEL_STATION
|
||||
src.z = level_name_to_num(MAIN_STATION)
|
||||
spawn(0)
|
||||
walk_towards(src, goal, 1)
|
||||
return
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas || !is_station_level(S.z))
|
||||
continue
|
||||
S.last_charge = S.charge
|
||||
S.last_output_attempt = S.output_attempt
|
||||
@@ -36,8 +35,7 @@
|
||||
|
||||
for(var/obj/machinery/power/apc/C in apcs)
|
||||
var/area/current_area = get_area(C)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
|
||||
continue
|
||||
if(C.cell)
|
||||
C.cell.charge = 0
|
||||
@@ -50,15 +48,13 @@
|
||||
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/apc/C in apcs)
|
||||
var/area/current_area = get_area(C)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
|
||||
continue
|
||||
if(C.cell)
|
||||
C.cell.charge = C.cell.maxcharge
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas || !is_station_level(S.z))
|
||||
continue
|
||||
S.charge = S.last_charge
|
||||
S.output_attempt = S.last_output_attempt
|
||||
@@ -70,8 +66,7 @@
|
||||
if(announce)
|
||||
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
// TODO: Tie into space manager
|
||||
if(S.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(S.z))
|
||||
continue
|
||||
S.charge = S.capacity
|
||||
S.output_level = S.output_level_max
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/proc/Christmas_Game_Start()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(xmas.z in config.station_levels)) continue
|
||||
if(!is_station_level(xmas.z)) continue
|
||||
for(var/turf/simulated/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/weapon/a_gift(T)
|
||||
|
||||
@@ -171,7 +171,7 @@ var/global/Holiday = null
|
||||
*/
|
||||
/* var/list/obj/containers = list()
|
||||
for(var/obj/item/weapon/storage/S in world)
|
||||
if(!(S.z in config.station_levels)) continue
|
||||
if(!is_station_level(S.z)) continue
|
||||
containers += S
|
||||
|
||||
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
|
||||
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels) || is_safe_zone(A))
|
||||
if(!is_station_level(A.z) || is_safe_zone(A))
|
||||
continue
|
||||
A.radiation_alert()
|
||||
|
||||
@@ -43,8 +42,7 @@
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
|
||||
if(!is_station_level(T.z) || is_safe_zone(T.loc))
|
||||
continue
|
||||
|
||||
if(istype(H,/mob/living/carbon/human))
|
||||
@@ -63,8 +61,7 @@
|
||||
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
|
||||
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels) || is_safe_zone(A))
|
||||
if(!is_station_level(A.z) || is_safe_zone(A))
|
||||
continue
|
||||
A.reset_radiation_alert()
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, D.loc)
|
||||
sparks.start()
|
||||
D.z = ZLEVEL_CENTCOMM
|
||||
D.z = level_name_to_num(CENTCOMM)
|
||||
D.has_loot = 0
|
||||
|
||||
qdel(D)
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
RS.start()
|
||||
RS.kill()
|
||||
for(var/area/A)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue //Spook on main station only.
|
||||
if(!is_station_level(A.z)) continue //Spook on main station only.
|
||||
if(A.luminosity) continue
|
||||
// if(A.lighting_space) continue
|
||||
if(A.type == /area) continue
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
/datum/event/vent_clog/setup()
|
||||
endWhen = rand(25, 100)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels))
|
||||
if(is_station_level(temp_vent.loc.z))
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
|
||||
/datum/event/wormholes/start()
|
||||
for(var/turf/simulated/floor/T in world)
|
||||
// TODO: Tie into space manager
|
||||
if((T.z in config.station_levels))
|
||||
if(is_station_level(T.z))
|
||||
pick_turfs += T
|
||||
|
||||
for(var/i in 1 to number_of_wormholes)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/datum/holiday/xmas/celebrate()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(xmas.z in config.station_levels)) continue
|
||||
if(!is_station_level(xmas.z)) continue
|
||||
for(var/turf/simulated/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/weapon/a_gift(T)
|
||||
|
||||
@@ -376,8 +376,7 @@
|
||||
|
||||
// Bluespace tomato code copied over from grown.dm.
|
||||
if(get_trait(TRAIT_TELEPORTING))
|
||||
// TODO: Tie into space manager
|
||||
if(target.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(target.z))
|
||||
return 1
|
||||
|
||||
//Plant potency determines radius of teleport.
|
||||
|
||||
@@ -528,8 +528,7 @@
|
||||
|
||||
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
|
||||
var/turf/device_turf = get_turf(user)
|
||||
// TODO: Tie into space manager
|
||||
if(!device_turf||device_turf.z==ZLEVEL_CENTCOMM||device_turf.z>=ZLEVEL_EMPTY)
|
||||
if(!device_turf||is_teleport_allowed(device_turf.z))
|
||||
to_chat(user, "<span class='notice'>You're having difficulties getting the [src.name] to work.</span>")
|
||||
return
|
||||
else
|
||||
@@ -537,8 +536,7 @@
|
||||
var/list/L = list()
|
||||
for(var/obj/item/device/radio/beacon/B in world)
|
||||
var/turf/T = get_turf(B)
|
||||
// TODO: Tie into space manager
|
||||
if(T.z == ZLEVEL_STATION)
|
||||
if(is_station_level(T.z))
|
||||
L += B
|
||||
if(!L.len)
|
||||
to_chat(user, "<span class='notice'>The [src.name] failed to create a wormhole.</span>")
|
||||
|
||||
@@ -240,8 +240,7 @@
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
// TODO: Tie into space manager
|
||||
if(src.z == ZLEVEL_ASTEROID)
|
||||
if(is_mining_level(src.z))
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
|
||||
@@ -18,10 +18,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return 0
|
||||
// TODO: Tie into space manager
|
||||
if(T.z == ZLEVEL_CENTCOMM) //dont detect mobs on centcomm
|
||||
return 0
|
||||
if(T.z >= MAX_Z)
|
||||
if(!is_level_reachable(T.z))
|
||||
return 0
|
||||
if(user != null && src == user)
|
||||
return 0
|
||||
|
||||
@@ -639,15 +639,13 @@ var/list/ai_verbs_default = list(
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
var/ai_allowed_Zlevel = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ASTEROID)
|
||||
var/d
|
||||
var/area/bot_area
|
||||
d += "<A HREF=?src=\ref[src];botrefresh=\ref[Bot]>Query network status</A><br>"
|
||||
d += "<table width='100%'><tr><td width='40%'><h3>Name</h3></td><td width='20%'><h3>Status</h3></td><td width='30%'><h3>Location</h3></td><td width='10%'><h3>Control</h3></td></tr>"
|
||||
|
||||
for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
|
||||
// TODO: Tie into space manager
|
||||
if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
|
||||
if(is_ai_allowed(Bot.z) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
|
||||
bot_area = get_area(Bot)
|
||||
d += "<tr><td width='30%'>[Bot.hacked ? "<span class='bad'>(!) </span>[Bot.name]" : Bot.name] ([Bot.model])</td>"
|
||||
//If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
|
||||
|
||||
@@ -500,8 +500,7 @@
|
||||
/mob/living/silicon/pai/proc/hackloop()
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/living/silicon/ai/AI in player_list)
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(T.z in config.contact_levels))
|
||||
if(!T || !is_station_contact(T.z))
|
||||
break
|
||||
if(T.loc)
|
||||
to_chat(AI, "<font color = red><b>Network Alert: Brute-force encryption crack in progress in [T.loc].</b></font>")
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
var/turf/T = get_turf(src_object)
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(z == T.z || (T.z in config.player_levels)))
|
||||
if(!T || !(atoms_share_level(src,T) || is_level_reachable(T.z)))
|
||||
return STATUS_CLOSE
|
||||
|
||||
// If an object is in view then we can interact with it
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
var/turf/T = get_turf(nano_host())
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(T.z in config.player_levels))
|
||||
if(!T || !is_level_reachable(T.z))
|
||||
to_chat(usr, "<span class='warning'>Unable to establish a connection<span>: You're too far away from the station!")
|
||||
return 0
|
||||
if(href_list["track"])
|
||||
|
||||
@@ -316,8 +316,7 @@
|
||||
if(shuttle_master.supply.mode == SHUTTLE_CALL)
|
||||
supplyData["shuttle_moving"] = 1
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(shuttle_master.supply.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(shuttle_master.supply.z))
|
||||
supplyData["shuttle_loc"] = "station"
|
||||
else
|
||||
supplyData["shuttle_loc"] = "centcom"
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
if(signal.data["done"])
|
||||
useTC = 1
|
||||
var/turf/pos = get_turf(P)
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the radio system cooperate with the space manager
|
||||
if(pos.z in signal.data["level"])
|
||||
useTC = 2
|
||||
//Let's make this barely readable
|
||||
|
||||
@@ -170,8 +170,7 @@
|
||||
apcs -= src
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if(src.z == ZLEVEL_STATION)
|
||||
if(is_station_level(src.z))
|
||||
ticker.mode:apcs--
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
@@ -996,8 +995,7 @@
|
||||
malfai.malfhacking = 0
|
||||
locked = 1
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs++
|
||||
if(usr:parent)
|
||||
src.malfai = usr:parent
|
||||
@@ -1029,8 +1027,7 @@
|
||||
|
||||
if(malfai)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
operating ? ticker.mode:apcs++ : ticker.mode:apcs--
|
||||
|
||||
src.update()
|
||||
@@ -1045,8 +1042,7 @@
|
||||
if(!malf.can_shunt)
|
||||
to_chat(malf, "<span class='warning'>You cannot shunt.</span>")
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(!(src.z in config.station_levels))
|
||||
if(!is_station_level(src.z))
|
||||
return
|
||||
src.occupier = new /mob/living/silicon/ai(src,malf.laws,null,1)
|
||||
src.occupier.adjustOxyLoss(malf.getOxyLoss())
|
||||
@@ -1095,8 +1091,7 @@
|
||||
|
||||
/obj/machinery/power/apc/proc/ion_act()
|
||||
//intended to be exactly the same as an AI malf attack
|
||||
// TODO: Tie into space manager
|
||||
if(!src.malfhack && (src.z in config.station_levels))
|
||||
if(!src.malfhack && is_station_level(src.z))
|
||||
if(prob(3))
|
||||
src.locked = 1
|
||||
if(src.cell.charge > 0)
|
||||
@@ -1371,8 +1366,7 @@
|
||||
/obj/machinery/power/apc/proc/set_broken()
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs--
|
||||
stat |= BROKEN
|
||||
operating = 0
|
||||
|
||||
@@ -124,8 +124,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
O.main_part = null
|
||||
qdel(O)
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
shake_everyone()
|
||||
return ..()
|
||||
@@ -302,8 +301,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought online. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(1,A)
|
||||
else
|
||||
if(gravity_in_level() == 1)
|
||||
@@ -311,8 +309,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought offline with no backup generator. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
|
||||
update_icon()
|
||||
@@ -380,7 +377,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
shake_camera(M, 15, 1)
|
||||
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
|
||||
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the gravity generator cooperate with the space manager
|
||||
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
@@ -389,7 +386,6 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
return length(gravity_generators["[T.z]"])
|
||||
return 0
|
||||
|
||||
// TODO: Tie into space manager
|
||||
/obj/machinery/gravity_generator/main/proc/update_list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
|
||||
@@ -433,8 +433,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/smes/proc/ion_act()
|
||||
// TODO: Tie into space manager
|
||||
if(src.z in config.station_levels)
|
||||
if(is_station_level(src.z))
|
||||
if(prob(1)) //explosion
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
var/turf/T = get_turf(R)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
|
||||
if(!is_teleport_allowed(T.z))
|
||||
continue
|
||||
if(R.syndicate == 1)
|
||||
continue
|
||||
|
||||
@@ -276,17 +276,9 @@ obj/item/projectile/kinetic/New()
|
||||
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
if(ismob(target))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
return ..()
|
||||
if(!gun)
|
||||
qdel(src)
|
||||
gun.create_portal(src)
|
||||
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
if(ismob(target))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
if(is_teleport_allowed(target.z))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
return ..()
|
||||
if(!gun)
|
||||
qdel(src)
|
||||
|
||||
@@ -729,7 +729,7 @@
|
||||
to_chat(user, "<span class='notice'>The [src] begins to vibrate!</span>")
|
||||
spawn(rand(10,30))
|
||||
var/turf/userturf = get_turf(user)
|
||||
if(src.loc == user && userturf.z != ZLEVEL_CENTCOMM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
if(src.loc == user && is_teleport_allowed(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
visible_message("<span class='notice'>The [src] twists and bends, relocating itself!</span>")
|
||||
throwSmoke(userturf)
|
||||
do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg')
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
CC.post_status("alert", "outline")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
|
||||
|
||||
@@ -54,8 +53,7 @@
|
||||
CC.post_status("alert", "outline")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
|
||||
|
||||
@@ -67,8 +65,7 @@
|
||||
security_level = SEC_LEVEL_RED
|
||||
|
||||
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in world
|
||||
// TODO: Tie into space manager
|
||||
if(R && (R.z in config.station_levels))
|
||||
if(R && is_station_level(R.z))
|
||||
R.locked = 0
|
||||
R.update_icon()
|
||||
|
||||
@@ -77,8 +74,7 @@
|
||||
CC.post_status("alert", "redalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
|
||||
|
||||
@@ -90,14 +86,12 @@
|
||||
|
||||
if(security_level < SEC_LEVEL_RED)
|
||||
for(var/obj/machinery/door/airlock/highsecurity/red/R in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((R.z in config.station_levels))
|
||||
if(is_station_level(R.z))
|
||||
R.locked = 0
|
||||
R.update_icon()
|
||||
|
||||
for(var/obj/machinery/door/airlock/hatch/gamma/H in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((H.z in config.station_levels))
|
||||
if(is_station_level(H.z))
|
||||
H.locked = 0
|
||||
H.update_icon()
|
||||
|
||||
@@ -106,8 +100,7 @@
|
||||
CC.post_status("alert", "gammaalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_gamma")
|
||||
FA.update_icon()
|
||||
@@ -121,8 +114,7 @@
|
||||
CC.post_status("alert", "epsilonalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
|
||||
|
||||
@@ -135,8 +127,7 @@
|
||||
CC.post_status("alert", "deltaalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
height = 7
|
||||
|
||||
/obj/docking_port/mobile/assault_pod/request()
|
||||
// TODO: Tie into space manager
|
||||
if(z == initial(src.z)) //No launching pods that have already launched
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -202,8 +202,7 @@
|
||||
if(time_left <= 0 && !shuttle_master.emergencyNoEscape)
|
||||
//move each escape pod to its corresponding transit dock
|
||||
for(var/obj/docking_port/mobile/pod/M in shuttle_master.mobile)
|
||||
// TODO: Tie into space manager
|
||||
if(M.z == ZLEVEL_STATION) //Will not launch from the mine/planet
|
||||
if(is_station_level(M.z)) //Will not launch from the mine/planet
|
||||
M.enterTransit()
|
||||
//now move the actual emergency shuttle to its transit dock
|
||||
for(var/area/shuttle/escape/E in world)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
return 1
|
||||
|
||||
/obj/docking_port/mobile/supply/canMove()
|
||||
if(z == ZLEVEL_STATION)
|
||||
if(is_station_level(z))
|
||||
return forbidden_atoms_check(areaInstance)
|
||||
return ..()
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
sell()
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/buy()
|
||||
if(z != ZLEVEL_STATION) //we only buy when we are -at- the station
|
||||
if(!is_station_level(z)) //we only buy when we are -at- the station
|
||||
return 1
|
||||
|
||||
if(!shuttle_master.shoppinglist.len)
|
||||
@@ -93,7 +93,7 @@
|
||||
shuttle_master.shoppinglist.Cut()
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/sell()
|
||||
if(z != ZLEVEL_CENTCOMM) //we only sell when we are -at- centcomm
|
||||
if(z != level_name_to_num(CENTCOMM)) //we only sell when we are -at- centcomm
|
||||
return 1
|
||||
|
||||
var/plasma_count = 0
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
/obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list)
|
||||
if(href_list["move"])
|
||||
if(z != ZLEVEL_CENTCOMM)
|
||||
if(z != level_name_to_num(CENTCOMM))
|
||||
to_chat(usr, "<span class='warning'>Pods are one way!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
#undef SYNDICATE_CHALLENGE_TIMER
|
||||
#undef SYNDICATE_CHALLENGE_TIMER
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/proc/is_on_level_name(atom/A,name)
|
||||
var/datum/space_level/S = space_manager.get_zlev_by_name(name)
|
||||
return A.z == S.zpos
|
||||
|
||||
// For expansion later
|
||||
/proc/atoms_share_level(atom/A, atom/B)
|
||||
return A.z == B.z
|
||||
@@ -0,0 +1,62 @@
|
||||
/proc/is_level_reachable(z)
|
||||
return check_level_trait(z, REACHABLE)
|
||||
|
||||
/proc/is_station_level(z)
|
||||
return check_level_trait(z, STATION_LEVEL)
|
||||
|
||||
/proc/is_station_contact(z)
|
||||
return check_level_trait(z, STATION_CONTACT)
|
||||
|
||||
/proc/is_teleport_allowed(z)
|
||||
return !check_level_trait(z, BLOCK_TELEPORT)
|
||||
|
||||
/proc/is_admin_level(z)
|
||||
return check_level_trait(z, ADMIN_LEVEL)
|
||||
|
||||
/proc/is_away_level(z)
|
||||
return check_level_trait(z, AWAY_LEVEL)
|
||||
|
||||
/proc/is_mining_level(z)
|
||||
return check_level_trait(z, ORE_LEVEL)
|
||||
|
||||
/proc/is_ai_allowed(z)
|
||||
return check_level_trait(z, AI_OK)
|
||||
|
||||
/proc/level_blocks_magic(z)
|
||||
return check_level_trait(z, IMPEDES_MAGIC)
|
||||
|
||||
/proc/level_boosts_signal(z)
|
||||
return check_level_trait(z, BOOSTS_SIGNAL)
|
||||
|
||||
// Used for the nuke disk, or for checking if players survived through xenos
|
||||
/proc/is_secure_level(z)
|
||||
var/secure = check_level_trait(z, STATION_LEVEL)
|
||||
if(!secure)
|
||||
// This is to allow further admin levels later, other than centcomm
|
||||
secure = (z == level_name_to_num(CENTCOMM))
|
||||
return secure
|
||||
|
||||
var/list/default_map_traits = MAP_TRANSITION_CONFIG
|
||||
/proc/check_level_trait(z, trait)
|
||||
if(z == 0)
|
||||
return 0 // If you're nowhere, you have no traits
|
||||
var/list/trait_list
|
||||
if(space_manager.initialized)
|
||||
var/datum/space_level/S = space_manager.get_zlev(z)
|
||||
trait_list = S.flags
|
||||
else
|
||||
trait_list = default_map_traits[z]
|
||||
trait_list = trait_list["attributes"]
|
||||
return (trait in trait_list)
|
||||
|
||||
/proc/levels_by_trait(trait)
|
||||
var/list/result = list()
|
||||
for(var/A in space_manager.z_list)
|
||||
var/datum/space_level/S = space_manager.z_list[A]
|
||||
if(trait in S.flags)
|
||||
result |= S
|
||||
return result
|
||||
|
||||
/proc/level_name_to_num(name)
|
||||
var/datum/space_level/S = space_manager.get_zlev_by_name(name)
|
||||
return S.zpos
|
||||
@@ -1,7 +1,7 @@
|
||||
/datum/space_level
|
||||
var/name = "Your config settings failed, you need to fix this for the datum space levels to work"
|
||||
var/zpos = 1
|
||||
var/flags = 0 // We'll use this to keep track of whether you can teleport/etc
|
||||
var/flags = list() // We'll use this to keep track of whether you can teleport/etc
|
||||
|
||||
// Map transition stuff
|
||||
var/list/neighbors = list()
|
||||
@@ -19,8 +19,9 @@
|
||||
var/dirt_count = 0
|
||||
var/list/init_list = list()
|
||||
|
||||
/datum/space_level/New(z, name, transition_type = SELFLOOPING)
|
||||
/datum/space_level/New(z, name, transition_type = SELFLOOPING, traits = list(BLOCK_TELEPORT))
|
||||
zpos = z
|
||||
flags = traits
|
||||
set_linkage(transition_type)
|
||||
build_space_destination_arrays()
|
||||
|
||||
@@ -57,7 +58,8 @@
|
||||
linkage = transition_type
|
||||
if(transition_type == SELFLOOPING)
|
||||
link_to_self() // `link_to_self` is defined in space_transitions.dm
|
||||
|
||||
if(transition_type == UNAFFECTED)
|
||||
reset_connections()
|
||||
|
||||
/datum/space_level/proc/resume_init()
|
||||
if(dirt_count > 0)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
var/list/direction_cache = list()
|
||||
|
||||
/datum/space_level/proc/link_to_self()
|
||||
reset_connections()
|
||||
neighbors = list()
|
||||
var/list/L = list(Z_LEVEL_NORTH,Z_LEVEL_SOUTH,Z_LEVEL_EAST,Z_LEVEL_WEST)
|
||||
for(var/A in L)
|
||||
@@ -279,7 +280,7 @@
|
||||
/datum/spacewalk_grid/proc/get_height()
|
||||
return 1 + max_y - min_y
|
||||
|
||||
// This function is called repeatedly to build the map
|
||||
// This function chooses an available point next to any node in the grid
|
||||
/datum/spacewalk_grid/proc/get_empty_node()
|
||||
var/datum/point/P = pick(available_nodes)
|
||||
if(isnull(P))
|
||||
@@ -287,6 +288,12 @@
|
||||
consume_node(P)
|
||||
return P
|
||||
|
||||
// This function is called repeatedly to build the map
|
||||
/datum/spacewalk_grid/proc/add_level(datum/space_level/S)
|
||||
var/datum/point/P = get_empty_node()
|
||||
P.set_space_level(S)
|
||||
|
||||
|
||||
// This proc substantiates the grid of points used to determine routes between levels
|
||||
// Separating this from initialization gives us time in which we can add more crosslink z levels
|
||||
// before we bake in all our connections
|
||||
@@ -310,7 +317,6 @@
|
||||
var/datum/spacewalk_grid/point_grid = new
|
||||
// We do this so we can display the way the levels connect later
|
||||
linkage_map = point_grid
|
||||
var/datum/point/P
|
||||
|
||||
// Now, we pop entries in a random order from our list of space levels
|
||||
// and assign its connections based on the grid
|
||||
@@ -318,16 +324,10 @@
|
||||
D = pick(crosslinks)
|
||||
crosslinks.Remove(D)
|
||||
// We now choose a point in our imaginary grid adjacent to our current location
|
||||
P = point_grid.get_empty_node()
|
||||
// Let our z level know where in the imaginary grid it is
|
||||
// This will also handle establishing neighborship with other z levels
|
||||
P.set_space_level(D)
|
||||
point_grid.add_level(D)
|
||||
|
||||
// A heavy proc - loops through all space turfs and sets its destination
|
||||
// Loops through border space turfs and sets its destination
|
||||
// based on its space level's linkage
|
||||
// Takes 0.6 seconds per call on my machine - could have each z level
|
||||
// have its own space turf cache, but I don't want to complicate this more
|
||||
// than is necessary
|
||||
/datum/zlev_manager/proc/setup_space_destinations()
|
||||
var/timer = start_watch()
|
||||
log_debug("Assigning space turf destinations...")
|
||||
|
||||
@@ -3,9 +3,11 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
/datum/zlev_manager
|
||||
// A list of z-levels
|
||||
var/list/z_list = list()
|
||||
var/list/levels_by_name = list()
|
||||
var/list/heaps = list()
|
||||
|
||||
var/datum/spacewalk_grid/linkage_map
|
||||
var/initialized = 0
|
||||
|
||||
// Populate our space level list
|
||||
// and prepare space transitions
|
||||
@@ -14,18 +16,24 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
var/k = 1
|
||||
|
||||
// First take care of "Official" z levels, without visiting levels outside of the list
|
||||
for(var/A in map_transition_config)
|
||||
// `A` is the name
|
||||
// `map_transition_config[A]` is the transition type
|
||||
z_list["[k]"] = new /datum/space_level(k, A, transition_type = map_transition_config[A])
|
||||
for(var/list/features in map_transition_config)
|
||||
if(k > world.maxz)
|
||||
CRASH("More map transitions defined than existent z levels - [num_official_z_levels]")
|
||||
CRASH("More map attributes pre-defined than existent z levels - [num_official_z_levels]")
|
||||
var/name = features["name"]
|
||||
var/linking = features["linkage"]
|
||||
var/list/attributes = features["attributes"]
|
||||
attributes = attributes.Copy() // Clone the list so it can't be changed on accident
|
||||
|
||||
var/datum/space_level/S = new /datum/space_level(k, name, transition_type = linking, traits = attributes)
|
||||
z_list["[k]"] = S
|
||||
levels_by_name[name] = S
|
||||
k++
|
||||
|
||||
// Then, we take care of unmanaged z levels
|
||||
// They get the default linkage of SELFLOOPING
|
||||
for(var/i = k, i <= world.maxz, i++)
|
||||
z_list["[i]"] = new /datum/space_level(i)
|
||||
initialized = 1
|
||||
|
||||
|
||||
/datum/zlev_manager/proc/get_zlev(z)
|
||||
@@ -34,6 +42,11 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
else
|
||||
return z_list["[z]"]
|
||||
|
||||
/datum/zlev_manager/proc/get_zlev_by_name(A)
|
||||
if(!(A in levels_by_name))
|
||||
throw EXCEPTION("Non-existent z level: '[A]'")
|
||||
return levels_by_name[A]
|
||||
|
||||
/*
|
||||
* "Dirt" management
|
||||
* "Dirt" is used to keep track of whether a z level should automatically have
|
||||
@@ -88,10 +101,14 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
|
||||
// Increments the max z-level by one
|
||||
// For convenience's sake returns the z-level added
|
||||
/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING)
|
||||
/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING, traits = list(BLOCK_TELEPORT))
|
||||
if(name in levels_by_name)
|
||||
throw EXCEPTION("Name already in use: [name]")
|
||||
world.maxz++
|
||||
var/our_z = world.maxz
|
||||
z_list["[our_z]"] = new /datum/space_level(our_z,name, transition_type = linkage)
|
||||
var/datum/space_level/S = new /datum/space_level(our_z, name, transition_type = linkage, traits = traits)
|
||||
levels_by_name[name] = S
|
||||
z_list["[our_z]"] = S
|
||||
return our_z
|
||||
|
||||
/datum/zlev_manager/proc/cut_levels_downto(new_maxz)
|
||||
|
||||
@@ -48,8 +48,7 @@ var/global/datum/store/centcomm_store=new
|
||||
|
||||
/datum/store/proc/reconnect_database()
|
||||
for(var/obj/machinery/computer/account_database/DB in world)
|
||||
// TODO: Tie into space manager
|
||||
if((DB.z in config.station_levels))
|
||||
if(is_station_level(DB.z))
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(var/mob/living/L)
|
||||
// TODO: Tie into space manager
|
||||
if(L.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(L.z))
|
||||
src.visible_message("<span class=warning>[src]'s fragments begin rapidly vibrating and blink out of existence.<span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user