diff --git a/code/modules/research/designs/wiremod_designs.dm b/code/modules/research/designs/wiremod_designs.dm index 98f4bc9a4d4..7cae962a5bd 100644 --- a/code/modules/research/designs/wiremod_designs.dm +++ b/code/modules/research/designs/wiremod_designs.dm @@ -351,6 +351,16 @@ id = "comp_bar_overlay" build_path = /obj/item/circuit_component/object_overlay/bar +/datum/design/component/bci/vox + name = "VOX Announcement Component" + id = "comp_vox" + build_path = /obj/item/circuit_component/vox + +/datum/design/component/bci/thought_listener + name = "Thought Listener Component" + id = "comp_thought_listener" + build_path = /obj/item/circuit_component/thought_listener + /datum/design/component/bci/target_intercept name = "BCI Target Interceptor" id = "comp_target_intercept" diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index b4fb1e57744..e268c047d22 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -790,9 +790,11 @@ "bci_shell", "comp_bar_overlay", "comp_bci_action", - "comp_target_intercept", "comp_counter_overlay", "comp_object_overlay", + "comp_target_intercept", + "comp_thought_listener", + "comp_vox", ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 500) diff --git a/code/modules/wiremod/components/bci/hud/object_overlay.dm b/code/modules/wiremod/components/bci/hud/object_overlay.dm index 4dca7e556f9..568521155e9 100644 --- a/code/modules/wiremod/components/bci/hud/object_overlay.dm +++ b/code/modules/wiremod/components/bci/hud/object_overlay.dm @@ -21,6 +21,7 @@ var/datum/port/input/image_pixel_x var/datum/port/input/image_pixel_y + var/datum/port/input/image_rotation /// On/Off signals var/datum/port/input/signal_on @@ -38,6 +39,7 @@ image_pixel_x = add_input_port("X-Axis Shift", PORT_TYPE_NUMBER) image_pixel_y = add_input_port("Y-Axis Shift", PORT_TYPE_NUMBER) + image_rotation = add_input_port("Overlay Rotation", PORT_TYPE_NUMBER) /obj/item/circuit_component/object_overlay/Destroy() for(var/active_overlay in active_overlays) @@ -106,6 +108,11 @@ if(image_pixel_y.value != null) cool_overlay.pixel_y = image_pixel_y.value + if(image_rotation.value != null) + var/matrix/turn_matrix = cool_overlay.transform + turn_matrix.Turn(image_rotation.value) + cool_overlay.transform = turn_matrix + var/datum/atom_hud/alternate_appearance/basic/one_person/alt_appearance = target_atom.add_alt_appearance( /datum/atom_hud/alternate_appearance/basic/one_person, "object_overlay_[REF(src)]", diff --git a/code/modules/wiremod/components/bci/thought_listener.dm b/code/modules/wiremod/components/bci/thought_listener.dm new file mode 100644 index 00000000000..f7bf30a3cfd --- /dev/null +++ b/code/modules/wiremod/components/bci/thought_listener.dm @@ -0,0 +1,62 @@ +/** + * # Thought Listener Component + * + * Allows user to input a string. + * Requires a BCI shell. + */ + +/obj/item/circuit_component/thought_listener + display_name = "Thought Listener" + desc = "A component that allows the user to input a string using their mind. Requires a BCI shell." + category = "BCI" + + required_shells = list(/obj/item/organ/cyberimp/bci) + + var/datum/port/input/input_name + var/datum/port/input/input_desc + + var/datum/port/output/output + var/datum/port/output/failure + + circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL + + var/obj/item/organ/cyberimp/bci/bci + var/ready = TRUE + +/obj/item/circuit_component/thought_listener/populate_ports() + input_name = add_input_port("Input Name", PORT_TYPE_STRING) + input_desc = add_input_port("Input Description", PORT_TYPE_STRING) + output = add_output_port("Recieved Thought", PORT_TYPE_STRING) + trigger_output = add_output_port("Triggered", PORT_TYPE_SIGNAL) + failure = add_output_port("On Failure", PORT_TYPE_SIGNAL) + +/obj/item/circuit_component/thought_listener/register_shell(atom/movable/shell) + if(istype(shell, /obj/item/organ/cyberimp/bci)) + bci = shell + +/obj/item/circuit_component/thought_listener/unregister_shell(atom/movable/shell) + bci = null + +/obj/item/circuit_component/thought_listener/input_received(datum/port/input/port) + if(!ready) + failure.set_output(COMPONENT_SIGNAL) + return + + if(!bci) + failure.set_output(COMPONENT_SIGNAL) + return + + var/mob/living/owner = bci.owner + + if(!owner || !istype(owner) || !owner.client) + failure.set_output(COMPONENT_SIGNAL) + return + + INVOKE_ASYNC(src, .proc/thought_listen, owner) + ready = FALSE + +/obj/item/circuit_component/thought_listener/proc/thought_listen(mob/living/owner) + var/message = tgui_input_text(owner, input_desc.value ? input_desc.value : "", input_name.value ? input_name.value : "Thought Listener", "") + output.set_output(message) + trigger_output.set_output(COMPONENT_SIGNAL) + ready = TRUE diff --git a/code/modules/wiremod/components/bci/vox.dm b/code/modules/wiremod/components/bci/vox.dm new file mode 100644 index 00000000000..8749d1b72b6 --- /dev/null +++ b/code/modules/wiremod/components/bci/vox.dm @@ -0,0 +1,59 @@ +/** + * # VOX Announcement Component + * + * These play a VOX announcement with inputed words from either a string or a list. + * Requires a BCI shell. + */ + +/obj/item/circuit_component/vox + display_name = "VOX Announcement" + desc = "A component that plays a local VOX Announcement for the user. Requires a BCI shell." + category = "BCI" + + required_shells = list(/obj/item/organ/cyberimp/bci) + + var/datum/port/input/option/type_option + var/current_type + + var/datum/port/input/word_list + + circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL + + var/obj/item/organ/cyberimp/bci/bci + +/obj/item/circuit_component/vox/populate_options() + type_option = add_option_port("VOX Type", list(PORT_TYPE_LIST(PORT_TYPE_STRING), PORT_TYPE_STRING)) + +/obj/item/circuit_component/vox/populate_ports() + word_list = add_input_port("Word List", PORT_TYPE_LIST(PORT_TYPE_STRING)) + +/obj/item/circuit_component/vox/register_shell(atom/movable/shell) + if(istype(shell, /obj/item/organ/cyberimp/bci)) + bci = shell + +/obj/item/circuit_component/vox/unregister_shell(atom/movable/shell) + bci = null + +/obj/item/circuit_component/vox/pre_input_received(datum/port/input/port) + var/current_option = type_option.value + if(current_type != current_option) + current_type = current_option + word_list.set_datatype(current_type) + +/obj/item/circuit_component/vox/input_received(datum/port/input/port) + if(!bci) + return + + var/mob/living/owner = bci.owner + + if(!owner || !istype(owner) || !owner.client || !word_list.value) + return + + if(current_type == PORT_TYPE_STRING) + var/words_list = splittext(trim(word_list.value), " ") + + for(var/word in words_list) + play_vox_word(word, only_listener = owner) + else + for(var/word in word_list.value) + play_vox_word(word, only_listener = owner) diff --git a/tgstation.dme b/tgstation.dme index 0e3a4f58fb9..e03b723cc4c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4301,6 +4301,8 @@ #include "code\modules\wiremod\components\atom\reagentscanner.dm" #include "code\modules\wiremod\components\atom\self.dm" #include "code\modules\wiremod\components\atom\species.dm" +#include "code\modules\wiremod\components\bci\thought_listener.dm" +#include "code\modules\wiremod\components\bci\vox.dm" #include "code\modules\wiremod\components\bci\hud\bar_overlay.dm" #include "code\modules\wiremod\components\bci\hud\counter_overlay.dm" #include "code\modules\wiremod\components\bci\hud\object_overlay.dm"