Yet another emote fix PR wew (#18937)

* pAI emotes

* Nobody saw that

* Forgot the brains
This commit is contained in:
ShiftyRail
2018-07-22 20:58:32 +02:00
committed by jknpj
parent 7d3124ce91
commit 168369e78d
4 changed files with 51 additions and 7 deletions

View File

@@ -58,13 +58,20 @@
if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
M.show_message(msg)
var/turf/T = get_turf(user) // for pAIs
var/broadcast = T ? T : user
if (emote_type == EMOTE_VISIBLE)
for(var/mob/O in viewers(user))
for(var/mob/O in viewers(broadcast))
O.show_message(msg, emote_type)
if (!(user in viewers(broadcast)))
user.show_message(msg, emote_type)
else
for(var/mob/O in hearers(user))
for(var/mob/O in hearers(broadcast))
O.show_message(msg, emote_type)
var/turf/T = get_turf(user)
if (!(user in hearers(broadcast)))
user.show_message(msg, emote_type)
var/location = T ? "[T.x],[T.y],[T.z]" : "nullspace"
log_emote("[user.name]/[user.key] (@[location]): [message]")
@@ -162,4 +169,4 @@
emote("coughs")
/mob/proc/audible_scream()
emote("screams")
emote("screams", TRUE) // So it's forced

View File

@@ -53,15 +53,23 @@
/datum/emote/me/run_emote(mob/user, params, m_type)
var/msg = "<b>[user]</b> " + params
var/turf/T = get_turf(user) // for pAIs
var/broadcast = T ? T : user
switch (m_type)
if (EMOTE_VISIBLE)
user.visible_message(msg)
for(var/mob/O in viewers(broadcast))
O.show_message(msg, emote_type)
if (!(user in viewers(broadcast)))
user.show_message(msg, emote_type)
if (EMOTE_AUDIBLE)
for(var/mob/O in hearers(user))
for(var/mob/O in hearers(broadcast))
O.show_message(msg, m_type)
if (!(user in viewers(broadcast)))
user.show_message(msg, emote_type)
var/turf/T = get_turf(user)
var/location = T ? "[T.x],[T.y],[T.z]" : "nullspace"
log_emote("[user.name]/[user.key] (@[location]): [message]")

View File

@@ -15,24 +15,29 @@
message = "bows."
message_param = "bows to %t."
restraint_check = TRUE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/burp
key = "burp"
key_third_person = "burps"
message = "burps."
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/choke
key = "choke"
key_third_person = "chokes"
message = "chokes!"
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/cross
key = "cross"
key_third_person = "crosses"
message = "crosses their arms."
message_mommi = "crosses their utility arms."
restraint_check = TRUE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai)
/datum/emote/living/chuckle
key = "chuckle"
@@ -45,6 +50,7 @@
key_third_person = "collapses"
message = "collapses!"
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/collapse/run_emote(mob/user, params)
. = ..()
@@ -57,12 +63,14 @@
key_third_person = "coughs"
message = "coughs!"
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/dance
key = "dance"
key_third_person = "dances"
message = "dances around happily."
restraint_check = TRUE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/deathgasp
key = "deathgasp"
@@ -85,11 +93,13 @@
key = "drool"
key_third_person = "drools"
message = "drools."
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/faint
key = "faint"
key_third_person = "faints"
message = "faints."
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/faint/run_emote(mob/user, params)
. = ..()
@@ -128,6 +138,7 @@
key_third_person = "gags"
message = "gags."
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/gasp
key = "gasp"
@@ -135,6 +146,7 @@
message = "gasps!"
emote_type = EMOTE_AUDIBLE
stat_allowed = UNCONSCIOUS
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/giggle
key = "giggle"
@@ -161,6 +173,7 @@
key_third_person = "groans"
message = "groans!"
message_mime = "appears to groan!"
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/grimace
key = "grimace"
@@ -172,6 +185,7 @@
key_third_person = "jumps"
message = "jumps!"
restraint_check = TRUE
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/kiss
key = "kiss"
@@ -247,6 +261,7 @@
key = "sit"
key_third_person = "sits"
message = "sits down."
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/smile
key = "smile"
@@ -269,6 +284,7 @@
key_third_person = "sniffs"
message = "sniffs."
emote_type = EMOTE_AUDIBLE
mob_type_blacklist_typelist = list(/mob/living/silicon, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/snore
key = "snore"
@@ -288,6 +304,7 @@
key = "stretch"
key_third_person = "stretches"
message = "stretches their arms."
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/sulk
key = "sulk"
@@ -310,6 +327,7 @@
key = "sway"
key_third_person = "sways"
message = "sways around dizzily."
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/tremble
key = "tremble"
@@ -335,6 +353,7 @@
key_third_person = "whimpers"
message = "whimpers."
message_mime = "appears hurt."
mob_type_blacklist_typelist = list(/mob/living/silicon/pai, /mob/living/simple_animal/slime, /mob/living/carbon/brain)
/datum/emote/living/wsmile
key = "wsmile"

View File

@@ -2,14 +2,19 @@
mob_type_allowed_typelist = list(/mob/living/silicon)
emote_type = EMOTE_AUDIBLE
var/module_quirk_required
var/pai_software_required
/datum/emote/sound/silicon
mob_type_allowed_typelist = list(/mob/living/silicon)
emote_type = EMOTE_AUDIBLE
var/module_quirk_required
var/pai_software_required
/datum/emote/sound/silicon/can_run_emote(var/mob/user, var/status_check = TRUE)
. = ..()
var/mob/living/silicon/pai/the_pai = user
if (. && istype(the_pai) && (!pai_software_required || (pai_software_required in the_pai.software)))
return TRUE
var/mob/living/silicon/robot/R = user
if (!istype(R))
return FALSE
@@ -18,6 +23,9 @@
/datum/emote/silicon/can_run_emote(var/mob/user, var/status_check = TRUE)
. = ..()
var/mob/living/silicon/pai/the_pai = user
if (. && istype(the_pai) && (!pai_software_required || (pai_software_required in the_pai.software)))
return TRUE
var/mob/living/silicon/robot/R = user
if (!istype(R))
return FALSE
@@ -92,12 +100,14 @@
message = "shows its legal authorization barcode."
sound = 'sound/voice/biamthelaw.ogg'
module_quirk_required = MODULE_IS_THE_LAW
pai_software_required = SOFT_SS
/datum/emote/sound/silicon/halt
key = "halt"
message = "'s speakers screech. \"Halt! Security!\"."
sound = 'sound/voice/halt.ogg'
module_quirk_required = MODULE_IS_THE_LAW
pai_software_required = SOFT_SS
/mob/living/silicon/robot/verb/powerwarn()
set category = "Robot Commands"