diff --git a/code/controllers/subsystems/shuttle.dm b/code/controllers/subsystems/shuttle.dm index 55ee9160614..9a1a0ad55db 100644 --- a/code/controllers/subsystems/shuttle.dm +++ b/code/controllers/subsystems/shuttle.dm @@ -14,6 +14,7 @@ SUBSYSTEM_DEF(shuttle) var/list/shuttle_logs = list() //Keeps records of shuttle movement, format is list(datum/shuttle = datum/shuttle_log) var/list/shuttle_areas = list() //All the areas of all shuttles. var/list/docking_registry = list() //Docking controller tag -> docking controller program, mostly for init purposes. + var/list/docking_beacons = list() //Magnetic docking beacons, used for free-form landing in secure areas. var/list/landmarks_awaiting_sector = list() //Stores automatic landmarks that are waiting for a sector to finish loading. var/list/landmarks_still_needed = list() //Stores landmark_tags that need to be assigned to the sector (landmark_tag = sector) when registered. @@ -156,5 +157,13 @@ SUBSYSTEM_DEF(shuttle) if (ship.type == type) return ship +/datum/controller/subsystem/shuttle/proc/docking_beacons_by_z(z_levels) + . = list() + if(!islist(z_levels)) + z_levels = list(z_levels) + for(var/obj/machinery/docking_beacon/beacon in docking_beacons) + if(beacon.z in z_levels) + . |= beacon + /datum/controller/subsystem/shuttle/stat_entry() ..("Shuttles:[shuttles.len], Ships:[ships.len], L:[registered_shuttle_landmarks.len][overmap_halted ? ", HALT" : ""]") \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/machinery/docking_beacon.dm b/code/game/objects/items/weapons/circuitboards/machinery/docking_beacon.dm new file mode 100644 index 00000000000..904e6e0e57d --- /dev/null +++ b/code/game/objects/items/weapons/circuitboards/machinery/docking_beacon.dm @@ -0,0 +1,13 @@ +/obj/item/stock_parts/circuitboard/docking_beacon + name = T_BOARD("magnetic docking beacon") + board_type = "machine" + build_path = /obj/machinery/docking_beacon + origin_tech = "{'magnets':3}" + req_components = list( + /obj/item/stock_parts/capacitor = 1, + /obj/item/stock_parts/micro_laser = 1) + additional_spawn_components = list( + /obj/item/stock_parts/console_screen = 1, + /obj/item/stock_parts/keyboard = 1, + /obj/item/stock_parts/power/apc/buildable = 1 + ) diff --git a/code/modules/fabrication/designs/imprinter/designs_misc_circuits.dm b/code/modules/fabrication/designs/imprinter/designs_misc_circuits.dm index 009638374da..8922610aafa 100644 --- a/code/modules/fabrication/designs/imprinter/designs_misc_circuits.dm +++ b/code/modules/fabrication/designs/imprinter/designs_misc_circuits.dm @@ -447,4 +447,7 @@ path = /obj/item/stock_parts/circuitboard/relay /datum/fabricator_recipe/imprinter/circuit/inertial_damper - path = /obj/item/stock_parts/circuitboard/inertial_damper \ No newline at end of file + path = /obj/item/stock_parts/circuitboard/inertial_damper + +/datum/fabricator_recipe/imprinter/circuit/docking_beacon + path = /obj/item/stock_parts/circuitboard/docking_beacon \ No newline at end of file diff --git a/code/modules/mob/observer/eye/landing_eye.dm b/code/modules/mob/observer/eye/landing_eye.dm index 79d2ff5ab42..b134ef55f5b 100644 --- a/code/modules/mob/observer/eye/landing_eye.dm +++ b/code/modules/mob/observer/eye/landing_eye.dm @@ -5,10 +5,14 @@ desc = "A visual projection used to assist in the landing of a shuttle." name_sufix = "Landing Eye" var/datum/shuttle/autodock/shuttle + var/obj/effect/overmap/visitable/target_sector var/list/landing_images = list() + var/list/docking_images = list() + var/list/docking_turfs = list() // Turfs where it is okay to land, even if its within a restricted area. -/mob/observer/eye/landing/Initialize(var/mapload, var/shuttle_tag) +/mob/observer/eye/landing/Initialize(var/mapload, var/shuttle_tag, var/obj/effect/overmap/visitable/sector) shuttle = SSshuttle.shuttles[shuttle_tag] + target_sector = sector // Generates the overlay of the shuttle on turfs. var/turf/origin = get_turf(src) for(var/area/A in shuttle.shuttle_area) @@ -21,13 +25,29 @@ I.loc = locate(origin.x + x_off, origin.y + y_off, origin.z) I.plane = OBSERVER_PLANE landing_images[I] = list(x_off, y_off) - + + // Find the docking beacons in the z-level(s) we're landing in. + var/list/docking_beacons = SSshuttle.docking_beacons_by_z(target_sector.map_z) + for(var/obj/machinery/docking_beacon/beacon in docking_beacons) + // If the beacon permits us, we'll generate the images for the area where we can land. + if(beacon.check_permission(shuttle.name, shuttle.docking_codes)) + docking_turfs += beacon.get_area() + + for(var/turf/T in docking_turfs) + var/image/I = image('icons/effects/alphacolors.dmi', T, "blue") + + I.plane = OBSERVER_PLANE + docking_images += I + . = ..(mapload) /mob/observer/eye/landing/Destroy() . = ..() shuttle = null + target_sector = null landing_images.Cut() + docking_images.Cut() + docking_turfs.Cut() /mob/observer/eye/landing/setLoc(var/turf/T) T = get_turf(T) @@ -46,7 +66,9 @@ var/turf/origin = get_turf(src) var/turf/T = locate(origin.x + coords[1], origin.y + coords[2], origin.z) - var/area/A = T?.loc + + var/ra = target_sector.restricted_area + img.loc = T img.icon_state = "green" @@ -58,16 +80,22 @@ . = FALSE // Cannot land past the normal world boundaries. else if(check_collision(origin.loc, list(T))) // Checking for density or multi-area overlap. . = FALSE - else if(!istype(A, /area/space) && !istype(A, /area/exoplanet)) // Can only land in space or outside. - . = FALSE + else if((T.x > (world.maxx - ra)/2 && T.x < (world.maxx + ra)/2) && (T.y > (world.maxy - ra)/2 && T.y < (world.maxy + ra)/2)) + if(!(T in docking_turfs)) + . = FALSE // Cannot land within the restricted area *unless* there is a valid docking beacon in the same location. if(!.) img.icon_state = "red" // Visual indicator the spot is invalid. +// Checks if the landing location is secure, and therefore the shuttle will move with whatever sector its landed in. +/mob/observer/eye/landing/proc/check_secure_landing() + return ((target_sector.sector_flags & (~OVERMAP_SECTOR_IN_SPACE)) || (get_turf(src) in docking_turfs)) + /mob/observer/eye/landing/possess(var/mob/user) . = ..() if(owner && owner.client) owner.client.view = LANDING_VIEW owner.client.images += landing_images + owner.client.images += docking_images /mob/observer/eye/landing/release(var/mob/user) if(owner && owner.client && owner == user) diff --git a/code/modules/modular_computers/file_system/programs/generic/docks.dm b/code/modules/modular_computers/file_system/programs/generic/docks.dm index ad6fe91d40f..c0aa2d82e1b 100644 --- a/code/modules/modular_computers/file_system/programs/generic/docks.dm +++ b/code/modules/modular_computers/file_system/programs/generic/docks.dm @@ -2,11 +2,11 @@ filename = "docking" filedesc = "Docking Control" required_access = access_bridge - nanomodule_path = /datum/nano_module/docking + nanomodule_path = /datum/nano_module/program/docking program_icon_state = "supply" program_key_state = "rd_key" program_menu_icon = "triangle-2-e-w" - extended_desc = "A management tool that lets you see the status of the docking ports." + extended_desc = "A management tool that lets you see the status of the docking ports and beacons." size = 10 usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP available_on_network = 1 @@ -16,19 +16,21 @@ /datum/computer_file/program/docking/on_startup() . = ..() if(NM) - var/datum/nano_module/docking/NMD = NM + var/datum/nano_module/program/docking/NMD = NM NMD.refresh_docks() -/datum/nano_module/docking +/datum/nano_module/program/docking name = "Docking Control program" var/list/docking_controllers = list() //list of tags + var/list/docking_beacons = list() //list of magnetic docking beacon tags -/datum/nano_module/docking/New(var/datum/host, var/topic_manager) +/datum/nano_module/program/docking/New(var/datum/host, var/topic_manager) ..() refresh_docks() -/datum/nano_module/docking/proc/refresh_docks() +/datum/nano_module/program/docking/proc/refresh_docks() docking_controllers.Cut() + docking_beacons.Cut() var/list/zlevels = GetConnectedZlevels(get_host_z()) for(var/obj/machinery/embedded_controller/radio/airlock/docking_port/D in SSmachines.machinery) if(D.z in zlevels) @@ -39,27 +41,50 @@ if(S.shuttle_docking_controller.id_tag == D.program.id_tag) shuttleside = 1 break - if(shuttleside) + if(shuttleside) continue docking_controllers += D.program.id_tag - -/datum/nano_module/docking/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, state = GLOB.default_state) + + // Add magnetic docking beacons. + var/datum/computer_network/network = get_network() + if(network) + docking_beacons |= network.get_tags_by_type(/obj/machinery/docking_beacon) + +/datum/nano_module/program/docking/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, state = GLOB.default_state) var/list/data = host.initial_data() var/list/docks = list() + var/list/beacons = list() + var/datum/computer_network/network = get_network() + for(var/docktag in docking_controllers) var/datum/computer/file/embedded_program/docking/P = SSshuttle.docking_registry[docktag] if(P) var/docking_attempt = P.tag_target && !P.dock_state var/docked = P.tag_target && (P.dock_state == STATE_DOCKED) docks.Add(list(list( - "tag"=P.id_tag, + "tag" = P.id_tag, "location" = P.get_name(), "status" = capitalize(P.get_docking_status()), "docking_attempt" = docking_attempt, "docked" = docked, "codes" = P.docking_codes ? P.docking_codes : "Unset" ))) + + for(var/beacontag in docking_beacons) + var/datum/extension/network_device/D = network.get_device_by_tag(beacontag) + var/obj/machinery/docking_beacon/beacon = D.holder + if(istype(beacon)) + beacons.Add(list(list( + "size" = "[beacon.docking_width], [beacon.docking_height]", + "name" = beacon.display_name, + "locked" = beacon.locked, + "network_tag" = D.network_tag, + "code_docking" = beacon.docking_by_codes, + ))) + else + docking_beacons -= beacontag data["docks"] = docks + data["docking_beacons"] = beacons ui = SSnano.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) ui = new(user, src, ui_key, "docking.tmpl", name, 600, 450, state = state) @@ -67,25 +92,37 @@ ui.set_initial_data(data) ui.open() -/datum/nano_module/docking/Topic(href, href_list, state) +/datum/nano_module/program/docking/Topic(href, href_list, state) if(..()) - return 1 - if(istext(href_list["edit_code"])) - var/datum/computer/file/embedded_program/docking/P = SSshuttle.docking_registry[href_list["edit_code"]] + return TOPIC_HANDLED + + if(istext(href_list["edit_docking_codes"])) + var/datum/computer/file/embedded_program/docking/P = SSshuttle.docking_registry[href_list["edit_docking_codes"]] if(P) var/newcode = input("Input new docking codes", "Docking codes", P.docking_codes) as text|null if(!CanInteract(usr,state)) return - if (newcode) + if(newcode) P.docking_codes = uppertext(newcode) - return 1 + return TOPIC_HANDLED + if(istext(href_list["dock"])) var/datum/computer/file/embedded_program/docking/P = SSshuttle.docking_registry[href_list["dock"]] if(P) P.receive_user_command("dock") - return 1 + return TOPIC_HANDLED + if(istext(href_list["undock"])) var/datum/computer/file/embedded_program/docking/P = SSshuttle.docking_registry[href_list["undock"]] if(P) P.receive_user_command("undock") - return 1 \ No newline at end of file + return TOPIC_HANDLED + + if(istext(href_list["beacon"])) + var/datum/computer_network/network = get_network() + var/datum/extension/network_device/device = network.get_device_by_tag(href_list["beacon"]) + var/obj/machinery/docking_beacon/beacon = device.holder + if(istype(beacon)) + var/datum/topic_state/remote/R = new(src, beacon) + beacon.ui_interact(usr, state = R) + return TOPIC_REFRESH \ No newline at end of file diff --git a/code/modules/modular_computers/networking/_network.dm b/code/modules/modular_computers/networking/_network.dm index 22ff72f751d..0d8ecd858dc 100644 --- a/code/modules/modular_computers/networking/_network.dm +++ b/code/modules/modular_computers/networking/_network.dm @@ -212,3 +212,11 @@ results += device.holder return results +/datum/computer_network/proc/get_tags_by_type(var/type) + var/list/results = list() + for(var/tag in devices_by_tag) + var/datum/extension/network_device/device = devices_by_tag[tag] + if(istype(device.holder, type)) + results |= tag + return results + diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 34314a17231..4192af59b0e 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -20,7 +20,9 @@ var/hide_from_reports = FALSE var/has_distress_beacon - var/free_landing = FALSE //whether or not shuttles can land in arbitrary places within the sector's z-levels. + var/free_landing = TRUE // Whether or not shuttles can land in arbitrary places within the sector's z-levels. + var/restricted_area = 0 // Regardless of if free_landing is set to TRUE, this square area (centered on the z level) will be restricted from free shuttle landing unless permitted by a docking becaon. + var/list/map_z = list() var/list/consoles @@ -135,6 +137,9 @@ testing("Overmap build complete.") return 1 +/obj/effect/overmap/visitable/proc/allow_free_landing(var/datum/shuttle/landing_shuttle) + return free_landing + /obj/effect/overmap/visitable/handle_overmap_pixel_movement() ..() for(var/obj/machinery/computer/ship/machine in consoles) diff --git a/code/modules/overmap/ships/computers/shuttle.dm b/code/modules/overmap/ships/computers/shuttle.dm index f825c5521a4..6e08d099390 100644 --- a/code/modules/overmap/ships/computers/shuttle.dm +++ b/code/modules/overmap/ships/computers/shuttle.dm @@ -67,7 +67,7 @@ var/list/available_sectors = list() for(var/obj/effect/overmap/visitable/S in range(get_turf(current_sector), shuttle.range)) - if(S.free_landing) + if(S.allow_free_landing(shuttle)) available_sectors += S if(LAZYLEN(available_sectors)) @@ -84,7 +84,7 @@ return var/turf/eye_turf = locate(world.maxx/2, world.maxy/2, target_sector.map_z[target_sector.map_z.len]) // Center of the top z-level of the target sector. - if(landing_eye.look(user, list(shuttle_tag), eye_turf)) // Placement of the eye was successful + if(landing_eye.look(user, list(shuttle_tag, target_sector))) // Placement of the eye was successful landing_eye.extension_eye.forceMove(eye_turf) return @@ -101,13 +101,13 @@ var/turf/lz_turf = eye_extension.get_eye_turf() var/obj/effect/overmap/visitable/sector = map_sectors["[lz_turf.z]"] - if(!sector.free_landing) // Additional safety check to ensure the sector permits landing. + if(!sector.allow_free_landing()) // Additional safety check to ensure the sector permits landing. to_chat(user, SPAN_WARNING("Invalid landing zone!")) return var/datum/shuttle/autodock/overmap/shuttle = SSshuttle.shuttles[shuttle_tag] if(landing_eye.check_landing()) // Make sure the landmark is in a valid location. - var/obj/effect/shuttle_landmark/temporary/lz = new(lz_turf) + var/obj/effect/shuttle_landmark/temporary/lz = new(lz_turf, landing_eye.check_secure_landing()) if(lz.is_valid(shuttle)) // Make sure the shuttle fits. to_chat(user, SPAN_NOTICE("Landing zone set!")) shuttle.set_destination(lz) diff --git a/code/modules/overmap/ships/landable.dm b/code/modules/overmap/ships/landable.dm index c09b521c6fa..2fa87fd0f89 100644 --- a/code/modules/overmap/ships/landable.dm +++ b/code/modules/overmap/ships/landable.dm @@ -32,14 +32,26 @@ if(get_area(object) in areas) return 1 +/obj/effect/overmap/visitable/ship/landable/allow_free_landing(var/datum/shuttle/landing_shuttle) + var/datum/shuttle/autodock/overmap/child_shuttle = SSshuttle.shuttles[shuttle] + if(child_shuttle == landing_shuttle) + return FALSE // Use the main landmark. + if(child_shuttle.current_location != landmark) + return FALSE // Cannot encounter a shuttle while it is landed elsewhere. + . = ..() + /obj/effect/overmap/visitable/ship/landable/Process() . = ..() var/datum/shuttle/autodock/overmap/child_shuttle = SSshuttle.shuttles[shuttle] if(!child_shuttle || !istype(child_shuttle)) return if(child_shuttle.current_location.flags & SLANDMARK_FLAG_DISCONNECTED) // Keep an eye on the distance between the shuttle and the sector if we aren't fully docked. - if(get_dist(src, map_sectors["[child_shuttle.current_location.z]"]) > min(child_shuttle.range, 1)) // Some leeway so 0 range shuttles are still able to chase. + var/obj/effect/overmap/visitable/ship/landable/encounter = map_sectors["[child_shuttle.current_location.z]"] + if((get_dist(src, encounter) > min(child_shuttle.range, 1))) // Some leeway so 0 range shuttles are still able to chase. child_shuttle.attempt_force_move(landmark) + if(istype(encounter)) + if(encounter.status != SHIP_STATUS_OVERMAP) // Check if the encountered sector has moved out of space and landed elsewhere. + child_shuttle.attempt_force_move(landmark) // We autobuild our z levels. /obj/effect/overmap/visitable/ship/landable/find_z_levels() diff --git a/code/modules/shuttles/docking_beacon.dm b/code/modules/shuttles/docking_beacon.dm new file mode 100644 index 00000000000..6b8d796de51 --- /dev/null +++ b/code/modules/shuttles/docking_beacon.dm @@ -0,0 +1,171 @@ +#define MAX_DOCKING_SIZE 30 + +/obj/machinery/docking_beacon + name = "magnetic docking beacon" + desc = "A magnetic docking beacon that coordinates the movement of spacecraft into secure locations." + icon = 'icons/obj/machines/power/fusion.dmi' + icon_state = "injector0" + density = 1 + anchored = FALSE + construct_state = /decl/machine_construction/default/panel_closed + uncreated_component_parts = null + stat_immune = NOPOWER + base_type = /obj/machinery/docking_beacon + var/display_name // Display name of the docking beacon, editable on the docking control program. + var/list/permitted_shuttles = list() // Shuttles that are always permitted by the docking beacon. + + var/locked = TRUE + var/docking_by_codes = FALSE // Whether or not docking by code is permitted. + var/docking_codes = 0 // Required code for docking by code. + var/docking_width = 10 + var/docking_height = 10 + var/projecting = FALSE + +/obj/machinery/docking_beacon/Initialize() + . = ..() + set_extension(src, /datum/extension/network_device) + + var/datum/extension/network_device/D = get_extension(src, /datum/extension/network_device) + + display_name = D.network_tag + + SSshuttle.docking_beacons += src + +/obj/machinery/docking_beacon/Destroy() + . = ..() + + SSshuttle.docking_beacons -= src + permitted_shuttles.Cut() + +/obj/machinery/docking_beacon/attackby(obj/item/I, mob/living/user) + if(isWrench(I)) + if(!allowed(user)) + to_chat(user, SPAN_WARNING("The bolts on \the [src] are locked!")) + return + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + to_chat(user, SPAN_NOTICE("You [anchored ? "unanchor" : "anchor"] \the [src].")) + anchored = !anchored + return + + . = ..() + +/obj/machinery/docking_beacon/interface_interact(mob/user) + ui_interact(user) + return TRUE + +/obj/machinery/docking_beacon/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, datum/topic_state/state = GLOB.default_state) + var/list/data = list() + data["size"] = "[docking_width] x [docking_height]" + data["locked"] = locked + data["display_name"] = display_name + data["allow_codes"] = docking_by_codes + if(allowed(user)) + data["permitted"] = permitted_shuttles + data["codes"] = docking_codes + else + data["permitted"] = list("ACCESS DENIED") + data["codes"] = "*******" + ui = SSnano.try_update_ui(user, src, ui_key, ui, data) + if (!ui) + ui = new(user, src, ui_key, "docking_beacon.tmpl", "Docking Beacon Settings", 540, 400, state = state) + ui.set_initial_data(data) + ui.open() + +/obj/machinery/docking_beacon/OnTopic(mob/user, href_list, datum/topic_state/state) + . = ..() + if(.) + return + + var/datum/extension/network_device/D = get_extension(src, /datum/extension/network_device) + + if(href_list["edit_codes"]) + var/newcode = sanitize(input("Input new docking codes:", "Docking codes", docking_codes) as text|null) + if(!CanInteract(usr,state)) + return TOPIC_NOACTION + if(newcode) + docking_codes = uppertext(newcode) + D?.add_log("Docking codes of Docking Beacon [display_name] were changed.") + return TOPIC_REFRESH + + if(href_list["edit_display_name"]) + var/newname = sanitize(input("Input new display name:", "Display name", display_name) as text|null) + if(!CanInteract(usr,state)) + return TOPIC_NOACTION + if(newname) + display_name = newname + D?.add_log("Display name of Docking Beacon [display_name] was changed to [newname].") + return TOPIC_REFRESH + return TOPIC_HANDLED + + if(href_list["edit_size"]) + var/newwidth = input("Input new docking width for beacon:", "Docking size", docking_width) as num|null + var/newheight = input("Input new docking height for beacon:", "Docking size", docking_height) as num|null + if(!CanInteract(usr,state)) + return TOPIC_NOACTION + if(newwidth && newheight) + docking_width = Clamp(newwidth, 0, MAX_DOCKING_SIZE) + docking_height = Clamp(newheight, 0, MAX_DOCKING_SIZE) + D?.add_log("Docking size of Docking Beacon [display_name] was changed to [newwidth], [newheight].") + return TOPIC_REFRESH + return TOPIC_HANDLED + + if(href_list["toggle_lock"]) + locked = !locked + D?.add_log("Docking was [locked ? "locked" : "unlocked"] for Docking Beacon [display_name].") + return TOPIC_REFRESH + + if(href_list["toggle_codes"]) + docking_by_codes = !docking_by_codes + D?.add_log("Docking by codes was [docking_by_codes ? "enabled" : "disabled"] for Docking Beacon [display_name].") + return TOPIC_REFRESH + + if(href_list["edit_permitted_shuttles"]) + var/shuttle = sanitize(input(usr,"Enter the ID of the shuttle you wish to permit/unpermit for this beacon:", "Enter ID") as text|null) + if(shuttle) + if(shuttle in permitted_shuttles) + permitted_shuttles -= shuttle + D?.add_log("Docking Beacon [display_name] had [shuttle] removed from its permitted shuttle list.") + return TOPIC_REFRESH + else if(shuttle in SSshuttle.shuttles) + permitted_shuttles += shuttle + D?.add_log("Docking Beacon [display_name] had [shuttle] added to its permitted shuttle list.") + return TOPIC_REFRESH + return TOPIC_HANDLED + + if(href_list["project"]) + if(projecting) + return + visible_message(SPAN_NOTICE("\The [src] projects a hologram of its effective landing area.")) + for(var/turf/T in get_area()) + new /obj/effect/temporary(T, 5 SECONDS,'icons/effects/alphacolors.dmi', "green") + projecting = TRUE + addtimer(CALLBACK(src, .proc/allow_projection), 10 SECONDS) // No spamming holograms. + + if(href_list["settings"]) + D.ui_interact(user) + return TOPIC_HANDLED + +/obj/machinery/docking_beacon/proc/allow_projection() + projecting = FALSE + +/obj/machinery/docking_beacon/proc/check_permission(var/shuttle_tag, var/codes) + . = FALSE + if(!locked) + return TRUE + if(docking_by_codes && docking_codes == codes) + return TRUE + if(shuttle_tag in permitted_shuttles) + return TRUE + +/obj/machinery/docking_beacon/proc/get_area() + switch(dir) + if(NORTH) + return block(locate(x-((docking_width-1)/2), y+docking_height+1, z), locate(x+((docking_width-1)/2), y+1, z)) + if(SOUTH) + return block(locate(x-((docking_width-1)/2), y-docking_height-1, z), locate(x+((docking_width-1)/2), y-1, z)) + if(EAST) + return block(locate(x+docking_height+1, y-((docking_width-1)/2), z), locate(x+1, y+((docking_width-1)/2), z)) + if(WEST) + return block(locate(x-docking_height-1, y-((docking_width-1)/2), z), locate(x-1, y+((docking_width-1)/2), z)) + +#undef MAX_DOCKING_SIZE \ No newline at end of file diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index b55dea9e69a..39782f2c815 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -136,8 +136,10 @@ landmark_tag = "landing" flags = SLANDMARK_FLAG_AUTOSET -/obj/effect/shuttle_landmark/temporary/Initialize() +/obj/effect/shuttle_landmark/temporary/Initialize(var/mapload, var/secure = TRUE) landmark_tag += "-[random_id("landmarks",1,9999)]" + if(!secure) + flags |= (SLANDMARK_FLAG_DISCONNECTED | SLANDMARK_FLAG_ZERO_G) . = ..() /obj/effect/shuttle_landmark/temporary/Destroy() diff --git a/maps/tradeship/tradeship_overmap.dm b/maps/tradeship/tradeship_overmap.dm index 0592bcf86c5..ff1022ce535 100644 --- a/maps/tradeship/tradeship_overmap.dm +++ b/maps/tradeship/tradeship_overmap.dm @@ -6,6 +6,7 @@ vessel_mass = 5000 max_speed = 1/(2 SECONDS) burn_delay = 2 SECONDS + restricted_area = 30 initial_generic_waypoints = list("nav_tradeship_below_bow", "nav_tradeship_below_starboardastern", "nav_tradeship_port_dock_shuttle") initial_restricted_waypoints = list( diff --git a/nano/templates/docking.tmpl b/nano/templates/docking.tmpl index d4ef2d0922d..a603ab5f817 100644 --- a/nano/templates/docking.tmpl +++ b/nano/templates/docking.tmpl @@ -8,7 +8,7 @@
Beacon Name | Size | Docking Lock | Docking by code + {{for data.docking_beacons}} + |
---|---|---|---|
{{:helper.link(value.name, '', {'beacon' : value.network_tag})}} + | {{:value.size}} + | {{:value.locked ? 'LOCKED' : 'UNLOCKED'}} + | {{:value.code_docking ? 'ENABLED' : 'DISABLED'}} + {{/for}} + |