mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-07 23:09:28 +00:00
* Input ports now connect to multiple output ports. Remove combiner. (#60494) * tgui bsod * debug disconnections * prelim * recomment * set_value -> put ._. * DAMN IT * reinsert subsystem * prepare * unditch signals * remove combiner * remove combiner some more * how did router.dm get here? deleting. * These two COMSIGS should be one. * critical typo * inline cast * have your signals * Have your set_input & set_output. * make compile * upgrade save/load to n-to-n-wires * have your documentation * have your unsafe proc * pay no attention to the compile errors * unlist the ref * paste my for block back in ._. * fix manual input * oops pushed too soon * Have your !port.connected_to?.length Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com> Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com> * Input ports now connect to multiple output ports. Remove combiner. Co-authored-by: Gurkenglas <gurkenglas@hotmail.de> Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
/**
|
|
* # Speech Component
|
|
*
|
|
* Sends a message. Requires a shell.
|
|
*/
|
|
/obj/item/circuit_component/speech
|
|
display_name = "Speech"
|
|
desc = "A component that sends a message. Requires a shell."
|
|
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
|
|
|
/// The message to send
|
|
var/datum/port/input/message
|
|
|
|
/// The cooldown for this component of how often it can send speech messages.
|
|
var/speech_cooldown = 1 SECONDS
|
|
|
|
/obj/item/circuit_component/speech/get_ui_notices()
|
|
. = ..()
|
|
. += create_ui_notice("Speech Cooldown: [DisplayTimeText(speech_cooldown)]", "orange", "stopwatch")
|
|
|
|
/obj/item/circuit_component/speech/Initialize()
|
|
. = ..()
|
|
message = add_input_port("Message", PORT_TYPE_STRING, FALSE)
|
|
|
|
/obj/item/circuit_component/speech/input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
if(TIMER_COOLDOWN_CHECK(parent, COOLDOWN_CIRCUIT_SPEECH))
|
|
return
|
|
|
|
if(message.value)
|
|
var/atom/movable/shell = parent.shell
|
|
// Prevents appear as the individual component if there is a shell.
|
|
if(shell)
|
|
shell.say(message.value)
|
|
else
|
|
say(message.value)
|
|
TIMER_COOLDOWN_START(parent, COOLDOWN_CIRCUIT_SPEECH, speech_cooldown)
|