mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-01-28 18:02:17 +00:00
Port Runechat
This commit is contained in:
@@ -324,8 +324,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!
|
||||
|
||||
@@ -76,3 +76,6 @@
|
||||
var/connection_realtime
|
||||
///world.timeofday they connected
|
||||
var/connection_timeofday
|
||||
|
||||
// Runechat messages
|
||||
var/list/seen_messages = list()
|
||||
|
||||
@@ -290,6 +290,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)
|
||||
|
||||
@@ -86,7 +86,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
|
||||
@@ -164,9 +165,13 @@
|
||||
input = message
|
||||
|
||||
var/list/formatted
|
||||
var/runemessage
|
||||
if(input)
|
||||
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
|
||||
|
||||
@@ -194,6 +199,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
|
||||
|
||||
@@ -116,6 +116,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)
|
||||
|
||||
@@ -40,18 +40,18 @@ var/list/department_radio_keys = list(
|
||||
|
||||
//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",
|
||||
":<EFBFBD>" = "right ear", ".<EFBFBD>" = "right ear",
|
||||
":<EFBFBD>" = "left ear", ".<EFBFBD>" = "left ear",
|
||||
":<EFBFBD>" = "intercom", ".<EFBFBD>" = "intercom",
|
||||
":<EFBFBD>" = "department", ".<EFBFBD>" = "department",
|
||||
":<EFBFBD>" = "Command", ".<EFBFBD>" = "Command",
|
||||
":<EFBFBD>" = "Science", ".<EFBFBD>" = "Science",
|
||||
":<EFBFBD>" = "Medical", ".<EFBFBD>" = "Medical",
|
||||
":<EFBFBD>" = "Engineering", ".<EFBFBD>" = "Engineering",
|
||||
":<EFBFBD>" = "Security", ".<EFBFBD>" = "Security",
|
||||
":<EFBFBD>" = "whisper", ".<EFBFBD>" = "whisper",
|
||||
":<EFBFBD>" = "Mercenary", ".<EFBFBD>" = "Mercenary",
|
||||
":<EFBFBD>" = "Supply", ".<EFBFBD>" = "Supply",
|
||||
)
|
||||
|
||||
|
||||
@@ -362,16 +362,17 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
//VOREStation Add End
|
||||
|
||||
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
|
||||
|
||||
@@ -77,7 +77,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
|
||||
@@ -87,7 +87,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.
|
||||
@@ -102,7 +104,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)
|
||||
@@ -110,6 +112,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
|
||||
@@ -125,6 +130,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)
|
||||
|
||||
@@ -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