Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 903ded2

Browse files
cowbot92neeshacarkMoltijoe
authored
Adds new activity to cargo: Exploring The Backrooms (#22353)
* yeah * yes * off * e * e * alt title * ok * Box * well they need a fucking door dont they cark * e * fix portal * job b gone * map uopdate * Update backrooms.dm * adds random anomaly core spawners * adds gold * ye * ups limit * updates prices * update * u * spreite change * e * Update code/datums/mapgen/dungeon_generators/maintenance_generator/maintenance_room_themes/random.dm Co-authored-by: Molti <[email protected]> * psuh it * more rooms * add portals to other maps * AAAAAAAAAA * e * lasgun b gone * reducto * updates mapping * remove --------- Co-authored-by: Cark <[email protected]> Co-authored-by: Molti <[email protected]> Co-authored-by: Molti <[email protected]>
1 parent 661c078 commit 903ded2

File tree

11 files changed

+322
-54
lines changed

11 files changed

+322
-54
lines changed

_maps/map_files/AsteroidStation/AsteroidStation.dmm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26154,6 +26154,10 @@
2615426154
},
2615526155
/turf/open/floor/plasteel,
2615626156
/area/hallway/primary/fore)
26157+
"hpK" = (
26158+
/obj/effect/spawner/backrooms_portal,
26159+
/turf/open/floor/plasteel,
26160+
/area/quartermaster/warehouse)
2615726161
"hqn" = (
2615826162
/obj/structure/table/wood,
2615926163
/obj/effect/spawner/lootdrop/randomdrink,
@@ -94156,7 +94160,7 @@ aJI
9415694160
aZs
9415794161
xga
9415894162
xIK
94159-
hSk
94163+
hpK
9416094164
dCg
9416194165
gBO
9416294166
aZs

_maps/map_files/DonutStation/DonutStation.dmm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18389,6 +18389,7 @@
1838918389
c_tag = "Cargo - Disposals Office";
1839018390
dir = 8
1839118391
},
18392+
/obj/effect/spawner/backrooms_portal,
1839218393
/turf/open/floor/plasteel,
1839318394
/area/quartermaster/sorting)
1839418395
"hBq" = (

_maps/map_files/GaxStation/GaxStation.dmm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33361,6 +33361,7 @@
3336133361
"qcV" = (
3336233362
/obj/effect/decal/cleanable/dirt,
3336333363
/obj/machinery/light/small,
33364+
/obj/effect/spawner/backrooms_portal,
3336433365
/turf/open/floor/plasteel,
3336533366
/area/quartermaster/warehouse)
3336633367
"qcW" = (

_maps/map_files/IceMeta/IceMeta.dmm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71141,6 +71141,7 @@
7114171141
dir = 4
7114271142
},
7114371143
/obj/effect/decal/cleanable/dirt,
71144+
/obj/effect/spawner/backrooms_portal,
7114471145
/turf/open/floor/plasteel,
7114571146
/area/quartermaster/warehouse)
7114671147
"ute" = (

_maps/map_files/YogStation/YogStation.dmm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57195,6 +57195,11 @@
5719557195
/obj/machinery/teleport/station,
5719657196
/turf/open/floor/plating,
5719757197
/area/teleporter)
57198+
"rGx" = (
57199+
/obj/effect/decal/cleanable/dirt,
57200+
/obj/effect/spawner/backrooms_portal,
57201+
/turf/open/floor/plasteel,
57202+
/area/quartermaster/warehouse)
5719857203
"rHf" = (
5719957204
/turf/open/floor/engine/vacuum,
5720057205
/area/engine/atmos/mix)
@@ -96591,7 +96596,7 @@ aTD
9659196596
aPG
9659296597
bbq
9659396598
gjl
96594-
baS
96599+
rGx
9659596600
hFo
9659696601
baS
9659796602
baS

code/__DEFINES/dcs/signals/signals_global.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@
8484
#define COMSIG_STARLIGHT_COLOR_CHANGED "!starlight_color_changed"
8585
/// Global signal sent when darkspawns ascend: (No arguments)
8686
#define COMSIG_DARKSPAWN_ASCENSION "!darkspawn_ascension"
87+
/// Global signal sent when the backrooms finishes initailizing: (No arguments)
88+
#define COMSIG_BACKROOMS_INITIALIZE "!backrooms_initialize"

code/controllers/subsystem/backrooms.dm

Lines changed: 77 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ SUBSYSTEM_DEF(backrooms)
66
var/datum/map_generator/dungeon_generator/backrooms_generator
77
var/datum/generator_theme/picked_theme = /datum/generator_theme
88

9+
//associative list of objects and how much they sell for
10+
var/list/golden_loot = list(
11+
/obj/item/statuebust = 1000,
12+
/obj/item/reagent_containers/food/snacks/urinalcake = 1000,
13+
/obj/item/bigspoon = 4000,
14+
/obj/item/reagent_containers/food/snacks/burger/rat = 1200,
15+
/obj/item/extinguisher = 2500,
16+
/obj/item/toy/plush/lizard/azeel = 5000
17+
)
18+
919
/datum/controller/subsystem/backrooms/Initialize(timeofday)
1020
#ifdef LOWMEMORYMODE
1121
return SS_INIT_NO_NEED
@@ -16,8 +26,8 @@ SUBSYSTEM_DEF(backrooms)
1626

1727
pick_theme()
1828
generate_backrooms()
19-
delete_beacons()
20-
//spawn_anomalies()
29+
SEND_GLOBAL_SIGNAL(COMSIG_BACKROOMS_INITIALIZE)
30+
spawn_loot()
2131
return SS_INIT_SUCCESS
2232

2333
/datum/controller/subsystem/backrooms/proc/pick_theme()
@@ -58,58 +68,81 @@ SUBSYSTEM_DEF(backrooms)
5868
var/turf/wall = current_turf.place_on_top(border, flags = CHANGETURF_DEFER_CHANGE | CHANGETURF_IGNORE_AIR)
5969
wall.resistance_flags |= INDESTRUCTIBLE //make the wall indestructible
6070

61-
addtimer(CALLBACK(src, PROC_REF(generate_exit)), 1 MINUTES)
62-
63-
/datum/controller/subsystem/backrooms/proc/delete_beacons()
64-
var/list/zlevel = SSmapping.levels_by_trait(ZTRAIT_PROCEDURAL_MAINTS)
65-
for(var/obj/item/beacon/bacon as anything in GLOB.teleportbeacons)
66-
if(bacon.z in zlevel) //if the beacon is in the backrooms, delete it
67-
qdel(bacon)
71+
/datum/controller/subsystem/backrooms/proc/spawn_loot()
72+
var/backrooms_level = SSmapping.levels_by_trait(ZTRAIT_PROCEDURAL_MAINTS)
73+
if(!LAZYLEN(backrooms_level))
74+
return
75+
var/number = rand(20, 50)
76+
var/turf/destination
77+
var/item_path
78+
var/value
79+
for(var/i in 1 to number)
80+
destination = find_safe_turf(zlevels = backrooms_level, dense_atoms = FALSE)
81+
item_path = pick(golden_loot)
82+
value = golden_loot[item_path]
83+
84+
var/obj/item/thing = new item_path(destination) //spawn the thing and make it gold
85+
thing.AddComponent(/datum/component/valuable, value)
6886

6987
////////////////////////////////////////////////////////////////////////////////////
70-
//------------------------------Exit related things-------------------------------//
88+
//-------------------------------Valuable items-----------------------------------//
7189
////////////////////////////////////////////////////////////////////////////////////
72-
/datum/controller/subsystem/backrooms/proc/generate_exit()
73-
var/list/backrooms_level = SSmapping.levels_by_trait(ZTRAIT_PROCEDURAL_MAINTS)
74-
if(LAZYLEN(backrooms_level))
75-
var/turf/way_out = find_safe_turf(zlevels = backrooms_level, dense_atoms = FALSE)
76-
new /obj/effect/portal/permanent/one_way/backrooms(way_out)
77-
78-
/obj/effect/portal/permanent/one_way/backrooms/get_link_target_turf()
79-
var/list/valid_lockers = typecacheof(typesof(/obj/structure/closet) - typesof(/obj/structure/closet/body_bag)\
80-
- typesof(/obj/structure/closet/secure_closet) - typesof(/obj/structure/closet/cabinet)\
81-
- typesof(/obj/structure/closet/cardboard) \
82-
- typesof(/obj/structure/closet/supplypod) - typesof(/obj/structure/closet/stasis)\
83-
- typesof(/obj/structure/closet/abductor) - typesof(/obj/structure/closet/bluespace), only_root_path = TRUE) //stolen from bluespace lockers
84-
85-
var/list/lockers_list = list()
86-
for(var/obj/structure/closet/L in GLOB.lockers)
87-
if(!is_station_level(L.z))
88-
continue
89-
if(!is_type_in_typecache(L, valid_lockers))
90-
continue
91-
if(L.opened)
92-
continue
93-
lockers_list += L
94-
var/obj/structure/closet/exit = pick(lockers_list)
95-
if(!exit)
96-
exit = new(get_safe_random_station_turf())
97-
return get_turf(exit)
98-
99-
/obj/effect/portal/permanent/one_way/backrooms/teleport(atom/movable/M, force)
100-
. = ..()
101-
if(.)
102-
var/obj/structure/closet/end = locate() in get_turf(M)
103-
if(end)
104-
M.forceMove(end) //get in the locker, nerd
90+
/datum/export/backrooms
91+
//cost is irrelevant because we overwrite the proc
92+
unit_name = "golden object"
93+
export_types = list(/obj/item) //sell any object so long as it has the component
94+
95+
/datum/export/backrooms/applies_to(obj/O, allowed_categories = NONE, apply_elastic = TRUE)
96+
var/datum/component/valuable/value = O.GetComponent(/datum/component/valuable)
97+
if(!value || !istype(value))
98+
return FALSE
99+
return ..()
100+
101+
/datum/export/backrooms/get_cost(obj/O, allowed_categories = NONE, apply_limit = TRUE)
102+
var/amount = get_amount(O)
103+
var/datum/component/valuable/value = O.GetComponent(/datum/component/valuable)
104+
if(value && istype(value))
105+
return round(value.cost * amount)
106+
return 0
107+
108+
109+
/datum/component/valuable
110+
///how much the item is worth
111+
var/cost
112+
113+
/datum/component/valuable/Initialize(cost)
114+
if(!isitem(parent))
115+
return COMPONENT_INCOMPATIBLE
116+
src.cost = cost
117+
118+
/datum/component/valuable/RegisterWithParent()
119+
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
120+
if(isitem(parent))
121+
var/obj/item/goldplate = parent
122+
goldplate.add_atom_colour("#ffd700", FIXED_COLOUR_PRIORITY)
123+
124+
/datum/component/valuable/UnregisterFromParent()
125+
UnregisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
126+
127+
/datum/component/valuable/proc/on_examine(atom/eaten_light, mob/examiner, list/examine_text)
128+
SIGNAL_HANDLER
129+
examine_text += span_notice("This looks valuable, it could probably be sold for a lot.")
130+
return NONE
105131

132+
////////////////////////////////////////////////////////////////////////////////////
133+
//----------------------------Entrance and exit portal----------------------------//
134+
////////////////////////////////////////////////////////////////////////////////////
106135
/obj/effect/portal/permanent/backrooms
107-
icon_state = "wooden_tv"
136+
icon = 'icons/obj/computer.dmi'
137+
icon_state = "television"
108138

109139
/obj/effect/spawner/backrooms_portal
110140
name = "backrooms two way portal spawner"
111141

112142
/obj/effect/spawner/backrooms_portal/Initialize(mapload)
143+
RegisterSignal(SSdcs, COMSIG_BACKROOMS_INITIALIZE, PROC_REF(spawn_portals))
144+
145+
/obj/effect/spawner/backrooms_portal/proc/spawn_portals()
113146
var/backrooms_level = SSmapping.levels_by_trait(ZTRAIT_PROCEDURAL_MAINTS)
114147
if(LAZYLEN(backrooms_level))
115148
var/turf/way_out = find_safe_turf(zlevels = backrooms_level, dense_atoms = FALSE)

0 commit comments

Comments
 (0)