From e92a110dffdccdcb5aeb43356a90d50170e5a2de Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Tue, 7 Feb 2023 21:13:24 -0500 Subject: [PATCH] [MODULAR] Adds an autospawn system to spawn stuff on top of other stuff, makes prison curtains use it (#19069) Makes prison curtains autospawn --- .../skyrat/automapper/automapper_config.toml | 24 -- .../deltastation_prison_privacy.dmm | 305 ------------------ .../metastation_prison_privacy.dmm | 76 ----- .../tramstation_prison_privacy.dmm | 146 --------- .../automapper/code/area_spawn_entries.dm | 5 + .../automapper/code/area_spawn_subsystem.dm | 44 +++ modular_skyrat/modules/mapping/code/fluff.dm | 4 + 7 files changed, 53 insertions(+), 551 deletions(-) delete mode 100644 _maps/skyrat/automapper/templates/deltastation/deltastation_prison_privacy.dmm delete mode 100644 _maps/skyrat/automapper/templates/metastation/metastation_prison_privacy.dmm delete mode 100644 _maps/skyrat/automapper/templates/tramstation/tramstation_prison_privacy.dmm diff --git a/_maps/skyrat/automapper/automapper_config.toml b/_maps/skyrat/automapper/automapper_config.toml index 582e582edb9..d17aba77919 100644 --- a/_maps/skyrat/automapper/automapper_config.toml +++ b/_maps/skyrat/automapper/automapper_config.toml @@ -67,14 +67,6 @@ required_map = "MetaStation.dmm" coordinates = [57, 119, 1] trait_name = "Station" -# Metastation Prison Privacy -[templates.metastation_prison_privacy] -map_files = ["metastation_prison_privacy.dmm"] -directory = "_maps/skyrat/automapper/templates/metastation/" -required_map = "MetaStation.dmm" -coordinates = [82, 180, 1] -trait_name = "Station" - # DELTASTATION MAP EDITS # Deltastation Arrivals [templates.deltastation_arrivals] @@ -116,14 +108,6 @@ required_map = "DeltaStation2.dmm" coordinates = [123, 143, 1] trait_name = "Station" -# Deltastation Prison Privacy -[templates.deltastation_prison_privacy] -map_files = ["deltastation_prison_privacy.dmm"] -directory = "_maps/skyrat/automapper/templates/deltastation/" -required_map = "DeltaStation2.dmm" -coordinates = [201, 161, 1] -trait_name = "Station" - # ICEBOX MAP EDITS # Icebox Arrivals [templates.icebox_arrivals] @@ -262,11 +246,3 @@ directory = "_maps/skyrat/automapper/templates/tramstation/" required_map = "tramstation.dmm" coordinates = [135, 162, 2] trait_name = "Station" - -# Tramstation Prison Privacy -[templates.tramstation_prison_privacy] -map_files = ["tramstation_prison_privacy.dmm"] -directory = "_maps/skyrat/automapper/templates/tramstation/" -required_map = "tramstation.dmm" -coordinates = [89, 156, 1] -trait_name = "Station" diff --git a/_maps/skyrat/automapper/templates/deltastation/deltastation_prison_privacy.dmm b/_maps/skyrat/automapper/templates/deltastation/deltastation_prison_privacy.dmm deleted file mode 100644 index e9214a238e6..00000000000 --- a/_maps/skyrat/automapper/templates/deltastation/deltastation_prison_privacy.dmm +++ /dev/null @@ -1,305 +0,0 @@ -//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE -"a" = ( -/turf/template_noop, -/area/template_noop) -"i" = ( -/obj/machinery/door/airlock/public/glass{ - id_tag = "permabolt2"; - name = "Cell 2" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 8 - }, -/obj/machinery/door/poddoor/preopen{ - id = "permashut2" - }, -/obj/machinery/door/firedoor, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"k" = ( -/obj/machinery/door/airlock/security/glass{ - name = "Permabrig Cell 4" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 4 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/mapping_helpers/airlock/access/all/security/brig, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"l" = ( -/obj/machinery/door/airlock/security/glass{ - name = "Permabrig Cell 2" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 4 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/mapping_helpers/airlock/access/all/security/brig, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"p" = ( -/obj/machinery/door/airlock/public/glass{ - id_tag = "permabolt3"; - name = "Cell 3" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 8 - }, -/obj/machinery/door/poddoor/preopen{ - id = "permashut3" - }, -/obj/machinery/door/firedoor, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"u" = ( -/obj/machinery/door/airlock/public/glass{ - id_tag = "permabolt3"; - name = "Cell 5" - }, -/obj/structure/cable, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 8 - }, -/obj/machinery/door/poddoor/preopen{ - id = "permashut5" - }, -/obj/machinery/door/firedoor, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"v" = ( -/obj/machinery/door/airlock/security/glass{ - name = "Permabrig Cell 5" - }, -/obj/structure/cable, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 4 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/mapping_helpers/airlock/access/all/security/brig, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"y" = ( -/obj/machinery/door/airlock/public/glass{ - id_tag = "permabolt1"; - name = "Cell 1" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 8 - }, -/obj/machinery/door/poddoor/preopen{ - id = "permashut1" - }, -/obj/machinery/door/firedoor, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"C" = ( -/obj/machinery/door/airlock/security/glass{ - name = "Permabrig Cell 3" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 4 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/mapping_helpers/airlock/access/all/security/brig, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"J" = ( -/obj/machinery/door/airlock/security/glass{ - name = "Permabrig Cell 1" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 4 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/effect/mapping_helpers/airlock/access/all/security/brig, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/cable, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"Q" = ( -/obj/machinery/door/airlock/public/glass{ - id_tag = "permabolt3"; - name = "Cell 4" - }, -/obj/effect/mapping_helpers/airlock/cyclelink_helper{ - dir = 8 - }, -/obj/machinery/door/poddoor/preopen{ - id = "permashut4" - }, -/obj/machinery/door/firedoor, -/obj/effect/turf_decal/stripes/line{ - dir = 4 - }, -/obj/effect/turf_decal/stripes/line{ - dir = 8 - }, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) - -(1,1,1) = {" -v -a -a -k -a -a -C -a -a -l -a -a -J -"} -(2,1,1) = {" -a -a -a -a -a -a -a -a -a -a -a -a -a -"} -(3,1,1) = {" -a -a -a -a -a -a -a -a -a -a -a -a -a -"} -(4,1,1) = {" -a -a -a -a -a -a -a -a -a -a -a -a -a -"} -(5,1,1) = {" -u -a -a -Q -a -a -p -a -a -i -a -a -y -"} diff --git a/_maps/skyrat/automapper/templates/metastation/metastation_prison_privacy.dmm b/_maps/skyrat/automapper/templates/metastation/metastation_prison_privacy.dmm deleted file mode 100644 index 3264b9c3fe8..00000000000 --- a/_maps/skyrat/automapper/templates/metastation/metastation_prison_privacy.dmm +++ /dev/null @@ -1,76 +0,0 @@ -//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE -"a" = ( -/turf/template_noop, -/area/template_noop) -"I" = ( -/obj/effect/spawner/structure/window/reinforced, -/obj/structure/cable, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/plating, -/area/station/security/prison/safe) - -(1,1,1) = {" -I -a -a -I -a -a -a -"} -(2,1,1) = {" -a -a -a -a -a -a -a -"} -(3,1,1) = {" -a -a -a -a -a -a -I -"} -(4,1,1) = {" -a -a -a -a -a -a -a -"} -(5,1,1) = {" -a -a -a -a -a -a -a -"} -(6,1,1) = {" -a -a -a -a -a -a -a -"} -(7,1,1) = {" -a -a -a -a -a -a -I -"} diff --git a/_maps/skyrat/automapper/templates/tramstation/tramstation_prison_privacy.dmm b/_maps/skyrat/automapper/templates/tramstation/tramstation_prison_privacy.dmm deleted file mode 100644 index cd9ace031eb..00000000000 --- a/_maps/skyrat/automapper/templates/tramstation/tramstation_prison_privacy.dmm +++ /dev/null @@ -1,146 +0,0 @@ -//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE -"a" = ( -/turf/template_noop, -/area/template_noop) -"e" = ( -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 2" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"m" = ( -/obj/machinery/door/firedoor, -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 6" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"H" = ( -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 4" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"J" = ( -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 3" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"M" = ( -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 5" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) -"Z" = ( -/obj/machinery/door/airlock/security/glass{ - id_tag = "prisondorm"; - name = "Prison Dorm 1" - }, -/obj/effect/turf_decal/trimline/red/filled/line, -/obj/effect/turf_decal/trimline/red/filled/line{ - dir = 1 - }, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, -/obj/structure/curtain/cloth{ - name = "Prisoner Privacy Curtains" - }, -/turf/open/floor/iron, -/area/station/security/prison/safe) - -(1,1,1) = {" -M -a -a -a -J -a -a -a -Z -"} -(2,1,1) = {" -a -a -a -a -a -a -a -a -a -"} -(3,1,1) = {" -a -a -a -a -a -a -a -a -a -"} -(4,1,1) = {" -m -a -a -a -H -a -a -a -e -"} diff --git a/modular_skyrat/modules/automapper/code/area_spawn_entries.dm b/modular_skyrat/modules/automapper/code/area_spawn_entries.dm index 95332317e36..048400d023b 100644 --- a/modular_skyrat/modules/automapper/code/area_spawn_entries.dm +++ b/modular_skyrat/modules/automapper/code/area_spawn_entries.dm @@ -99,3 +99,8 @@ /datum/area_spawn/customs_agent_landmark desired_atom = /obj/effect/landmark/start/customs_agent target_areas = list(/area/station/security/checkpoint/supply, /area/station/cargo/storage) + +/datum/area_spawn_over/prison_curtains + desired_atom = /obj/structure/curtain/cloth/prison + over_atoms = list(/obj/structure/window/reinforced/fulltile, /obj/machinery/door/airlock/security/glass, /obj/machinery/door/airlock/public/glass) + target_areas = list(/area/station/security/prison/safe) diff --git a/modular_skyrat/modules/automapper/code/area_spawn_subsystem.dm b/modular_skyrat/modules/automapper/code/area_spawn_subsystem.dm index 3401b0db092..ac1bfeb7a67 100644 --- a/modular_skyrat/modules/automapper/code/area_spawn_subsystem.dm +++ b/modular_skyrat/modules/automapper/code/area_spawn_subsystem.dm @@ -49,7 +49,14 @@ SUBSYSTEM_DEF(area_spawn) for(var/iterating_type in subtypesof(/datum/area_spawn)) var/datum/area_spawn/iterating_area_spawn = new iterating_type iterating_area_spawn.try_spawn() + qdel(iterating_area_spawn) clear_cache() + + for(var/iterating_type in subtypesof(/datum/area_spawn_over)) + var/datum/area_spawn_over/iterating_area_spawn_over = new iterating_type + iterating_area_spawn_over.try_spawn() + qdel(iterating_area_spawn_over) + return SS_INIT_SUCCESS /** @@ -301,6 +308,43 @@ SUBSYSTEM_DEF(area_spawn) new final_desired_atom(candidate_turf) +/** + * Spawns an atom on any turf that contains specific over atoms. + */ +/datum/area_spawn_over + /// The target area types for us to search for the over_atoms. + var/list/target_areas + /// The list of atom types to spawn the desired atom over. + var/list/over_atoms + /// The atom type that we want to spawn + var/desired_atom + /// Map blacklist, this is used to determine what maps we should not spawn on. + var/list/blacklisted_stations = list("Void Raptor", "Runtime Station", "MultiZ Debug") + +/** + * Spawn the atoms. + */ +/datum/area_spawn_over/proc/try_spawn() + if(SSmapping.config.map_name in blacklisted_stations) + return + + for(var/area_type in target_areas) + var/area/found_area = GLOB.areas_by_type[area_type] + if(!found_area) + continue + + for(var/turf/candidate_turf as anything in found_area.get_contained_turfs()) + // Don't spawn if there's already a desired_atom here. + if(is_type_on_turf(candidate_turf, desired_atom)) + continue + + for(var/over_atom_type in over_atoms) + // Spawn on the first one we find in the turf and stop. + if(is_type_on_turf(candidate_turf, over_atom_type)) + new desired_atom(candidate_turf) + // Break the over_atom_type loop. + break + /obj/effect/turf_test name = "PASS" icon = 'modular_skyrat/modules/automapper/icons/area_test.dmi' diff --git a/modular_skyrat/modules/mapping/code/fluff.dm b/modular_skyrat/modules/mapping/code/fluff.dm index 639aae545e3..5edba8228c0 100644 --- a/modular_skyrat/modules/mapping/code/fluff.dm +++ b/modular_skyrat/modules/mapping/code/fluff.dm @@ -278,3 +278,7 @@ name = "Occupied Sleeper" desc = "A closed, occupied sleeper, bloodied handprints are seen on the inside, along with an odd, redish blur. It seems sealed shut." icon_state = "sleeper-o" + +/obj/structure/curtain/cloth/prison + name = "Prisoner Privacy Curtains" + color = "#ACD1E9"