fixes some stuff about emotes *damn skyrat!*

This commit is contained in:
SandPoot
2020-11-07 03:42:11 -03:00
parent e97a0dd678
commit 13ee99be77
8 changed files with 24 additions and 86 deletions
+4 -4
View File
@@ -69,13 +69,13 @@
M.show_message(dchatmsg) //SKYRAT CHANGE
if(emote_type == EMOTE_AUDIBLE)
user.audible_message(msg, runechat_popup = chat_popup)
user.audible_message(dchatmsg, runechat_popup = chat_popup, rune_msg = msg)
else if(emote_type == EMOTE_VISIBLE)
user.visible_message(msg, runechat_popup = chat_popup)
user.visible_message(dchatmsg, runechat_popup = chat_popup, rune_msg = msg)
else if(emote_type == EMOTE_BOTH)
user.visible_message(msg, blind_message = msg, runechat_popup = chat_popup)
user.visible_message(dchatmsg, blind_message = msg, runechat_popup = chat_popup, rune_msg = msg)
else if(emote_type == EMOTE_OMNI)
user.visible_message(msg, omni = TRUE, runechat_popup = chat_popup)
user.visible_message(dchatmsg, omni = TRUE, runechat_popup = chat_popup, rune_msg = msg)
//Skyrat change
if(image_popup)
flick_emote_popup_on_mob(user, image_popup, 40)
+1 -3
View File
@@ -270,7 +270,6 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
show_message(message, MSG_AUDIBLE, deaf_message, deaf_type)
return message
/*****moved to modular_skyrat*******
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, message_mode)
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
@@ -321,8 +320,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/animate_speechbubble, I, speech_bubble_recipients, 30) //skyrat-edit
********/
INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, speech_bubble_recipients, 30)
/mob/proc/binarycheck()
return FALSE
@@ -87,7 +87,7 @@ Difficulty: Medium
return FALSE
return ..()
/mob/living/simple_animal/hostile/megafauna/dragon/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup)
/mob/living/simple_animal/hostile/megafauna/dragon/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup, rune_msg)
if(swooping & SWOOP_INVULNERABLE) //to suppress attack messages without overriding every single proc that could send a message saying we got hit
return
return ..()
+16 -16
View File
@@ -129,11 +129,10 @@
* * target_message (optional) is what the target mob will see e.g. "[src] does something to you!"
* * omni (optional) if TRUE, will show to users no matter what.
*/
/atom/proc/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup)
/atom/proc/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup, rune_msg)
var/turf/T = get_turf(src)
if(!T)
return
var/final_msg = !(src == null) ? "<b>[src]</b> " + message : "<b>Unknown</b> " + message //SKYRAT CHANGE
var/list/hearers = get_hearers_in_view(vision_distance, src) //caches the hearers and then removes ignored mobs.
if(!length(hearers))
return
@@ -172,20 +171,22 @@
msg = blind_message
if(!msg)
continue
if (runechat_popup && M.client?.prefs.chat_on_map && (M.client.prefs.see_chat_non_mob || ismob(src)) && M.client.prefs.see_chat_emotes) //SKYRAT CHANGE
M.create_chat_message(src, null, msg, list("emote", "italics"), null) //Skyrat change
M.show_message(final_msg, MSG_VISUAL, blind_message, MSG_AUDIBLE) //SKYRAT CHANGE
if(runechat_popup && M.client?.prefs.chat_on_map && (M.client.prefs.see_chat_non_mob || ismob(src)) && M.client.prefs.see_chat_emotes) //SKYRAT CHANGE
M.create_chat_message(src, null, rune_msg ? rune_msg : msg, list("emote", "italics"), null) //Skyrat change
M.show_message(msg, MSG_VISUAL, blind_message, MSG_AUDIBLE) //SKYRAT CHANGE
///Adds the functionality to self_message.
/mob/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup)
/mob/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni = FALSE, runechat_popup, rune_msg)
. = ..()
if(self_message && target != src)
if(!omni)
show_message(self_message, MSG_VISUAL, blind_message, MSG_AUDIBLE)
if(runechat_popup && client?.prefs.chat_on_map && client.prefs.see_chat_emotes) //SKYRAT CHANGE
create_chat_message(src, null, self_message, list("emote", "italics"), null) //Skyrat change
create_chat_message(src, null, rune_msg ? rune_msg : self_message, list("emote", "italics"), null) //Skyrat change
else
show_message(self_message)
if(runechat_popup && client?.prefs.chat_on_map && client.prefs.see_chat_emotes) //SKYRAT CHANGE
create_chat_message(src, null, rune_msg ? rune_msg : self_message, list("emote", "italics"), null) //Skyrat change
/**
* Show a message to all mobs in earshot of this atom
@@ -198,11 +199,10 @@
* * hearing_distance (optional) is the range, how many tiles away the message can be heard.
* * ignored_mobs (optional) doesn't show any message to any given mob in the list.
*/
/atom/proc/audible_message(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, self_message, ignored_mobs, user_msg, runechat_popup) //SKYRAT CHANGE
/atom/proc/audible_message(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, self_message, ignored_mobs, runechat_popup, rune_msg) //SKYRAT CHANGE
var/turf/T = get_turf(src)
if(!T)
return
var/final_msg = user_msg ? "<b>[src]</b> " + message : message //SKYRAT CHANGE
var/list/hearers = get_hearers_in_view(hearing_distance, src)
if(!length(hearers))
return
@@ -210,9 +210,9 @@
if(self_message)
hearers -= src
for(var/mob/M in hearers)
if (runechat_popup && M.client?.prefs.chat_on_map && (M.client.prefs.see_chat_non_mob || ismob(src)) && M.client.prefs.see_chat_emotes) //SKYRAT CHANGE
M.create_chat_message(src, null, message, list("emote", "italics"), null) //Skyrat change
M.show_message(final_msg, MSG_AUDIBLE, deaf_message, MSG_VISUAL) //SKYRAT CHANGE
if(runechat_popup && M.client?.prefs.chat_on_map && (M.client.prefs.see_chat_non_mob || ismob(src)) && M.client.prefs.see_chat_emotes) //SKYRAT CHANGE
M.create_chat_message(src, null, rune_msg ? rune_msg : message, list("emote", "italics"), null) //Skyrat change
M.show_message(message, MSG_AUDIBLE, deaf_message, MSG_VISUAL) //SKYRAT CHANGE
/**
* Show a message to all mobs in earshot of this one
@@ -226,12 +226,12 @@
* * hearing_distance (optional) is the range, how many tiles away the message can be heard.
* * ignored_mobs (optional) doesn't show any message to any given mob in the list.
*/
/mob/audible_message(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, self_message, list/ignored_mobs, user_msg, runechat_popup) //SKYRAT CHANGE
/mob/audible_message(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, self_message, list/ignored_mobs, runechat_popup, rune_msg) //SKYRAT CHANGE
. = ..()
if(self_message)
if (runechat_popup && client?.prefs.chat_on_map && client.prefs.see_chat_emotes) //SKYRAT CHANGE
create_chat_message(src, null, self_message, list("emote", "italics"), null) //Skyrat change
show_message(user_msg ? "<b>[src]</b> " + self_message : self_message, MSG_AUDIBLE, deaf_message, MSG_VISUAL)
if(runechat_popup && client?.prefs.chat_on_map && client.prefs.see_chat_emotes) //SKYRAT CHANGE
create_chat_message(src, null, rune_msg ? rune_msg : self_message, list("emote", "italics"), null) //Skyrat change
show_message(self_message, MSG_AUDIBLE, deaf_message, MSG_VISUAL)
/mob/proc/get_item_by_slot(slot_id)
return null
+1 -1
View File
@@ -43,7 +43,7 @@
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
if(length(message) > MAX_MESSAGE_LEN)
to_chat(usr, message)
to_chat(usr, "<span class='danger'>^^^----- The preceeding message has been DISCARDED for being over the maximum length of [MAX_MESSAGE_LEN]. It has NOT been sent! -----^^^</span>")
-59
View File
@@ -1,59 +0,0 @@
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, message_mode)
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
if(eavesdropping_modes[message_mode])
eavesdrop_range = EAVESDROP_EXTRA_RANGE
var/list/listening = get_hearers_in_view(message_range+eavesdrop_range, source)
var/list/the_dead = list()
var/list/dead_away = list()
var/list/yellareas //CIT CHANGE - adds the ability for yelling to penetrate walls and echo throughout areas
if(!eavesdrop_range && say_test(message) == "2") //CIT CHANGE - ditto
yellareas = get_areas_in_range(message_range*0.5, source) //CIT CHANGE - ditto
for(var/_M in GLOB.player_list)
var/mob/M = _M
if(M.stat != DEAD) //not dead, not important
if(yellareas) //CIT CHANGE - see above. makes yelling penetrate walls
var/area/A = get_area(M) //CIT CHANGE - ditto
if(istype(A) && A.ambientsounds != SPACE && (A in yellareas)) //CIT CHANGE - ditto
listening |= M //CIT CHANGE - ditto
continue
if(!M.client || !client) //client is so that ghosts don't have to listen to mice
continue
if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing
if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
continue
if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
continue
dead_away[M] = TRUE
listening |= M
the_dead[M] = TRUE
var/eavesdropping
var/eavesrendered
if(eavesdrop_range)
eavesdropping = stars(message)
eavesrendered = compose_message(src, message_language, eavesdropping, null, spans, message_mode, FALSE, source)
var/rendered = compose_message(src, message_language, message, null, spans, message_mode, FALSE, source)
for(var/_AM in listening)
var/atom/movable/AM = _AM
if(!(the_dead[AM]))
if(eavesdrop_range && get_dist(source, AM) > message_range)
AM.Hear(eavesrendered, src, message_language, eavesdropping, null, spans, message_mode, source)
else
AM.Hear(rendered, src, message_language, message, null, spans, message_mode, source)
else if (dead_away[AM] && istype(AM, /mob/dead/observer))
var/mob/dead/observer/O = AM
O.HearNoPopup(rendered, src, message_language, message, null, spans, message_mode, source)
else
AM.Hear(rendered, src, message_language, message, null, spans, message_mode, source)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LIVING_SAY_SPECIAL, src, message)
//speech bubble
var/list/speech_bubble_recipients = list()
for(var/mob/M in listening)
if(M.client && !M.client.prefs.chat_on_map) //Skyrat change
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/animate_speechbubble, I, speech_bubble_recipients, 30) //skyrat-edit
@@ -334,7 +334,7 @@ Difficulty: Medium
return FALSE
return ..()
/mob/living/simple_animal/hostile/megafauna/dragon/hard/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni, runechat_popup) //SKYRAT EDIT
/mob/living/simple_animal/hostile/megafauna/dragon/hard/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni, runechat_popup, rune_msg) //SKYRAT EDIT
if(swooping & SWOOP_INVULNERABLE) //to suppress attack messages without overriding every single proc that could send a message saying we got hit
return
return ..()
-1
View File
@@ -3765,7 +3765,6 @@
#include "sandcode\code\modules\mob\dead\observer\observer.dm"
#include "sandcode\code\modules\mob\living\combat_indicator.dm"
#include "sandcode\code\modules\mob\living\emote.dm"
#include "sandcode\code\modules\mob\living\say.dm"
#include "sandcode\code\modules\mob\living\ssd_indicator.dm"
#include "sandcode\code\modules\mob\living\typing_indicator_overrides.dm"
#include "sandcode\code\modules\mob\living\carbon\carbon.dm"