[MODULAR] Adds an autospawn system to spawn stuff on top of other stuff, makes prison curtains use it (#19069)

Makes prison curtains autospawn
This commit is contained in:
Tastyfish
2023-02-08 02:13:24 +00:00
committed by GitHub
parent 91f3b9f645
commit e92a110dff
7 changed files with 53 additions and 551 deletions
@@ -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"
@@ -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
"}
@@ -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
"}
@@ -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
"}
@@ -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)
@@ -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'
@@ -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"