Runescape Style Chat.

Orginal: https://github.com/tgstation/tgstation/pull/50608
This commit is contained in:
QuoteFox
2020-06-11 12:12:01 +01:00
parent 90603d76e6
commit 060ac61c48
16 changed files with 309 additions and 30 deletions
+17 -21
View File
@@ -683,31 +683,27 @@ GLOBAL_LIST_INIT(hallucination_list, list(
if(get_dist(target,H)<get_dist(target,person))
person = H
people += H
if(person && !force_radio) //Basic talk
var/chosen = specific_message
if(!chosen)
chosen = capitalize(pick(speak_messages))
chosen = replacetext(chosen, "%TARGETNAME%", target_name)
var/image/speech_overlay = image('icons/mob/talk.dmi', person, "default0", layer = ABOVE_MOB_LAYER)
var/message = target.compose_message(person,understood_language,chosen,null,list(person.speech_span),face_name = TRUE)
feedback_details += "Type: Talk, Source: [person.real_name], Message: [message]"
to_chat(target, message)
if(target.client)
target.client.images |= speech_overlay
sleep(30)
target.client.images.Remove(speech_overlay)
else // Radio talk
var/chosen = specific_message
if(!chosen)
chosen = capitalize(pick(radio_messages))
chosen = replacetext(chosen, "%TARGETNAME%", target_name)
// Get person to affect if radio hallucination
var/is_radio = !person || force_radio
if (is_radio)
var/list/humans = list()
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
humans += H
person = pick(humans)
var/message = target.compose_message(person,understood_language,chosen,"[FREQ_COMMON]",list(person.speech_span),face_name = TRUE)
feedback_details += "Type: Radio, Source: [person.real_name], Message: [message]"
to_chat(target, message)
// Generate message
var/spans = list(person.speech_span)
var/chosen = !specific_message ? capitalize(pick(is_radio ? speak_messages : radio_messages)) : specific_message
chosen = replacetext(chosen, "%TARGETNAME%", target_name)
var/message = target.compose_message(person, understood_language, chosen, is_radio ? "[FREQ_COMMON]" : null, spans, face_name = TRUE)
feedback_details += "Type: [is_radio ? "Radio" : "Talk"], Source: [person.real_name], Message: [message]"
// Display message
if (!is_radio && !target.client?.prefs.chat_on_map)
var/image/speech_overlay = image('icons/mob/talk.dmi', person, "default0", layer = ABOVE_MOB_LAYER)
INVOKE_ASYNC(GLOBAL_PROC, /proc/flick_overlay, speech_overlay, list(target.client), 30)
if (target.client?.prefs.chat_on_map)
target.create_chat_message(person, understood_language, chosen, spans, 0)
to_chat(target, message)
qdel(src)
/datum/hallucination/message