mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 04:36:53 +01:00
Runechat (#8121)
* Message piece combiner returns a list * Emote formatter returns a list * Port Runechat * Various onamonapoea * Suggested changes, small opts * Fix chat message on different size mobs * Couple more runefixes * Enable encoding chat emphasis in runechat * Remove extra asterisks from rune audible messages * Fix runedefines
This commit is contained in:
@@ -323,8 +323,7 @@
|
||||
var/message = sanitize(input("What do you want the message to be?", "Make Sound") as text|null)
|
||||
if(!message)
|
||||
return
|
||||
for (var/mob/V in hearers(O))
|
||||
V.show_message(message, 2)
|
||||
O.audible_message(message)
|
||||
log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound")
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound.</font>", 1)
|
||||
feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -74,3 +74,6 @@
|
||||
var/connection_realtime
|
||||
///world.timeofday they connected
|
||||
var/connection_timeofday
|
||||
|
||||
// Runechat messages
|
||||
var/list/seen_messages
|
||||
|
||||
@@ -253,6 +253,32 @@ var/list/_client_preferences_by_type
|
||||
enabled_description = "Show"
|
||||
disabled_description = "Hide"
|
||||
|
||||
/datum/client_preference/runechat_mob
|
||||
description = "Runechat (Mobs)"
|
||||
key = "RUNECHAT_MOB"
|
||||
enabled_description = "Show"
|
||||
disabled_description = "Hide"
|
||||
|
||||
/datum/client_preference/runechat_obj
|
||||
description = "Runechat (Objs)"
|
||||
key = "RUNECHAT_OBJ"
|
||||
enabled_description = "Show"
|
||||
disabled_description = "Hide"
|
||||
|
||||
/datum/client_preference/runechat_border
|
||||
description = "Runechat Message Border"
|
||||
key = "RUNECHAT_BORDER"
|
||||
enabled_description = "Show"
|
||||
disabled_description = "Hide"
|
||||
enabled_by_default = FALSE
|
||||
|
||||
/datum/client_preference/runechat_long_messages
|
||||
description = "Runechat Message Length"
|
||||
key = "RUNECHAT_LONG"
|
||||
enabled_description = "ERP KING"
|
||||
disabled_description = "Normie"
|
||||
enabled_by_default = FALSE
|
||||
|
||||
/datum/client_preference/status_indicators/toggled(mob/preference_mob, enabled)
|
||||
. = ..()
|
||||
if(preference_mob && preference_mob.plane_holder)
|
||||
|
||||
@@ -103,11 +103,14 @@ var/global/list/emotes_by_key
|
||||
if(target)
|
||||
use_1p = replace_target_tokens(use_1p, target)
|
||||
use_1p = "<span class='emote'>[capitalize(replace_user_tokens(use_1p, user))]</span>"
|
||||
var/use_3p = get_emote_message_3p(user, target, extra_params)
|
||||
if(use_3p)
|
||||
var/prefinal_3p
|
||||
var/use_3p
|
||||
var/raw_3p = get_emote_message_3p(user, target, extra_params)
|
||||
if(raw_3p)
|
||||
if(target)
|
||||
use_3p = replace_target_tokens(use_3p, target)
|
||||
use_3p = "<span class='emote'><b>\The [user]</b> [replace_user_tokens(use_3p, user)]</span>"
|
||||
raw_3p = replace_target_tokens(raw_3p, target)
|
||||
prefinal_3p = replace_user_tokens(raw_3p, user)
|
||||
use_3p = "<span class='emote'><b>\The [user]</b> [prefinal_3p]</span>"
|
||||
var/use_radio = get_radio_message(user)
|
||||
if(use_radio)
|
||||
if(target)
|
||||
@@ -124,12 +127,12 @@ var/global/list/emotes_by_key
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.silent)
|
||||
M.visible_message(message = "[user] opens their mouth silently!", self_message = "You cannot say anything!", blind_message = emote_message_impaired)
|
||||
M.visible_message(message = "[user] opens their mouth silently!", self_message = "You cannot say anything!", blind_message = emote_message_impaired, runemessage = "opens their mouth silently!")
|
||||
return
|
||||
else
|
||||
M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, radio_message = use_radio)
|
||||
M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, radio_message = use_radio, runemessage = prefinal_3p)
|
||||
else
|
||||
M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range)
|
||||
M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range, runemessage = prefinal_3p)
|
||||
|
||||
do_extra(user, target)
|
||||
do_sound(user)
|
||||
|
||||
@@ -78,7 +78,8 @@
|
||||
return
|
||||
|
||||
if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled())
|
||||
audible_message("<b>\The [src]</b> [use_emote.emote_message_muffled || "makes a muffled sound."]")
|
||||
var/muffle_message = use_emote.emote_message_muffled || "makes a muffled sound."
|
||||
audible_message("<b>\The [src]</b> [muffle_message]", runemessage = "[muffle_message]")
|
||||
return
|
||||
|
||||
next_emote = world.time + use_emote.emote_delay
|
||||
@@ -141,7 +142,7 @@
|
||||
subtext = html_encode(subtext)
|
||||
// Store the player's name in a nice bold, naturalement
|
||||
nametext = "<B>[emoter]</B>"
|
||||
return pretext + nametext + subtext
|
||||
return list("pretext" = pretext, "nametext" = nametext, "subtext" = subtext)
|
||||
|
||||
/mob/proc/custom_emote(var/m_type = VISIBLE_MESSAGE, var/message, var/range = world.view)
|
||||
|
||||
@@ -155,8 +156,14 @@
|
||||
else
|
||||
input = message
|
||||
|
||||
var/list/formatted
|
||||
var/runemessage
|
||||
if(input)
|
||||
message = format_emote(src, message)
|
||||
formatted = format_emote(src, message)
|
||||
message = formatted["pretext"] + formatted["nametext"] + formatted["subtext"]
|
||||
runemessage = formatted["subtext"]
|
||||
// This is just personal preference (but I'm objectively right) that custom emotes shouldn't have periods at the end in runechat
|
||||
runemessage = replacetext(runemessage,".","",length(runemessage),length(runemessage)+1)
|
||||
else
|
||||
return
|
||||
|
||||
@@ -184,6 +191,7 @@
|
||||
if(isobserver(M))
|
||||
message = "<span class='emote'><B>[src]</B> ([ghost_follow_link(src, M)]) [input]</span>"
|
||||
M.show_message(message, m_type)
|
||||
M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), (m_type == AUDIBLE_MESSAGE))
|
||||
|
||||
for(var/obj in o_viewers)
|
||||
var/obj/O = obj
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
text = get_pin_data(IC_INPUT, 1)
|
||||
if(!isnull(text))
|
||||
var/obj/O = assembly ? loc : assembly
|
||||
audible_message("[bicon(O)] \The [O.name] states, \"[text]\"")
|
||||
audible_message("[bicon(O)] \The [O.name] states, \"[text]\"", runemessage = text)
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech/advanced
|
||||
name = "advanced text-to-speech circuit"
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
/mob/proc/combine_message(var/list/message_pieces, var/verb, var/mob/speaker, always_stars = FALSE, var/radio = FALSE)
|
||||
var/iteration_count = 0
|
||||
var/msg = "" // This is to make sure that the pieces have actually added something
|
||||
. = "[verb], \""
|
||||
var/raw_msg = ""
|
||||
. = list("formatted" = "[verb], \"", "raw" = "")
|
||||
|
||||
for(var/datum/multilingual_say_piece/SP in message_pieces)
|
||||
iteration_count++
|
||||
var/piece = SP.message
|
||||
@@ -11,9 +13,13 @@
|
||||
|
||||
if(SP.speaking && SP.speaking.flags & INNATE) // Snowflake for noise lang
|
||||
if(radio)
|
||||
return SP.speaking.format_message_radio(piece)
|
||||
.["formatted"] = SP.speaking.format_message_radio(piece)
|
||||
.["raw"] = piece
|
||||
return
|
||||
else
|
||||
return SP.speaking.format_message(piece)
|
||||
.["formatted"] = SP.speaking.format_message(piece)
|
||||
.["raw"] = piece
|
||||
return
|
||||
|
||||
if(iteration_count == 1)
|
||||
piece = capitalize(piece)
|
||||
@@ -27,6 +33,9 @@
|
||||
if(istype(S.say_list) && length(S.say_list.speak))
|
||||
piece = pick(S.say_list.speak)
|
||||
|
||||
raw_msg += (piece + " ")
|
||||
|
||||
//HTML formatting
|
||||
if(!SP.speaking) // Catch the most generic case first
|
||||
piece = "<span class='message body'>[piece]</span>"
|
||||
else if(radio) // SP.speaking == TRUE enforced by previous !SP.speaking
|
||||
@@ -38,10 +47,11 @@
|
||||
|
||||
if(msg == "")
|
||||
// There is literally no content left in this message, we need to shut this shit down
|
||||
. = "" // hear_say will suppress it
|
||||
.["formatted"] = "" // hear_say will suppress it
|
||||
else
|
||||
. = trim(. + trim(msg))
|
||||
. += "\""
|
||||
.["formatted"] = trim(.["formatted"] + trim(msg))
|
||||
.["formatted"] += "\""
|
||||
.["raw"] = trim(raw_msg)
|
||||
|
||||
/mob/proc/saypiece_scramble(datum/multilingual_say_piece/SP)
|
||||
if(SP.speaking)
|
||||
@@ -76,7 +86,8 @@
|
||||
var/mob/living/carbon/human/H = speaker
|
||||
speaker_name = H.GetVoice()
|
||||
|
||||
var/message = combine_message(message_pieces, verb, speaker)
|
||||
var/list/combined = combine_message(message_pieces, verb, speaker)
|
||||
var/message = combined["formatted"]
|
||||
if(message == "")
|
||||
return
|
||||
|
||||
@@ -109,6 +120,7 @@
|
||||
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
|
||||
|
||||
on_hear_say(message_to_send)
|
||||
create_chat_message(speaker, combined["raw"], italics, list())
|
||||
|
||||
if(speech_sound && (get_dist(speaker, src) <= world.view && z == speaker.z))
|
||||
var/turf/source = speaker ? get_turf(speaker) : get_turf(src)
|
||||
@@ -164,7 +176,8 @@
|
||||
if(!client)
|
||||
return
|
||||
|
||||
var/message = combine_message(message_pieces, verb, speaker, always_stars = hard_to_hear, radio = TRUE)
|
||||
var/list/combined = combine_message(message_pieces, verb, speaker, always_stars = hard_to_hear, radio = TRUE)
|
||||
var/message = combined["formatted"]
|
||||
if(sleeping || stat == UNCONSCIOUS) //If unconscious or sleeping
|
||||
hear_sleep(message)
|
||||
return
|
||||
@@ -272,7 +285,8 @@
|
||||
return
|
||||
|
||||
/mob/proc/hear_holopad_talk(list/message_pieces, var/verb = "says", var/mob/speaker = null)
|
||||
var/message = combine_message(message_pieces, verb, speaker)
|
||||
var/list/combined = combine_message(message_pieces, verb, speaker)
|
||||
var/message = combined["formatted"]
|
||||
|
||||
var/name = speaker.name
|
||||
if(!say_understands(speaker))
|
||||
|
||||
@@ -1,55 +1,60 @@
|
||||
var/list/department_radio_keys = list(
|
||||
":r" = "right ear", ".r" = "right ear",
|
||||
":l" = "left ear", ".l" = "left ear",
|
||||
":i" = "intercom", ".i" = "intercom",
|
||||
":h" = "department", ".h" = "department",
|
||||
":+" = "special", ".+" = "special", //activate radio-specific special functions
|
||||
":c" = "Command", ".c" = "Command",
|
||||
":n" = "Science", ".n" = "Science",
|
||||
":m" = "Medical", ".m" = "Medical",
|
||||
":e" = "Engineering", ".e" = "Engineering",
|
||||
":k" = "Response Team", ".k" = "Response Team",
|
||||
":s" = "Security", ".s" = "Security",
|
||||
":w" = "whisper", ".w" = "whisper",
|
||||
":t" = "Mercenary", ".t" = "Mercenary",
|
||||
":x" = "Raider", ".x" = "Raider",
|
||||
":u" = "Supply", ".u" = "Supply",
|
||||
":v" = "Service", ".v" = "Service",
|
||||
":p" = "AI Private", ".p" = "AI Private",
|
||||
":y" = "Explorer", ".y" = "Explorer",
|
||||
":r" = "right ear", ".r" = "right ear",
|
||||
":l" = "left ear", ".l" = "left ear",
|
||||
":i" = "intercom", ".i" = "intercom",
|
||||
":h" = "department", ".h" = "department",
|
||||
":+" = "special", ".+" = "special", //activate radio-specific special functions
|
||||
":c" = "Command", ".c" = "Command",
|
||||
":n" = "Science", ".n" = "Science",
|
||||
":m" = "Medical", ".m" = "Medical",
|
||||
":e" = "Engineering", ".e" = "Engineering",
|
||||
":k" = "Response Team", ".k" = "Response Team",
|
||||
":s" = "Security", ".s" = "Security",
|
||||
":w" = "whisper", ".w" = "whisper",
|
||||
":t" = "Mercenary", ".t" = "Mercenary",
|
||||
":x" = "Raider", ".x" = "Raider",
|
||||
":u" = "Supply", ".u" = "Supply",
|
||||
":v" = "Service", ".v" = "Service",
|
||||
":p" = "AI Private", ".p" = "AI Private",
|
||||
":y" = "Explorer", ".y" = "Explorer",
|
||||
|
||||
":R" = "right ear", ".R" = "right ear",
|
||||
":L" = "left ear", ".L" = "left ear",
|
||||
":I" = "intercom", ".I" = "intercom",
|
||||
":H" = "department", ".H" = "department",
|
||||
":C" = "Command", ".C" = "Command",
|
||||
":N" = "Science", ".N" = "Science",
|
||||
":M" = "Medical", ".M" = "Medical",
|
||||
":E" = "Engineering", ".E" = "Engineering",
|
||||
":k" = "Response Team", ".k" = "Response Team",
|
||||
":S" = "Security", ".S" = "Security",
|
||||
":W" = "whisper", ".W" = "whisper",
|
||||
":T" = "Mercenary", ".T" = "Mercenary",
|
||||
":X" = "Raider", ".X" = "Raider",
|
||||
":U" = "Supply", ".U" = "Supply",
|
||||
":V" = "Service", ".V" = "Service",
|
||||
":P" = "AI Private", ".P" = "AI Private",
|
||||
":Y" = "Explorer", ".Y" = "Explorer",
|
||||
":R" = "right ear", ".R" = "right ear",
|
||||
":L" = "left ear", ".L" = "left ear",
|
||||
":I" = "intercom", ".I" = "intercom",
|
||||
":H" = "department", ".H" = "department",
|
||||
":C" = "Command", ".C" = "Command",
|
||||
":N" = "Science", ".N" = "Science",
|
||||
":M" = "Medical", ".M" = "Medical",
|
||||
":E" = "Engineering", ".E" = "Engineering",
|
||||
":k" = "Response Team", ".k" = "Response Team",
|
||||
":S" = "Security", ".S" = "Security",
|
||||
":W" = "whisper", ".W" = "whisper",
|
||||
":T" = "Mercenary", ".T" = "Mercenary",
|
||||
":X" = "Raider", ".X" = "Raider",
|
||||
":U" = "Supply", ".U" = "Supply",
|
||||
":V" = "Service", ".V" = "Service",
|
||||
":P" = "AI Private", ".P" = "AI Private",
|
||||
":Y" = "Explorer", ".Y" = "Explorer",
|
||||
|
||||
//kinda localization -- rastaf0
|
||||
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
|
||||
":�" = "right ear", ".�" = "right ear",
|
||||
":�" = "left ear", ".�" = "left ear",
|
||||
":�" = "intercom", ".�" = "intercom",
|
||||
":�" = "department", ".�" = "department",
|
||||
":�" = "Command", ".�" = "Command",
|
||||
":�" = "Science", ".�" = "Science",
|
||||
":�" = "Medical", ".�" = "Medical",
|
||||
":�" = "Engineering", ".�" = "Engineering",
|
||||
":�" = "Security", ".�" = "Security",
|
||||
":�" = "whisper", ".�" = "whisper",
|
||||
":�" = "Mercenary", ".�" = "Mercenary",
|
||||
":�" = "Supply", ".�" = "Supply",
|
||||
// Cyrillic characters on the same keys on the Russian QWERTY (phonetic) layout
|
||||
":к" = "right ear", ".к" = "right ear",
|
||||
":д" = "left ear", ".д" = "left ear",
|
||||
":ш" = "intercom", ".ш" = "intercom",
|
||||
":р" = "department", ".р" = "department",
|
||||
":+" = "special", ".+" = "special", //activate radio-specific special functions
|
||||
":с" = "Command", ".с" = "Command",
|
||||
":т" = "Science", ".т" = "Science",
|
||||
":ь" = "Medical", ".ь" = "Medical",
|
||||
":у" = "Engineering", ".у" = "Engineering",
|
||||
":л" = "Response Team", ".л" = "Response Team",
|
||||
":ы" = "Security", ".ы" = "Security",
|
||||
":ц" = "whisper", ".ц" = "whisper",
|
||||
":е" = "Mercenary", ".е" = "Mercenary",
|
||||
":ч" = "Raider", ".ч" = "Raider",
|
||||
":г" = "Supply", ".г" = "Supply",
|
||||
":м" = "Service", ".м" = "Service",
|
||||
":з" = "AI Private", ".з" = "AI Private",
|
||||
":н" = "Explorer", ".н" = "Explorer"
|
||||
)
|
||||
|
||||
|
||||
@@ -324,16 +329,17 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
|
||||
if(M && src) //If we still exist, when the spawn processes
|
||||
var/dst = get_dist(get_turf(M),get_turf(src))
|
||||
var/runechat_enabled = M.client?.is_preference_enabled(/datum/client_preference/runechat_mob)
|
||||
|
||||
if(dst <= message_range || (M.stat == DEAD && !forbid_seeing_deadchat)) //Inside normal message range, or dead with ears (handled in the view proc)
|
||||
if(M.client)
|
||||
if(M.client && !runechat_enabled)
|
||||
var/image/I1 = listening[M] || speech_bubble
|
||||
images_to_clients[I1] |= M.client
|
||||
M << I1
|
||||
M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol)
|
||||
if(whispering && !isobserver(M)) //Don't even bother with these unless whispering
|
||||
if(dst > message_range && dst <= w_scramble_range) //Inside whisper scramble range
|
||||
if(M.client)
|
||||
if(M.client && !runechat_enabled)
|
||||
var/image/I2 = listening[M] || speech_bubble
|
||||
images_to_clients[I2] |= M.client
|
||||
M << I2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,125 +1,125 @@
|
||||
/mob/living/silicon/robot/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode)
|
||||
if(!is_component_functioning("radio"))
|
||||
to_chat(src, "<span class='warning'>Your radio isn't functional at this time.</span>")
|
||||
return 0
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/speech_bubble_appearance()
|
||||
return "synthetic"
|
||||
|
||||
/mob/living/silicon/ai/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode == "department")
|
||||
return holopad_talk(message, verb, speaking)
|
||||
else if(message_mode)
|
||||
if (aiRadio.disabledAi || aiRestorePowerRoutine || stat)
|
||||
to_chat(src, "<span class='danger'>System Error - Transceiver Disabled.</span>")
|
||||
return 0
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return aiRadio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/pai/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode)
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return speak_query
|
||||
else if (ending == "!")
|
||||
return speak_exclamation
|
||||
|
||||
return speak_statement
|
||||
|
||||
#define IS_AI 1
|
||||
#define IS_ROBOT 2
|
||||
#define IS_PAI 3
|
||||
|
||||
/mob/living/silicon/say_understands(var/other, var/datum/language/speaking = null)
|
||||
//These only pertain to common. Languages are handled by mob/say_understands()
|
||||
if(!speaking)
|
||||
if(iscarbon(other))
|
||||
return TRUE
|
||||
if(issilicon(other))
|
||||
return TRUE
|
||||
if(isbrain(other))
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
//For holopads only. Usable by AI.
|
||||
/mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb)
|
||||
log_say("(HPAD) [multilingual_to_message(message_pieces)]",src)
|
||||
|
||||
var/obj/machinery/hologram/holopad/T = src.holo
|
||||
if(T && T.masters[src])//If there is a hologram and its master is the user.
|
||||
var/list/listeners = get_mobs_and_objs_in_view_fast(get_turf(T), world.view)
|
||||
var/list/listening = listeners["mobs"]
|
||||
var/list/listening_obj = listeners["objs"]
|
||||
for(var/mob/M in listening)
|
||||
M.hear_holopad_talk(message_pieces, verb, src)
|
||||
for(var/obj/O in listening_obj)
|
||||
if(O == T) //Don't recieve your own speech
|
||||
continue
|
||||
O.hear_talk(src, message_pieces, verb)
|
||||
/*Radios "filter out" this conversation channel so we don't need to account for them.
|
||||
This is another way of saying that we won't bother dealing with them.*/
|
||||
to_chat(src, "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> [combine_message(message_pieces, verb, src)]</span></i>")
|
||||
else
|
||||
to_chat(src, "No holopad connected.")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/proc/holopad_emote(var/message) //This is called when the AI uses the 'me' verb while using a holopad.
|
||||
message = trim(message)
|
||||
|
||||
if(!message)
|
||||
return
|
||||
|
||||
var/obj/machinery/hologram/holopad/T = src.holo
|
||||
if(T && T.masters[src])
|
||||
var/rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message]</span></span>"
|
||||
to_chat(src, "<i><span class='game say'>Holopad action relayed, <span class='name'>[real_name]</span> <span class='message'>[message]</span></span></i>")
|
||||
|
||||
var/obj/effect/overlay/hologram = T.masters[src]
|
||||
var/list/in_range = get_mobs_and_objs_in_view_fast(get_turf(hologram), world.view, 2) //Emotes are displayed from the hologram, not the pad
|
||||
var/list/m_viewers = in_range["mobs"]
|
||||
var/list/o_viewers = in_range["objs"]
|
||||
|
||||
for(var/mob/M in m_viewers)
|
||||
spawn(0)
|
||||
if(M)
|
||||
M.show_message(rendered, 2)
|
||||
|
||||
for(var/obj/O in o_viewers)
|
||||
if(O == T)
|
||||
continue
|
||||
spawn(0)
|
||||
if(O)
|
||||
O.see_emote(src, message)
|
||||
|
||||
log_emote("(HPAD) [message]", src)
|
||||
|
||||
else //This shouldn't occur, but better safe then sorry.
|
||||
to_chat(src, "No holopad connected.")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/emote(var/act, var/m_type, var/message)
|
||||
var/obj/machinery/hologram/holopad/T = holo
|
||||
if(T && T.masters[src]) //Is the AI using a holopad?
|
||||
. = holopad_emote(message)
|
||||
else //Emote normally, then.
|
||||
. = ..()
|
||||
|
||||
#undef IS_AI
|
||||
#undef IS_ROBOT
|
||||
#undef IS_PAI
|
||||
/mob/living/silicon/robot/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode)
|
||||
if(!is_component_functioning("radio"))
|
||||
to_chat(src, "<span class='warning'>Your radio isn't functional at this time.</span>")
|
||||
return 0
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/speech_bubble_appearance()
|
||||
return "synthetic"
|
||||
|
||||
/mob/living/silicon/ai/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode == "department")
|
||||
return holopad_talk(message, verb, speaking)
|
||||
else if(message_mode)
|
||||
if (aiRadio.disabledAi || aiRestorePowerRoutine || stat)
|
||||
to_chat(src, "<span class='danger'>System Error - Transceiver Disabled.</span>")
|
||||
return 0
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return aiRadio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/pai/handle_message_mode(message_mode, message, verb, speaking, used_radios)
|
||||
..()
|
||||
if(message_mode)
|
||||
if(message_mode == "general")
|
||||
message_mode = null
|
||||
return radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
|
||||
/mob/living/silicon/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return speak_query
|
||||
else if (ending == "!")
|
||||
return speak_exclamation
|
||||
|
||||
return speak_statement
|
||||
|
||||
#define IS_AI 1
|
||||
#define IS_ROBOT 2
|
||||
#define IS_PAI 3
|
||||
|
||||
/mob/living/silicon/say_understands(var/other, var/datum/language/speaking = null)
|
||||
//These only pertain to common. Languages are handled by mob/say_understands()
|
||||
if(!speaking)
|
||||
if(iscarbon(other))
|
||||
return TRUE
|
||||
if(issilicon(other))
|
||||
return TRUE
|
||||
if(isbrain(other))
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
//For holopads only. Usable by AI.
|
||||
/mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb)
|
||||
log_say("(HPAD) [multilingual_to_message(message_pieces)]",src)
|
||||
|
||||
var/obj/machinery/hologram/holopad/T = src.holo
|
||||
if(T && T.masters[src])//If there is a hologram and its master is the user.
|
||||
var/list/listeners = get_mobs_and_objs_in_view_fast(get_turf(T), world.view)
|
||||
var/list/listening = listeners["mobs"]
|
||||
var/list/listening_obj = listeners["objs"]
|
||||
for(var/mob/M in listening)
|
||||
M.hear_holopad_talk(message_pieces, verb, src)
|
||||
for(var/obj/O in listening_obj)
|
||||
if(O == T) //Don't recieve your own speech
|
||||
continue
|
||||
O.hear_talk(src, message_pieces, verb)
|
||||
/*Radios "filter out" this conversation channel so we don't need to account for them.
|
||||
This is another way of saying that we won't bother dealing with them.*/
|
||||
var/list/combined = combine_message(message_pieces, verb, src)
|
||||
to_chat(src, "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> [combined["formatted"]]</span></i>")
|
||||
else
|
||||
to_chat(src, "No holopad connected.")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/proc/holopad_emote(var/message) //This is called when the AI uses the 'me' verb while using a holopad.
|
||||
message = trim(message)
|
||||
|
||||
if(!message)
|
||||
return
|
||||
|
||||
var/obj/machinery/hologram/holopad/T = src.holo
|
||||
if(T && T.masters[src])
|
||||
var/rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message]</span></span>"
|
||||
to_chat(src, "<i><span class='game say'>Holopad action relayed, <span class='name'>[real_name]</span> <span class='message'>[message]</span></span></i>")
|
||||
var/obj/effect/overlay/hologram = T.masters[src]
|
||||
var/list/in_range = get_mobs_and_objs_in_view_fast(get_turf(hologram), world.view, 2) //Emotes are displayed from the hologram, not the pad
|
||||
var/list/m_viewers = in_range["mobs"]
|
||||
var/list/o_viewers = in_range["objs"]
|
||||
|
||||
for(var/mob/M in m_viewers)
|
||||
spawn(0)
|
||||
if(M)
|
||||
M.show_message(rendered, 2)
|
||||
|
||||
for(var/obj/O in o_viewers)
|
||||
if(O == T)
|
||||
continue
|
||||
spawn(0)
|
||||
if(O)
|
||||
O.see_emote(src, message)
|
||||
|
||||
log_emote("(HPAD) [message]", src)
|
||||
|
||||
else //This shouldn't occur, but better safe then sorry.
|
||||
to_chat(src, "No holopad connected.")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/emote(var/act, var/m_type, var/message)
|
||||
var/obj/machinery/hologram/holopad/T = holo
|
||||
if(T && T.masters[src]) //Is the AI using a holopad?
|
||||
. = holopad_emote(message)
|
||||
else //Emote normally, then.
|
||||
. = ..()
|
||||
|
||||
#undef IS_AI
|
||||
#undef IS_ROBOT
|
||||
#undef IS_PAI
|
||||
|
||||
+10
-3
@@ -76,7 +76,7 @@
|
||||
// message is the message output to anyone who can see e.g. "[src] does something!"
|
||||
// self_message (optional) is what the src mob sees e.g. "You do something!"
|
||||
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
|
||||
/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view)
|
||||
/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view, var/runemessage)
|
||||
if(self_message)
|
||||
if(LAZYLEN(exclude_mobs))
|
||||
exclude_mobs |= src
|
||||
@@ -86,7 +86,9 @@
|
||||
// Transfer messages about what we are doing to upstairs
|
||||
if(shadow)
|
||||
shadow.visible_message(message, self_message, blind_message, exclude_mobs, range)
|
||||
. = ..(message, blind_message, exclude_mobs, range) // Really not ideal that atom/visible_message has different arg numbering :(
|
||||
if(isnull(runemessage))
|
||||
runemessage = -1
|
||||
. = ..(message, blind_message, exclude_mobs, range, runemessage) // Really not ideal that atom/visible_message has different arg numbering :(
|
||||
|
||||
// Returns an amount of power drawn from the object (-1 if it's not viable).
|
||||
// If drain_check is set it will not actually drain power, just return a value.
|
||||
@@ -101,7 +103,7 @@
|
||||
// self_message (optional) is what the src mob hears.
|
||||
// deaf_message (optional) is what deaf people will see.
|
||||
// hearing_distance (optional) is the range, how many tiles away the message can be heard.
|
||||
/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message)
|
||||
/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message, var/runemessage)
|
||||
|
||||
var/range = hearing_distance || world.view
|
||||
var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE)
|
||||
@@ -109,6 +111,9 @@
|
||||
var/list/hearing_mobs = hear["mobs"]
|
||||
var/list/hearing_objs = hear["objs"]
|
||||
|
||||
if(isnull(runemessage))
|
||||
runemessage = -1 // Symmetry with mob/audible_message, despite the fact this one doesn't call parent. Maybe it should!
|
||||
|
||||
if(radio_message)
|
||||
for(var/obj in hearing_objs)
|
||||
var/obj/O = obj
|
||||
@@ -124,6 +129,8 @@
|
||||
if(self_message && M==src)
|
||||
msg = self_message
|
||||
M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE)
|
||||
if(runemessage != -1)
|
||||
M.create_chat_message(src, "[runemessage || message]", FALSE, list("emote"), audible = FALSE)
|
||||
|
||||
/mob/proc/findname(msg)
|
||||
for(var/mob/M in mob_list)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
"You begin climbing [direction] \the [src]!",
|
||||
"You hear the grunting and clanging of a metal ladder being used.")
|
||||
|
||||
target_ladder.audible_message("<span class='notice'>You hear something coming [direction] \the [src]</span>")
|
||||
target_ladder.audible_message("<span class='notice'>You hear something coming [direction] \the [src]</span>", runemessage = "clank clank")
|
||||
|
||||
if(do_after(M, climb_time, src))
|
||||
var/turf/T = get_turf(target_ladder)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
if(lattice)
|
||||
var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1)
|
||||
to_chat(src, "<span class='notice'>You grab \the [lattice] and start pulling yourself upward...</span>")
|
||||
destination.audible_message("<span class='notice'>You hear something climbing up \the [lattice].</span>")
|
||||
destination.audible_message("<span class='notice'>You hear something climbing up \the [lattice].</span>", runemessage = "clank clang")
|
||||
if(do_after(src, pull_up_time))
|
||||
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
|
||||
else
|
||||
@@ -74,7 +74,7 @@
|
||||
if(!destination?.Enter(src, old_dest))
|
||||
to_chat(src, "<span class='notice'>There's something in the way up above in that direction, try another.</span>")
|
||||
return 0
|
||||
destination.audible_message("<span class='notice'>You hear something climbing up \the [catwalk].</span>")
|
||||
destination.audible_message("<span class='notice'>You hear something climbing up \the [catwalk].</span>", runemessage = "clank clang")
|
||||
if(do_after(src, pull_up_time))
|
||||
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
|
||||
else
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
if(!is_on())
|
||||
return 0
|
||||
if(!check_fuel() || (use_power_oneoff(charge_per_burn) < charge_per_burn) || check_blockage())
|
||||
audible_message(src,"<span class='warning'>[src] coughs once and goes silent!</span>")
|
||||
audible_message(src,"<span class='warning'>[src] coughs once and goes silent!</span>", runemessage = "sputtercough")
|
||||
update_use_power(USE_POWER_OFF)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -71,21 +71,21 @@
|
||||
playsound(loc, "sound/machines/copier.ogg", 100, 1)
|
||||
sleep(11)
|
||||
copy(copyitem)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>")
|
||||
playsound(loc, "sound/machines/buzzbeep.ogg", 30)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>", runemessage = "whirr")
|
||||
playsound(src, "sound/machines/buzzbeep.ogg", 30)
|
||||
else if (istype(copyitem, /obj/item/weapon/photo))
|
||||
playsound(loc, "sound/machines/copier.ogg", 100, 1)
|
||||
sleep(11)
|
||||
photocopy(copyitem)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>")
|
||||
playsound(loc, "sound/machines/buzzbeep.ogg", 30)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>", runemessage = "whirr")
|
||||
playsound(src, "sound/machines/buzzbeep.ogg", 30)
|
||||
else if (istype(copyitem, /obj/item/weapon/paper_bundle))
|
||||
sleep(11)
|
||||
playsound(loc, "sound/machines/copier.ogg", 100, 1)
|
||||
var/obj/item/weapon/paper_bundle/B = bundlecopy(copyitem)
|
||||
sleep(11*B.pages.len)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>")
|
||||
playsound(loc, "sound/machines/buzzbeep.ogg", 30)
|
||||
audible_message("<span class='notice'>You can hear [src] whirring as it finishes printing.</span>", runemessage = "whirr")
|
||||
playsound(src, "sound/machines/buzzbeep.ogg", 30)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [copyitem] can't be copied by [src].</span>")
|
||||
playsound(loc, "sound/machines/buzz-two.ogg", 100)
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/phoronbore/process()
|
||||
if(generator_state && !mat_storage)
|
||||
audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."))
|
||||
audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."), runemessage = "goes quiet")
|
||||
soundloop.stop()
|
||||
generator_state = GEN_OFF
|
||||
|
||||
@@ -258,12 +258,12 @@
|
||||
soundloop.start()
|
||||
time_started = world.time
|
||||
cell?.use(100)
|
||||
audible_message(SPAN_NOTICE("\The [src] starts chugging."),SPAN_NOTICE("A motor noise starts up."))
|
||||
audible_message(SPAN_NOTICE("\The [src] starts chugging."),SPAN_NOTICE("A motor noise starts up."), runemessage = "whirr")
|
||||
generator_state = GEN_IDLE
|
||||
|
||||
else if(generator_state > GEN_OFF && time_started + 3 SECONDS < world.time)
|
||||
soundloop.stop()
|
||||
audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."))
|
||||
audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."), runemessage = "goes quiet")
|
||||
generator_state = GEN_OFF
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/phoronbore/loaded
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
visible_message("<span class='danger'>\The [src] begins to rattle, its acceleration chamber collapsing in on itself!</span>")
|
||||
removable_components = FALSE
|
||||
spawn(15)
|
||||
audible_message("<span class='critical'>\The [src]'s power supply begins to overload as the device crumples!</span>") //Why are you still holding this?
|
||||
audible_message("<span class='critical'>\The [src]'s power supply begins to overload as the device crumples!</span>", runemessage = "VWRRRRRRRR") //Why are you still holding this?
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 10, 1)
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -130,12 +130,12 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
if(2)
|
||||
if(!Console.silent)
|
||||
playsound(Console, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5)
|
||||
Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5, runemessage = "beep! beep!")
|
||||
Console.message_log += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[sender]'>[sender]</A></FONT></B><BR>[authmsg]"
|
||||
else
|
||||
if(!Console.silent)
|
||||
playsound(Console, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'Message from [sender]'"),,4)
|
||||
Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'Message from [sender]'"),,4, runemessage = "beep beep")
|
||||
Console.message_log += "<B>Message from <A href='?src=\ref[Console];write=[sender]'>[sender]</A></B><BR>[authmsg]"
|
||||
Console.set_light(2)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
continue
|
||||
if(!H.shuttle_comp || !(get_area(H) in shuttle_area))
|
||||
H.shuttle_comp = null
|
||||
H.audible_message("<span class='warning'>\The [H] pings as it loses it's connection with the ship.</span>")
|
||||
H.audible_message("<span class='warning'>\The [H] pings as it loses it's connection with the ship.</span>", runemessage = "ping")
|
||||
H.update_hud("discon")
|
||||
helmets -= H
|
||||
else
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
else // We failed to close the doors - probably, someone is blocking them; stop trying to move
|
||||
doors_closing = 0
|
||||
open_doors()
|
||||
control_panel_interior.audible_message("\The [current_floor.ext_panel] buzzes loudly.")
|
||||
control_panel_interior.audible_message("\The [current_floor.ext_panel] buzzes loudly.", runemessage = "BUZZ")
|
||||
playsound(control_panel_interior, "sound/machines/buzz-two.ogg", 50, 1)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
if(!moved) // nowhere to go....
|
||||
LM.gib()
|
||||
else // the mob is too big to just move, so we need to give up what we're doing
|
||||
audible_message("\The [src]'s motors grind as they quickly reverse direction, unable to safely close.")
|
||||
audible_message("\The [src]'s motors grind as they quickly reverse direction, unable to safely close.", runemessage = "WRRRRR")
|
||||
cur_command = null // the door will just keep trying otherwise
|
||||
return 0
|
||||
return ..()
|
||||
@@ -42,7 +42,16 @@
|
||||
user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement
|
||||
if(world.time > user.next_play_vent)
|
||||
user.next_play_vent = world.time+30
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
var/turf/T = get_turf(src)
|
||||
playsound(T, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
var/message = pick(
|
||||
prob(90);"* clunk *",
|
||||
prob(90);"* thud *",
|
||||
prob(90);"* clatter *",
|
||||
prob(1);"* <span style='font-size:2em'>ඞ</span> *"
|
||||
)
|
||||
T.runechat_message(message)
|
||||
|
||||
else
|
||||
if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && src.can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.remove_ventcrawl()
|
||||
|
||||
Reference in New Issue
Block a user