Skip to content

Commit

Permalink
Merge pull request #81 from Azarak/vorny2
Browse files Browse the repository at this point in the history
Fixes LOOC and emote for vore
  • Loading branch information
TheGreatKitsune authored Nov 22, 2024
2 parents e8c8c89 + d723895 commit 12d5ca4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
29 changes: 23 additions & 6 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ GLOBAL_VAR_INIT(mobids, 1)
continue
//This entire if/else chain could be in two lines but isn't for readibilties sake.
var/msg = message
if(M.see_invisible < invisibility)//if src is invisible to M
msg = blind_message
else if(T != loc && T != src) //if src is inside something and not a turf.
msg = blind_message
// else if(T.lighting_object && T.lighting_object.invisibility <= M.see_invisible && T.is_softly_lit()) //if it is too dark.
// msg = blind_message
/// Visible messages are shown to things which contain them and vice versa, mostly to help with vore system UX. Also - dont hide msg from self
if(!in_contents_recursive(src, M) && !in_contents_recursive(M, src) && M != src)
if(M.see_invisible < invisibility)//if src is invisible to M
msg = blind_message
else if(T != loc && T != src) //if src is inside something and not a turf.
msg = blind_message
//else if(T.lighting_object && T.lighting_object.invisibility <= M.see_invisible && T.is_softly_lit()) //if it is too dark.
// msg = blind_message
if(!msg)
continue
M.show_message(msg, MSG_VISUAL, blind_message, MSG_AUDIBLE)
Expand All @@ -221,6 +223,21 @@ GLOBAL_VAR_INIT(mobids, 1)
if(log_seen)
log_seen(src, null, hearers, (log_seen_msg ? log_seen_msg : message), log_seen)

/// Checks whether `thing` is somewhere inside `target`
/proc/in_contents_recursive(atom/movable/thing, atom/movable/target)
var/atom/location = thing.loc
/// Theoretically a while(TRUE) but it's an i++ to 100 for safety
for(var/i in 1 to 100)
if(isnull(location))
break
if(isturf(location))
break
if(location == target)
return TRUE
else
location = location.loc
return FALSE

///Adds the functionality to self_message.
/mob/visible_message(message, self_message, blind_message, vision_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, runechat_message = null, log_seen = NONE, log_seen_msg = null)
. = ..()
Expand Down
6 changes: 4 additions & 2 deletions modular_hearthstone/code/interface/LOOC.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
mob.log_talk(msg, LOG_LOOC)

var/prefix = "LOOC"
for(var/mob/M in range(7,src))
for(var/mob/M in get_hearers_in_view(7, mob))
var/client/C = M.client
if(M == mob)
continue
if(!M.client)
continue
if (isobserver(M))
continue //Also handled later.

if(C.prefs.chat_toggles & CHAT_OOC)
to_chat(C, "<font color='["#6699CC"]'><b><span class='prefix'>[prefix]:</span> <EM>[src.mob.name]:</EM> <span class='message'>[msg]</span></b></font>")
to_chat(usr, "<font color='["#6699CC"]'><b><span class='prefix'>[prefix]:</span> <EM>[src.mob.name]:</EM> <span class='message'>[msg]</span></b></font>")
to_chat(usr, "<font color='["#6699CC"]'><b><span class='prefix'>[prefix]:</span> <EM>[src.mob.name]:</EM> <span class='message'>[msg]</span></b></font>")

0 comments on commit 12d5ca4

Please sign in to comment.