adds EMOTE_BOTH and EMOTE_OMNI which is both audible/visible and ignores checks entirely. subtler/subtle is omni and regular emotes are both. (#13584)
* Update say.dm * Update mob.dm * Update emotes.dm * Update say_vr.dm * Update emote.dm * Update emotes.dm * Update mob.dm * Update say_vr.dm * Update drake.dm
This commit is contained in:
@@ -443,6 +443,7 @@
|
||||
key = "me"
|
||||
key_third_person = "custom"
|
||||
message = null
|
||||
emote_type = EMOTE_BOTH
|
||||
|
||||
/datum/emote/living/custom/proc/check_invalid(mob/user, input)
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
@@ -462,24 +463,12 @@
|
||||
else if(!params)
|
||||
var/custom_emote = stripped_multiline_input_or_reflect(user, "Choose an emote to display.", "Custom Emote", null, MAX_MESSAGE_LEN)
|
||||
if(custom_emote && !check_invalid(user, custom_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
if("Visible")
|
||||
emote_type = EMOTE_VISIBLE
|
||||
if("Hearable")
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = custom_emote
|
||||
else
|
||||
message = params
|
||||
if(type_override)
|
||||
emote_type = type_override
|
||||
message = user.say_emphasis(message)
|
||||
. = ..()
|
||||
message = null
|
||||
emote_type = EMOTE_VISIBLE
|
||||
|
||||
/datum/emote/living/custom/replace_pronoun(mob/user, message)
|
||||
return message
|
||||
|
||||
@@ -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)
|
||||
/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)
|
||||
if(swooping & SWOOP_INVULNERABLE) //to suppress attack messages without overriding every single proc that could send a message saying we got hit
|
||||
return
|
||||
return ..()
|
||||
|
||||
+22
-12
@@ -127,8 +127,9 @@
|
||||
* * ignored_mobs (optional) doesn't show any message to any given mob in the list.
|
||||
* * target (optional) is the other mob involved with the visible message. For example, the attacker in many combat messages.
|
||||
* * 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)
|
||||
/atom/proc/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, ignored_mobs, mob/target, target_message, omni = FALSE)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
@@ -139,20 +140,26 @@
|
||||
|
||||
if(target_message && target && istype(target) && target.client)
|
||||
hearers -= target
|
||||
//This entire if/else chain could be in two lines but isn't for readibilties sake.
|
||||
var/msg = target_message
|
||||
if(target.see_invisible<invisibility) //if src is invisible to us,
|
||||
msg = blind_message
|
||||
//the light object is dark and not invisible to us, darkness does not matter if you're directly next to the target
|
||||
else if(T.lighting_object && T.lighting_object.invisibility <= target.see_invisible && T.is_softly_lit() && !in_range(T,target))
|
||||
msg = blind_message
|
||||
if(msg)
|
||||
target.show_message(msg, MSG_VISUAL,blind_message, MSG_AUDIBLE)
|
||||
if(omni)
|
||||
target.show_message(target_message)
|
||||
else
|
||||
//This entire if/else chain could be in two lines but isn't for readibilties sake.
|
||||
var/msg = target_message
|
||||
if(target.see_invisible<invisibility) //if src is invisible to us,
|
||||
msg = blind_message
|
||||
//the light object is dark and not invisible to us, darkness does not matter if you're directly next to the target
|
||||
else if(T.lighting_object && T.lighting_object.invisibility <= target.see_invisible && T.is_softly_lit() && !in_range(T,target))
|
||||
msg = blind_message
|
||||
if(msg)
|
||||
target.show_message(msg, MSG_VISUAL,blind_message, MSG_AUDIBLE)
|
||||
if(self_message)
|
||||
hearers -= src
|
||||
for(var/mob/M in hearers)
|
||||
if(!M.client)
|
||||
continue
|
||||
if(omni)
|
||||
M.show_message(message)
|
||||
continue
|
||||
//This entire if/else chain could be in two lines but isn't for readibilties sake.
|
||||
var/msg = message
|
||||
//CITADEL EDIT, required for vore code to remove (T != loc && T != src)) as a check
|
||||
@@ -167,10 +174,13 @@
|
||||
M.show_message(msg, MSG_VISUAL,blind_message, MSG_AUDIBLE)
|
||||
|
||||
///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)
|
||||
/mob/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, mob/target, target_message, omni = FALSE)
|
||||
. = ..()
|
||||
if(self_message && target != src)
|
||||
show_message(self_message, MSG_VISUAL, blind_message, MSG_AUDIBLE)
|
||||
if(!omni)
|
||||
show_message(self_message, MSG_VISUAL, blind_message, MSG_AUDIBLE)
|
||||
else
|
||||
show_message(self_message)
|
||||
|
||||
/**
|
||||
* Show a message to all mobs in earshot of this atom
|
||||
|
||||
@@ -39,15 +39,6 @@ proc/get_top_level_mob(var/mob/S)
|
||||
else if(!params)
|
||||
var/subtle_emote = stripped_multiline_input_or_reflect(user, "Choose an emote to display.", "Subtle", null, MAX_MESSAGE_LEN)
|
||||
if(subtle_emote && !check_invalid(user, subtle_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
if("Visible")
|
||||
emote_type = EMOTE_VISIBLE
|
||||
if("Hearable")
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = subtle_emote
|
||||
else
|
||||
return FALSE
|
||||
@@ -69,11 +60,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
|
||||
M.show_message(message)
|
||||
|
||||
if(emote_type == EMOTE_AUDIBLE)
|
||||
user.audible_message(message=message,hearing_distance=1)
|
||||
else
|
||||
user.visible_message(message=message,self_message=message,vision_distance=1)
|
||||
|
||||
user.visible_message(message = message, self_message = message, vision_distance = 1, omni = TRUE)
|
||||
|
||||
///////////////// SUBTLE 2: NO GHOST BOOGALOO
|
||||
|
||||
@@ -122,10 +109,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
user.log_message(message, LOG_SUBTLER)
|
||||
message = "<b>[user]</b> " + "<i>[user.say_emphasis(message)]</i>"
|
||||
|
||||
if(emote_type == EMOTE_AUDIBLE)
|
||||
user.audible_message(message=message,hearing_distance=1, ignored_mobs = GLOB.dead_mob_list)
|
||||
else
|
||||
user.visible_message(message=message,self_message=message,vision_distance=1, ignored_mobs = GLOB.dead_mob_list)
|
||||
user.visible_message(message = message, self_message = message, vision_distance = 1, ignored_mobs = GLOB.dead_mob_list, omni = TRUE)
|
||||
|
||||
///////////////// VERB CODE
|
||||
/mob/living/verb/subtle()
|
||||
|
||||
Reference in New Issue
Block a user