diff --git a/aurorastation.dme b/aurorastation.dme index c15988eb768..3a56069ff88 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2937,7 +2937,6 @@ #include "code\modules\spell_system\spells\spell_list\self\conjure\construct_spells\summon_soulstone.dm" #include "code\modules\spell_system\spells\spell_list\self\conjure\morph_spells\create_nest.dm" #include "code\modules\spell_system\spells\spell_list\self\conjure\morph_spells\create_node.dm" -#include "code\modules\spell_system\spells\spell_list\self\generic\area_teleport.dm" #include "code\modules\spell_system\spells\spell_list\self\generic\ethereal_jaunt.dm" #include "code\modules\spell_system\spells\spell_list\self\generic\mutate.dm" #include "code\modules\spell_system\spells\spell_list\self\generic\rune_write.dm" diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 9475c4cacb4..23a84dc3045 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -135,12 +135,13 @@ #define DEFAULT_JOB_TYPE /datum/job/assistant //Area flags, possibly more to come -#define RAD_SHIELDED 1 //shielded from radiation, clearly -#define SPAWN_ROOF 2 // if we should attempt to spawn a roof above us. -#define HIDE_FROM_HOLOMAP 4 // if we shouldn't be drawn on station holomaps -#define FIRING_RANGE 8 -#define NO_CREW_EXPECTED 16 // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level. -#define PRISON 32 // Marks prison area for purposes of checking if brigged/imprisoned +#define RAD_SHIELDED BITFLAG(1) //shielded from radiation, clearly +#define SPAWN_ROOF BITFLAG(2) // if we should attempt to spawn a roof above us. +#define HIDE_FROM_HOLOMAP BITFLAG(3) // if we shouldn't be drawn on station holomaps +#define FIRING_RANGE BITFLAG(4) +#define NO_CREW_EXPECTED BITFLAG(5) // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level. +#define PRISON BITFLAG(6) // Marks prison area for purposes of checking if brigged/imprisoned +#define NO_GHOST_TELEPORT_ACCESS BITFLAG(7) // Marks whether ghosts should not have teleport access to this area // Convoluted setup so defines can be supplied by Bay12 main server compile script. // Should still work fine for people jamming the icons into their repo. diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index fc3b2fd916c..fc0a3dd356c 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -21,7 +21,6 @@ var/global/list/mechas_list = list() //list of all mechs. Used by hostile mob var/global/list/joblist = list() //list of all jobstypes, minus borg and AI var/global/list/brig_closets = list() //list of all brig secure_closets. Used by brig timers. Probably should be converted to use SSwireless eventually. -var/global/list/teleportlocs = list() var/global/list/ghostteleportlocs = list() var/global/list/centcom_areas = list() var/global/list/the_station_areas = list() diff --git a/code/_helpers/names.dm b/code/_helpers/names.dm index 23f8539f62e..dbdfeca2d2f 100644 --- a/code/_helpers/names.dm +++ b/code/_helpers/names.dm @@ -106,7 +106,7 @@ var/syndicate_code_response //Code response for traitors. var/safety[] = list(1,2,3) //Tells the proc which options to remove later on. var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation") var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine") - var/locations[] = teleportlocs.len ? teleportlocs : drinks //if null, defaults to drinks instead. + var/locations[] = the_station_areas.len ? the_station_areas : drinks //if null, defaults to drinks instead. var/maxwords = words //Extra var to check for duplicates. @@ -132,7 +132,8 @@ var/syndicate_code_response //Code response for traitors. if (1) code_phrase += pick(drinks) if (2) - code_phrase += pick(locations) + var/area/location = pick(locations) + code_phrase += location.name safety -= 2 if (3) switch (rand(1,3)) //Nouns, adjectives, verbs. Can be selected more than once. diff --git a/code/controllers/subsystems/initialization/misc_late.dm b/code/controllers/subsystems/initialization/misc_late.dm index 9b7a781afcd..134a57af1af 100644 --- a/code/controllers/subsystems/initialization/misc_late.dm +++ b/code/controllers/subsystems/initialization/misc_late.dm @@ -6,27 +6,15 @@ flags = SS_NO_FIRE | SS_NO_DISPLAY /datum/controller/subsystem/misc_late/Initialize(timeofday) - var/turf/picked // Setup the teleport locs. - for (var/thing in all_areas) - var/area/AR = thing - picked = null - if(!(istype(AR, /area/shuttle) || istype(AR, /area/antag/wizard))) - picked = pick_area_turf(AR.type, list(/proc/is_station_turf)) - if (picked) - teleportlocs += AR.name - teleportlocs[AR.name] = AR - - if(istype(AR, /area/turret_protected/aisat) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops)) + for(var/area/AR as anything in the_station_areas) + if(AR.flags & NO_GHOST_TELEPORT_ACCESS) + continue + var/list/area_turfs = AR.contents + if (area_turfs.len) // Check the area is mapped ghostteleportlocs += AR.name ghostteleportlocs[AR.name] = AR - picked = pick_area_turf(AR.type, list(/proc/is_station_turf)) - if (picked) - ghostteleportlocs += AR.name - ghostteleportlocs[AR.name] = AR - - sortTim(teleportlocs, /proc/cmp_text_asc) sortTim(ghostteleportlocs, /proc/cmp_text_asc) setupgenetics() diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index daac4ef97ca..3f0a52f7ec3 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -31,15 +31,20 @@ to_chat(user, "\The [src] has ran out of uses, and is now useless to you!") return else - var/area_wanted = input(user, "Area to teleport to", "Teleportation") in teleportlocs - var/area/A = teleportlocs[area_wanted] - if(!A) + var/list/area/valid_areas = list() + for(var/area/A as anything in the_station_areas) + if(!is_not_shuttle_area(A)) + continue + else + valid_areas += A + var/area/A = input(user, "Area to teleport to", "Teleportation") as area in valid_areas + if(!isarea(A) || !(A in the_station_areas)) return if (user.stat || user.restrained()) return - if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf))))) + if(!((user == loc || (in_range(src, user) && isturf(loc))))) return spark(src, 5, 0) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 25880d8cd1a..a71cf0d6bb4 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -565,7 +565,7 @@ the implant may become unstable and either pre-maturely inject the subject or si STOP_PROCESSING(SSprocessing, src) if ("emp") var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset(null) - var/name = prob(50) ? t.name : pick(teleportlocs) + var/name = prob(50) ? t.name : pick(the_station_areas) a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm") qdel(a) else diff --git a/code/modules/modular_computers/file_system/programs/security/implant_tracker.dm b/code/modules/modular_computers/file_system/programs/security/implant_tracker.dm index ba0a04e1cda..0bcde7bb477 100644 --- a/code/modules/modular_computers/file_system/programs/security/implant_tracker.dm +++ b/code/modules/modular_computers/file_system/programs/security/implant_tracker.dm @@ -62,7 +62,8 @@ var/area/A = get_area(M) loc_display = A.name if(T.malfunction) - loc_display = pick(teleportlocs) + var/area/location = pick(the_station_areas) + loc_display = location.name var/list/tracker_info = list( "id" = T.id, "loc_display" = loc_display, diff --git a/code/modules/spell_system/spells/spell_list/self/generic/area_teleport.dm b/code/modules/spell_system/spells/spell_list/self/generic/area_teleport.dm deleted file mode 100644 index 8760b7e187d..00000000000 --- a/code/modules/spell_system/spells/spell_list/self/generic/area_teleport.dm +++ /dev/null @@ -1,78 +0,0 @@ -/spell/area_teleport - name = "Teleport" - desc = "This spell teleports you to a type of area of your selection." - feedback = "TP" - school = "abjuration" - charge_max = 600 - invocation = "SCYAR NILA" - invocation_type = SpI_SHOUT - cooldown_min = 200 //100 deciseconds reduction per rank - - smoke_spread = 1 - smoke_amt = 5 - - var/randomise_selection = 0 //if it lets the usr choose the teleport loc or picks it from the list - var/invocation_area = 1 //if the invocation appends the selected area - - cast_sound = 'sound/effects/teleport.ogg' - - hud_state = "wiz_tele" - -/spell/area_teleport/before_cast() - return - -/spell/area_teleport/choose_targets() - var/A = null - - if(!randomise_selection) - A = input("Area to teleport to", "Teleport", A) in teleportlocs - else - A = pick(teleportlocs) - - var/area/thearea = teleportlocs[A] - - return list(thearea) - -/spell/area_teleport/cast(area/thearea, mob/user) - if(!istype(thearea) && istype(thearea, /list)) - thearea = thearea[1] - - var/list/L = list() - for(var/turf/T in get_area_turfs(thearea)) - if(!T.density) - var/clear = 1 - if(T.is_hole) //No more teleporting in holes. - continue - for(var/obj/O in T) - if(O.density) - clear = 0 - break - if(clear) - L+=T - - if(!L.len) - to_chat(user, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.") - return - - if(user && user.buckled_to) - var/obj/structure/bed/B = user.buckled_to - if(B && B.buckled) - B.user_unbuckle(user) - user.buckled_to = null - - do_teleport(user,pick(L)) - - return - -/spell/area_teleport/after_cast() - return - -/spell/area_teleport/invocation(mob/user, area/chosenarea) - if(!istype(chosenarea)) - return //can't have that, can we - if(!invocation_area || !chosenarea) - ..() - else - invocation += "[uppertext(chosenarea.name)]" - ..() - return diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index 2ec930489ad..5ae1efbbc89 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -9,11 +9,13 @@ #define FAILURE 0 #define SUCCESS 1 +/datum/unit_test/map_test + name = "MAP TEST template" -datum/unit_test/apc_area_test +/datum/unit_test/map_test/apc_area_test name = "MAP: Area Test APC / Scrubbers / Vents (Station)" -datum/unit_test/apc_area_test/start_test() +/datum/unit_test/map_test/apc_area_test/start_test() var/list/bad_areas = list() var/area_test_count = 0 @@ -57,10 +59,10 @@ datum/unit_test/apc_area_test/start_test() //======================================================================================= -datum/unit_test/wire_test +/datum/unit_test/map_test/wire_test name = "MAP: Cable Test (Station)" -datum/unit_test/wire_test/start_test() +/datum/unit_test/map_test/wire_test/start_test() var/wire_test_count = 0 var/bad_tests = 0 var/turf/T = null @@ -92,10 +94,10 @@ datum/unit_test/wire_test/start_test() return 1 -/datum/unit_test/roof_test +/datum/unit_test/map_test/roof_test name = "MAP: Roof Test (Station)" -/datum/unit_test/roof_test/start_test() +/datum/unit_test/map_test/roof_test/start_test() var/bad_tiles = 0 var/tiles_total = 0 var/turf/above @@ -123,10 +125,10 @@ datum/unit_test/wire_test/start_test() #define BLOCKED_UP 1 #define BLOCKED_DOWN 2 -/datum/unit_test/ladder_test +/datum/unit_test/map_test/ladder_test name = "MAP: Ladder Test (Station)" -/datum/unit_test/ladder_test/start_test() +/datum/unit_test/map_test/ladder_test/start_test() var/ladders_total = 0 var/ladders_incomplete = 0 var/ladders_blocked = 0 @@ -163,10 +165,10 @@ datum/unit_test/wire_test/start_test() #undef BLOCKED_UP #undef BLOCKED_DOWN -/datum/unit_test/bad_doors +/datum/unit_test/map_test/bad_doors name = "MAP: Check for bad doors" -/datum/unit_test/bad_doors/start_test() +/datum/unit_test/map_test/bad_doors/start_test() var/checks = 0 var/failed_checks = 0 for(var/obj/machinery/door/airlock/A in world) @@ -175,18 +177,18 @@ datum/unit_test/wire_test/start_test() if(istype(T, /turf/space) || istype(T, /turf/unsimulated/floor/asteroid) || isopenturf(T) || T.density) failed_checks++ log_unit_test("Airlock [A] with bad turf at ([A.x],[A.y],[A.z]) in [T.loc].") - + if(failed_checks) fail("\[[failed_checks] / [checks]\] Some doors had improper turfs below them.") else pass("All \[[checks]\] doors have proper turfs below them.") - + return 1 -/datum/unit_test/bad_firedoors +/datum/unit_test/map_test/bad_firedoors name = "MAP: Check for bad firedoors" -/datum/unit_test/bad_firedoors/start_test() +/datum/unit_test/map_test/bad_firedoors/start_test() var/checks = 0 var/failed_checks = 0 for(var/obj/machinery/door/firedoor/F in world) @@ -201,7 +203,7 @@ datum/unit_test/wire_test/start_test() else if(istype(T, /turf/space) || istype(T, /turf/unsimulated/floor/asteroid) || isopenturf(T) || T.density) failed_checks++ log_unit_test("Firedoor with bad turf at ([F.x],[F.y],[F.z]) in [T.loc].") - + if(failed_checks) fail("\[[failed_checks] / [checks]\] Some firedoors were doubled up or had bad turfs below them.") else @@ -209,10 +211,10 @@ datum/unit_test/wire_test/start_test() return 1 -/datum/unit_test/bad_piping +/datum/unit_test/map_test/bad_piping name = "MAP: Check for bad piping" -/datum/unit_test/bad_piping/start_test() +/datum/unit_test/map_test/bad_piping/start_test() set background = 1 var/checks = 0 var/failed_checks = 0 @@ -243,7 +245,7 @@ datum/unit_test/wire_test/start_test() if (!pipe.node1 || !pipe.node2) failed_checks++ log_unit_test("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])") - + next_turf: for(var/turf/T in turfs) for(var/dir in cardinal) @@ -263,10 +265,10 @@ datum/unit_test/wire_test/start_test() return 1 -/datum/unit_test/mapped_products +/datum/unit_test/map_test/mapped_products name = "MAP: Check for mapped vending products" -/datum/unit_test/mapped_products/start_test() +/datum/unit_test/map_test/mapped_products/start_test() var/checks = 0 var/failed_checks = 0 var/list/obj/machinery/vending/V_to_test = list() @@ -288,5 +290,39 @@ datum/unit_test/wire_test/start_test() return 1 +/datum/unit_test/map_test/all_station_areas_shall_be_on_station_zlevels + name = "MAP: Station areas shall be on station z-levels" + var/exclude = list( + /area/holodeck // These are necessarily mapped on a non-station z-level so they can be copied over to the holodeck on the station z-levels + ) + +/datum/unit_test/map_test/all_station_areas_shall_be_on_station_zlevels/start_test() + var/checks = 0 + var/failed_checks = 0 + + var/list/exclude_types = list() + for(var/excluded in typesof(exclude)) + exclude_types += excluded + for(var/area/A as anything in the_station_areas - exclude_types) + checks++ + if(!isarea(A)) + log_unit_test("List 'the_station_areas' contained a non-area [A].") + failed_checks++ + else + var/list/turf/invalid_turfs = get_area_turfs(A, list(/proc/is_station_turf)) ^ get_area_turfs(A) + if(invalid_turfs.len) + failed_checks++ + var/list/failed_area_zlevels = list() + for(var/turf/T as anything in invalid_turfs) + failed_area_zlevels |= T.z + log_unit_test("Station area [A]: [invalid_turfs.len] turfs are not entirely mapped on station z-levels. Found turfs on non-station levels: [english_list(failed_area_zlevels)]") + + if(failed_checks) + fail("\[[failed_checks] / [checks]\] Some station areas had turfs mapped outside station z-levels.") + else + pass("All \[[checks]\] station areas are correctly mapped only on station z-levels.") + + return 1 + #undef SUCCESS #undef FAILURE diff --git a/maps/_common/areas/holodeck.dm b/maps/_common/areas/holodeck.dm index cf43b4c6953..a081cb2857c 100644 --- a/maps/_common/areas/holodeck.dm +++ b/maps/_common/areas/holodeck.dm @@ -5,6 +5,7 @@ no_light_control = TRUE station_area = TRUE dynamic_lighting = FALSE + flags = NO_GHOST_TELEPORT_ACCESS /area/holodeck/alphadeck name = "Holodeck Alpha" diff --git a/maps/exodus/code/exodus_unittest.dm b/maps/exodus/code/exodus_unittest.dm index 03fd861e354..ffd7a19176c 100644 --- a/maps/exodus/code/exodus_unittest.dm +++ b/maps/exodus/code/exodus_unittest.dm @@ -28,3 +28,7 @@ ,/area/engineering/cooling ,/area/outpost/research/emergency_storage ) + +/datum/unit_test/map_test/all_station_areas_shall_be_on_station_zlevels/start_test() + pass("Exodus skips this test.") + return 1