Files
+37 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

121 lines
5.3 KiB
Plaintext

SUBSYSTEM_DEF(condos)
name = "Condos"
ss_flags = SS_NO_FIRE
init_stage = INITSTAGE_LAST
/// All possible condo templates.
var/list/condo_templates = list()
/// List of active reservations we have.
var/list/active_condos = list()
/// Items we delibrately prevent being deleted. Malleable. Try to keep this to only items that cannot be re-obtained without admin interference; with some exceptions.
var/list/item_blacklist = list(
/obj/item/blackbox, \
/obj/item/gun/energy/laser/captain, \
/obj/item/gun/energy/e_gun/hos, \
/obj/item/hand_tele, \
/obj/item/tank/jetpack/captain, \
/obj/item/clothing/shoes/magboots/advance, \
/obj/item/blueprints, \
/obj/item/clothing/accessory/medal/gold/captain, \
/obj/item/hypospray/mkii/deluxe/cmo, \
/obj/item/fireaxe, \
/obj/item/crowbar/mechremoval, \
/obj/item/storage/belt/utility/chief, \
/obj/item/mod/control/pre_equipped/magnate, \
/obj/item/gun/ballistic/shotgun/automatic/combat/compact, \
/obj/item/clothing/suit/hooded/ablative, \
/obj/item/nuke_core, \
/obj/item/nuke_core_container, \
/obj/item/disk/computer/hdd_theft, \
/obj/item/nuke_core_container/supermatter, \
/obj/item/aicard, \
/obj/item/gun/energy/temperature/security, \
/obj/item/mod/control/pre_equipped/advanced, \
/obj/item/mod/control/pre_equipped/research, \
/obj/item/mod/control/pre_equipped/rescue, \
/obj/item/mod/control/pre_equipped/safeguard, \
/obj/item/storage/belt/sheath/sabre, \
/obj/item/card, \
/obj/item/modular_computer, \
/obj/item/nullrod, \
/obj/item/stamp/head, \
)
/datum/controller/subsystem/condos/Initialize()
preload_condo_templates()
return SS_INIT_SUCCESS
/// We're fetching all /datum/map_template/condo subtypes here; sanitychecking them, and assinging them to the subsystem as an option.
/datum/controller/subsystem/condos/proc/preload_condo_templates()
for(var/item in subtypesof(/datum/map_template/condo))
var/datum/map_template/condo/condo_type = item
if(!(initial(condo_type.mappath)))
continue
var/datum/map_template/condo/condo_template = new condo_type()
condo_templates[condo_template.name] = condo_template
SSmapping.map_templates[condo_template.name] = condo_template
/// We found an already existing room on that number! Just warp to an applied landing zone; if the condo still exists.
/datum/controller/subsystem/condos/proc/enter_active_room(condo_number, mob/user)
if(active_condos["[condo_number]"])
var/datum/turf_reservation/condo/target_active_condo = active_condos["[condo_number]"]
if(!target_active_condo)
to_chat(user, span_warning("Condo [condo_number] error. Unable to find condo reservation!"))
return FALSE
do_sparks(3, FALSE, get_turf(user))
var/turf/condo_bottom_left = target_active_condo.bottom_left_turfs[1]
if(!condo_bottom_left)
to_chat(user, span_warning("Condo [condo_number] error. Unable to find entry turf!"))
return FALSE
if(user.forceMove(locate(
condo_bottom_left.x + target_active_condo.condo_template.landing_zone_x_offset,
condo_bottom_left.y + target_active_condo.condo_template.landing_zone_y_offset,
condo_bottom_left.z,
)))
return TRUE
to_chat(user, span_warning("Condo [condo_number] error. Mystery failure!"))
return FALSE
/// No condo was found on the number we input - create a new reservation, load our template, assign it in active_condos - and warp our user to the landing zone
/datum/controller/subsystem/condos/proc/create_and_enter_condo(condo_number, datum/map_template/condo/our_condo, mob/user, parent_object)
if(active_condos["[condo_number]"])
return // Get sanity'd
var/datum/turf_reservation/condo/condo_reservation = SSmapping.request_turf_block_reservation(our_condo.width, our_condo.height, 1, reservation_type = /datum/turf_reservation/condo)
var/turf/bottom_left = condo_reservation.bottom_left_turfs[1]
if(!bottom_left)
to_chat(user, span_warning("Failed to reserve a room for you! Contact the technical concierge."))
return
our_condo.load(bottom_left)
condo_reservation.condo_template = our_condo
active_condos["[condo_number]"] = condo_reservation
link_condo_turfs(condo_reservation, condo_number, parent_object)
do_sparks(3, FALSE, get_turf(user))
user.forceMove(locate(
bottom_left.x + our_condo.landing_zone_x_offset,
bottom_left.y + our_condo.landing_zone_y_offset,
bottom_left.z,
))
/// Tweaks the /area/ in this condo to prevent conflicts; as well as assigns a description to the hotel door.
/datum/controller/subsystem/condos/proc/link_condo_turfs(datum/turf_reservation/condo/current_reservation, condo_number, parent_object)
var/turf/condo_bottom_left = current_reservation.bottom_left_turfs[1]
var/area/misc/condo/current_area = get_area(condo_bottom_left)
current_area.name = "Condo [condo_number]"
current_area.parent_object = parent_object
current_area.condo_number = condo_number
current_area.reservation = current_reservation
for(var/turf/closed/indestructible/hoteldoor/door in current_reservation.reserved_turfs)
door.parentSphere = parent_object
door.desc = "The door to this condo. \
The placard reads 'Room [condo_number]'. \
Strangely, this door doesn't even seem openable. \
The doorknob, however, seems to buzz with unusual energy...<br/>\
[span_info("Alt-Click to look through the peephole.")]"
for(var/turf/open/space/bluespace/bluespace_turf in current_reservation.reserved_turfs)
bluespace_turf.parentSphere = parent_object