mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-06 07:23:16 +00:00
Merge pull request #1926 from VOREStation/emotes
Rewrites Emotes + LOOC and makes Communicators work
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// All mobs should have custom emote, really..
|
||||
//m_type == 1 --> visual.
|
||||
//m_type == 2 --> audible
|
||||
/mob/proc/custom_emote(var/m_type=1,var/message = null)
|
||||
/mob/proc/custom_emote(var/m_type=1,var/message = null,var/range=world.view)
|
||||
if(stat || !use_me && usr == src)
|
||||
src << "You are unable to emote."
|
||||
return
|
||||
@@ -23,42 +23,23 @@
|
||||
if (message)
|
||||
log_emote("[name]/[key] : [message]")
|
||||
|
||||
//Hearing gasp and such every five seconds is not good emotes were not global for a reason.
|
||||
// Hearing gasp and such every five seconds is not good emotes were not global for a reason.
|
||||
// Maybe some people are okay with that.
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if (!M.client)
|
||||
continue //skip monkeys and leavers
|
||||
if (istype(M, /mob/new_player))
|
||||
continue
|
||||
if(findtext(message," snores.")) //Because we have so many sleeping people.
|
||||
break
|
||||
if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_sight) && !(M in viewers(src,null)))
|
||||
M.show_message(message, m_type)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T) return
|
||||
var/list/in_range = get_mobs_and_objs_in_view_fast(T,range,2)
|
||||
var/list/m_viewers = in_range["mobs"]
|
||||
var/list/o_viewers = in_range["objs"]
|
||||
|
||||
if (m_type & 1)
|
||||
var/list/see = get_mobs_or_objects_in_view(world.view,src) | viewers(get_turf(src), null)
|
||||
for(var/I in see)
|
||||
if(isobj(I))
|
||||
spawn(0)
|
||||
if(I) //It's possible that it could be deleted in the meantime.
|
||||
var/obj/O = I
|
||||
O.see_emote(src, message, 1)
|
||||
else if(ismob(I))
|
||||
var/mob/M = I
|
||||
M.show_message(message, 1)
|
||||
|
||||
else if (m_type & 2)
|
||||
var/list/hear = get_mobs_or_objects_in_view(world.view,src)
|
||||
for(var/I in hear)
|
||||
if(isobj(I))
|
||||
spawn(0)
|
||||
if(I) //It's possible that it could be deleted in the meantime.
|
||||
var/obj/O = I
|
||||
O.see_emote(src, message, 2)
|
||||
else if(ismob(I))
|
||||
var/mob/M = I
|
||||
M.show_message(message, 2)
|
||||
for(var/mob/M in m_viewers)
|
||||
spawn(0) // It's possible that it could be deleted in the meantime, or that it runtimes.
|
||||
if(M)
|
||||
M.show_message(message, m_type)
|
||||
for(var/obj/O in o_viewers)
|
||||
spawn(0)
|
||||
if(O)
|
||||
O.see_emote(src, message, m_type)
|
||||
|
||||
/mob/proc/emote_dead(var/message)
|
||||
|
||||
|
||||
@@ -42,12 +42,9 @@
|
||||
// Parameters: None
|
||||
// Description: Adds a static overlay to the client's screen.
|
||||
/mob/living/voice/Login()
|
||||
var/obj/screen/static_effect = new() //Since what the player sees is essentially a video feed, from a vast distance away, the view isn't going to be perfect.
|
||||
static_effect.screen_loc = ui_entire_screen
|
||||
static_effect.icon = 'icons/effects/static.dmi'
|
||||
static_effect.icon_state = "1 light"
|
||||
static_effect.mouse_opacity = 0 //So the static doesn't get in the way of clicking.
|
||||
client.screen.Add(static_effect)
|
||||
..()
|
||||
client.screen |= global_hud.whitense
|
||||
client.screen |= global_hud.darkMask
|
||||
|
||||
// Proc: Destroy()
|
||||
// Parameters: None
|
||||
@@ -110,7 +107,7 @@
|
||||
// Proc: say()
|
||||
// Parameters: 4 (generic say() arguments)
|
||||
// Description: Adds a speech bubble to the communicator device, then calls ..() to do the real work.
|
||||
/mob/living/voice/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="")
|
||||
/mob/living/voice/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/whispering=0)
|
||||
//Speech bubbles.
|
||||
if(comm)
|
||||
var/speech_bubble_test = say_test(message)
|
||||
@@ -122,4 +119,8 @@
|
||||
M << speech_bubble
|
||||
src << speech_bubble
|
||||
|
||||
..(message, speaking, verb, alt_name) //mob/living/say() can do the actual talking.
|
||||
..(message, speaking, verb, alt_name, whispering) //mob/living/say() can do the actual talking.
|
||||
|
||||
/mob/living/voice/custom_emote(var/m_type=1,var/message = null,var/range=world.view)
|
||||
if(!comm) return
|
||||
..(m_type,message,comm.video_range)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = tool
|
||||
user.visible_message("<span class='notice'>[user] has attached [target]'s [E.name] to the [E.amputation_point].</span>>", \
|
||||
user.visible_message("<span class='notice'>[user] has attached [target]'s [E.name] to the [E.amputation_point].</span>", \
|
||||
"<span class='notice'>You have attached [target]'s [E.name] to the [E.amputation_point].</span>")
|
||||
user.drop_from_inventory(E)
|
||||
E.replaced(target)
|
||||
|
||||
Reference in New Issue
Block a user