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))) if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
M.show_message(msg) M.show_message(msg)
var/turf/T = get_turf(user) // for pAIs
var/broadcast = T ? T : user
if (emote_type == EMOTE_VISIBLE) 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) O.show_message(msg, emote_type)
if (!(user in viewers(broadcast)))
user.show_message(msg, emote_type)
else else
for(var/mob/O in hearers(user)) for(var/mob/O in hearers(broadcast))
O.show_message(msg, emote_type) 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" var/location = T ? "[T.x],[T.y],[T.z]" : "nullspace"
log_emote("[user.name]/[user.key] (@[location]): [message]") log_emote("[user.name]/[user.key] (@[location]): [message]")
@@ -162,4 +169,4 @@
emote("coughs") emote("coughs")
/mob/proc/audible_scream() /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) /datum/emote/me/run_emote(mob/user, params, m_type)
var/msg = "<b>[user]</b> " + params var/msg = "<b>[user]</b> " + params
var/turf/T = get_turf(user) // for pAIs
var/broadcast = T ? T : user
switch (m_type) switch (m_type)
if (EMOTE_VISIBLE) 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) if (EMOTE_AUDIBLE)
for(var/mob/O in hearers(user)) for(var/mob/O in hearers(broadcast))
O.show_message(msg, m_type) 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" var/location = T ? "[T.x],[T.y],[T.z]" : "nullspace"
log_emote("[user.name]/[user.key] (@[location]): [message]") log_emote("[user.name]/[user.key] (@[location]): [message]")

View File

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

View File

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