diff --git a/code/__DEFINES/radio.dm b/code/__DEFINES/radio.dm index f4967eb9ce3..686c42e07d0 100644 --- a/code/__DEFINES/radio.dm +++ b/code/__DEFINES/radio.dm @@ -86,6 +86,7 @@ #define FREQ_ELECTROPACK 1449 #define FREQ_MAGNETS 1449 #define FREQ_LOCATOR_IMPLANT 1451 +#define FREQ_RADIO_NAV_BEACON 1455 #define FREQ_SIGNALER 1457 // the default for new signalers #define FREQ_COMMON 1459 // Common comms frequency, dark green diff --git a/code/datums/components/deployable.dm b/code/datums/components/deployable.dm index 7a5e798b337..e2c6b84703e 100644 --- a/code/datums/components/deployable.dm +++ b/code/datums/components/deployable.dm @@ -10,15 +10,18 @@ /datum/component/deployable /// The time it takes to deploy the object - var/deploy_time = 5 SECONDS + var/deploy_time /// The object that gets spawned if deployed successfully var/obj/thing_to_be_deployed + /// If the item used to deploy gets deleted on use or not + var/delete_on_use + /// If the component adds a little bit into the parent's description + var/add_description_hint + /// Used in getting the name of the deployed object var/deployed_name - /// If the item used to deploy gets deleted on use or not - var/delete_on_use = TRUE -/datum/component/deployable/Initialize(deploy_time, thing_to_be_deployed, delete_on_use) +/datum/component/deployable/Initialize(deploy_time = 5 SECONDS, thing_to_be_deployed, delete_on_use = TRUE, add_description_hint = TRUE) . = ..() if(!isitem(parent)) return COMPONENT_INCOMPATIBLE @@ -26,8 +29,10 @@ src.deploy_time = deploy_time src.thing_to_be_deployed = thing_to_be_deployed src.delete_on_use = delete_on_use + src.add_description_hint = add_description_hint - RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(examine)) + if(add_description_hint) + RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(examine)) RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, PROC_REF(on_attack_hand)) var/obj/item/typecast = thing_to_be_deployed diff --git a/code/modules/research/designs/machine_designs.dm b/code/modules/research/designs/machine_designs.dm index d4e70865982..6597c12fbec 100644 --- a/code/modules/research/designs/machine_designs.dm +++ b/code/modules/research/designs/machine_designs.dm @@ -874,17 +874,6 @@ ) departmental_flags = DEPARTMENT_BITFLAG_MEDICAL -/datum/design/board/spaceship_navigation_beacon - name = "Bluespace Navigation Gigabeacon Board" - desc = "The circuit board for a Bluespace Navigation Gigabeacon." - id = "spaceship_navigation_beacon" - build_type = IMPRINTER - build_path = /obj/item/circuitboard/machine/spaceship_navigation_beacon - category = list( - RND_CATEGORY_MACHINE + RND_SUBCATEGORY_MACHINE_TELEPORT - ) - departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING | DEPARTMENT_BITFLAG_SCIENCE - /datum/design/board/medical_kiosk name = "Medical Kiosk Board" desc = "The circuit board for a Medical Kiosk." diff --git a/code/modules/research/designs/misc_designs.dm b/code/modules/research/designs/misc_designs.dm index 03f512a3e09..3f4d4b8f8ec 100644 --- a/code/modules/research/designs/misc_designs.dm +++ b/code/modules/research/designs/misc_designs.dm @@ -1034,6 +1034,18 @@ ) departmental_flags = DEPARTMENT_BITFLAG_SERVICE +/datum/design/radio_navigation_beacon + name = "Compact Radio Navigation Gigabeacon" + id = "gigabeacon" + build_type = PROTOLATHE | AWAY_LATHE + materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2, + /datum/material/glass = HALF_SHEET_MATERIAL_AMOUNT) + build_path = /obj/item/folded_navigation_gigabeacon + category = list( + RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_ENGINEERING + ) + departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING | DEPARTMENT_BITFLAG_SCIENCE | DEPARTMENT_BITFLAG_CARGO + // Experimental designs /datum/design/polymorph_belt diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index ca61b41b946..bb82108d872 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -777,16 +777,6 @@ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000) discount_experiments = list(/datum/experiment/scanning/points/machinery_pinpoint_scan/tier3_cells = 3000) -/datum/techweb_node/regulated_bluespace - id = "regulated_bluespace" - display_name = "Regulated Bluespace Research" - description = "Bluespace technology using stable and balanced procedures. Required by galactic convention for public use." - prereq_ids = list("base") - design_ids = list( - "spaceship_navigation_beacon", - ) - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) - /datum/techweb_node/unregulated_bluespace id = "unregulated_bluespace" display_name = "Unregulated Bluespace Research" @@ -1228,6 +1218,7 @@ "s_server", "s_transmitter", "s_treatment", + "gigabeacon", ) /datum/techweb_node/integrated_hud diff --git a/code/modules/shuttle/spaceship_navigation_beacon.dm b/code/modules/shuttle/spaceship_navigation_beacon.dm index 267ef89b789..4ae91af588a 100644 --- a/code/modules/shuttle/spaceship_navigation_beacon.dm +++ b/code/modules/shuttle/spaceship_navigation_beacon.dm @@ -1,60 +1,109 @@ -/obj/item/circuitboard/machine/spaceship_navigation_beacon - name = "Bluespace Navigation Gigabeacon (Machine Board)" - build_path = /obj/machinery/spaceship_navigation_beacon - req_components = list() - - /obj/machinery/spaceship_navigation_beacon - name = "Bluespace Navigation Gigabeacon" - desc = "A device that creates a bluespace anchor that allow ships jump near to it." - icon = 'icons/obj/antags/abductor.dmi' - icon_state = "core" - base_icon_state = "core" + name = "radio navigation gigabeacon" + desc = "A device that constantly transmits its position over several different commonly used maritime navigation frequencies. Used to create shuttle navigation waypoints in unexplored or undeveloped areas." + icon = 'icons/obj/machines/navigation_beacon.dmi' + icon_state = "beacon_active" + base_icon_state = "beacon" density = TRUE - circuit = /obj/item/circuitboard/machine/spaceship_navigation_beacon - - var/locked = FALSE //Locked beacons don't allow to jump to it. + flags_1 = NODECONSTRUCT_1 + /// Locked beacons cannot be jumped to by ships. + var/locked = FALSE + /// Time between automated messages. + var/automatic_message_cooldown = 5 MINUTES + /// Next world tick to send an automatic message. + var/next_automatic_message_time + /// Our internal radio. + var/obj/item/radio/radio /obj/machinery/spaceship_navigation_beacon/Initialize(mapload) . = ..() SSshuttle.beacon_list |= src + name = "[initial(src.name)] [z]-[rand(0, 999)]" + + var/static/list/multitool_tips = list( + TOOL_MULTITOOL = list( + SCREENTIP_CONTEXT_LMB = "Edit beacon name", + SCREENTIP_CONTEXT_RMB = "Lock/Unlock beacon", + ) + ) + AddElement(/datum/element/contextual_screentip_tools, multitool_tips) + + radio = new(src) + radio.set_listening(FALSE) + radio.set_frequency(FREQ_RADIO_NAV_BEACON) + radio.freqlock = RADIO_FREQENCY_LOCKED + radio.recalculateChannels() + + START_PROCESSING(SSmachines, src) + COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown) + /obj/machinery/spaceship_navigation_beacon/emp_act() locked = TRUE + update_icon_state() /obj/machinery/spaceship_navigation_beacon/Destroy() SSshuttle.beacon_list -= src return ..() -// update the icon_state /obj/machinery/spaceship_navigation_beacon/update_icon_state() - icon_state = "[base_icon_state][powered() ? null : "-open"]" + icon_state = "[base_icon_state][locked ? "_locked" : "_active"]" return ..() -/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/multitool/I) +/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/tool) ..() - if(panel_open) - var/chosen_tag = tgui_input_text(user, "Enter the custom name for this beacon", "Beacon Reclassification", max_length = MAX_NAME_LEN) - if(!chosen_tag) - return - var/new_name = "Beacon_[chosen_tag]" - if(new_name && Adjacent(user)) - name = new_name - to_chat(user, span_notice("You change beacon name to [name].")) - else - locked =!locked - to_chat(user, span_notice("You [locked ? "" : "un"]lock [src].")) + + var/chosen_tag = tgui_input_text(user, "Enter the custom name for this beacon", "Beacon Reclassification", max_length = MAX_NAME_LEN) + if(!chosen_tag) + return + + var/new_name = "[initial(src.name)] [chosen_tag]" + if(new_name && Adjacent(user)) + name = new_name + balloon_alert_to_viewers("beacon renamed") + + return TRUE + +/obj/machinery/spaceship_navigation_beacon/multitool_act_secondary(mob/living/user, obj/item/tool) + ..() + + locked = !locked + + balloon_alert_to_viewers("[!locked ? "unlocked" : "locked"]") + update_icon_state() + return TRUE /obj/machinery/spaceship_navigation_beacon/examine() .=..() - . += "Status: [locked ? "LOCKED" : "Stable"] " + . += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.") + if(locked) + . += span_warning("The blinking red light on the front indicates that this beacon is LOCKED.") + else + . += span_notice("The blinking green light on the front indicates that this beacon is operating normally.") -/obj/machinery/spaceship_navigation_beacon/attackby(obj/item/W, mob/user, params) - if(default_deconstruction_screwdriver(user, "core-open", "core", W)) - return - if(default_deconstruction_crowbar(W)) - return +/obj/machinery/spaceship_navigation_beacon/process(seconds_per_tick) + if(COOLDOWN_FINISHED(src, next_automatic_message_time) && radio) + var/automatic_nav_message = "[src], Sector [z], [locked ? "Beacon Locked" : "Beacon Operational"], Grid Coordinates, [x] East, [y] North." - return ..() + radio.talk_into(src, "[automatic_nav_message]") + + COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown) + +// Item used to actually make nav beacons + +/obj/item/folded_navigation_gigabeacon + name = "compact radio navigation gigabeacon" + desc = "A compact radio navigation gigabeacon, a device used to provide shuttle navigation waypoints in unexplored areas. Must be deployed before use." + icon = 'icons/obj/machines/navigation_beacon.dmi' + icon_state = "beacon_folded" + +/obj/item/folded_navigation_gigabeacon/Initialize(mapload) + . = ..() + AddComponent(/datum/component/deployable, 3 SECONDS, /obj/machinery/spaceship_navigation_beacon, delete_on_use = TRUE) + +/obj/item/folded_navigation_gigabeacon/examine() + .=..() + . += span_notice("The backside has instructions in various galactic languages detailing how this can be deployed in hand without any special tools.") + . += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.") diff --git a/icons/obj/machines/navigation_beacon.dmi b/icons/obj/machines/navigation_beacon.dmi new file mode 100644 index 00000000000..f20ca068c52 Binary files /dev/null and b/icons/obj/machines/navigation_beacon.dmi differ