mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #6789 from mwerezak/binary-talk
Allows properly keyed radios to broadcast in robot talk and/or hivemind + some cleanup
This commit is contained in:
@@ -426,15 +426,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
|
||||
|
||||
/client/proc/cmd_switch_radio()
|
||||
set category = "Debug"
|
||||
set name = "Switch Radio Mode"
|
||||
set desc = "Toggle between normal radios and experimental radios. Have a coder present if you do this."
|
||||
|
||||
GLOBAL_RADIO_TYPE = !GLOBAL_RADIO_TYPE // toggle
|
||||
log_admin("[key_name(src)] has turned the experimental radio system [GLOBAL_RADIO_TYPE ? "on" : "off"].")
|
||||
message_admins("[key_name_admin(src)] has turned the experimental radio system [GLOBAL_RADIO_TYPE ? "on" : "off"].", 0)
|
||||
feedback_add_details("admin_verb","SRM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_areatest()
|
||||
set category = "Mapping"
|
||||
|
||||
@@ -115,13 +115,12 @@
|
||||
return
|
||||
else
|
||||
if(message_mode)
|
||||
if(message_mode in (radiochannels | "department"))
|
||||
if(l_ear && istype(l_ear,/obj/item/device/radio))
|
||||
l_ear.talk_into(src,message, message_mode, verb, speaking)
|
||||
used_radios += l_ear
|
||||
else if(r_ear && istype(r_ear,/obj/item/device/radio))
|
||||
r_ear.talk_into(src,message, message_mode, verb, speaking)
|
||||
used_radios += r_ear
|
||||
if(l_ear && istype(l_ear,/obj/item/device/radio))
|
||||
l_ear.talk_into(src,message, message_mode, verb, speaking)
|
||||
used_radios += l_ear
|
||||
else if(r_ear && istype(r_ear,/obj/item/device/radio))
|
||||
r_ear.talk_into(src,message, message_mode, verb, speaking)
|
||||
used_radios += r_ear
|
||||
|
||||
var/sound/speech_sound
|
||||
var/sound_vol
|
||||
@@ -129,7 +128,18 @@
|
||||
speech_sound = sound(pick(species.speech_sounds))
|
||||
sound_vol = 50
|
||||
|
||||
..(message, speaking, verb, alt_name, italics, message_range, used_radios, speech_sound, sound_vol) //ohgod we should really be passing a datum here.
|
||||
//speaking into radios
|
||||
if(used_radios.len)
|
||||
italics = 1
|
||||
message_range = 1
|
||||
|
||||
for(var/mob/living/M in hearers(5, src))
|
||||
if(M != src)
|
||||
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
|
||||
if (speech_sound)
|
||||
sound_vol *= 0.5
|
||||
|
||||
..(message, speaking, verb, alt_name, italics, message_range, speech_sound, sound_vol) //ohgod we should really be passing a datum here.
|
||||
|
||||
/mob/living/carbon/human/proc/forcesay(list/append)
|
||||
if(stat == CONSCIOUS)
|
||||
|
||||
@@ -3,6 +3,7 @@ var/list/department_radio_keys = list(
|
||||
":l" = "left ear", "#l" = "left ear", ".l" = "left ear",
|
||||
":i" = "intercom", "#i" = "intercom", ".i" = "intercom",
|
||||
":h" = "department", "#h" = "department", ".h" = "department",
|
||||
":0" = "special", "#0" = "special", ".0" = "special", //activate radio-specific special functions
|
||||
":c" = "Command", "#c" = "Command", ".c" = "Command",
|
||||
":n" = "Science", "#n" = "Science", ".n" = "Science",
|
||||
":m" = "Medical", "#m" = "Medical", ".m" = "Medical",
|
||||
@@ -59,7 +60,7 @@ var/list/department_radio_keys = list(
|
||||
if(!istype(dongle)) return
|
||||
if(dongle.translate_binary) return 1
|
||||
|
||||
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/list/used_radios = list(), var/sound/speech_sound, var/sound_vol)
|
||||
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/sound/speech_sound, var/sound_vol)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -73,20 +74,6 @@ var/list/department_radio_keys = list(
|
||||
say_signlang(message, pick(speaking.signlang_verb), speaking)
|
||||
return 1
|
||||
|
||||
//speaking into radios
|
||||
if(used_radios.len)
|
||||
italics = 1
|
||||
message_range = 1
|
||||
|
||||
if (!istype(src, /mob/living/silicon/ai)) // Atlantis: Prevents nearby people from hearing the AI when it talks using it's integrated radio.
|
||||
for(var/mob/living/M in hearers(5, src))
|
||||
if(M != src)
|
||||
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
|
||||
if (speech_sound)
|
||||
src.playsound_local(get_turf(src), speech_sound, sound_vol * 0.5, 1)
|
||||
|
||||
speech_sound = null //so we don't play it twice.
|
||||
|
||||
//make sure the air can transmit speech
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
if(environment)
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
return 1
|
||||
|
||||
else
|
||||
if(message_mode && message_mode in radiochannels)
|
||||
if(message_mode)
|
||||
switch(bot_type)
|
||||
if(IS_AI)
|
||||
if (AI.aiRadio.disabledAi)
|
||||
|
||||
Reference in New Issue
Block a user