Fixes emote runtime / changes how emotes work for ghosts (#56519)

* Fixes / refactors emotes

Crack emote no longer runtimes
Ghosts can use help emote
Exhale / inhale emote only work for living
Move beep emote living subtype
Help emote no longer tells you that you can't use it

* Remove var in arguments

Lint

* Replace loop with join
This commit is contained in:
Gamer025
2021-02-02 21:30:13 +01:00
committed by GitHub
parent 2ff78cd507
commit db0dd61a96
5 changed files with 31 additions and 37 deletions
@@ -1,5 +1,5 @@
/mob/dead/observer/check_emote(message, forced)
if(message == "*spin" || message == "*flip")
if(message[1] == "*")
emote(copytext(message, length(message[1]) + 1), intentional = !forced)
return TRUE
+22
View File
@@ -32,6 +32,28 @@
to_chat(src, "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>")
return FALSE
/datum/emote/help
key = "help"
mob_type_ignore_stat_typecache = list(/mob/dead/observer, /mob/living/silicon/ai)
/datum/emote/help/run_emote(mob/user, params, type_override, intentional)
. = ..()
var/list/keys = list()
var/list/message = list("Available emotes, you can use them with say \"*emote\": ")
for(var/key in GLOB.emote_list)
for(var/datum/emote/P in GLOB.emote_list[key])
if(P.key in keys)
continue
if(P.can_run_emote(user, status_check = FALSE , intentional = TRUE))
keys += P.key
keys = sortList(keys)
message += keys.Join(", ")
message += "."
message = message.Join("")
to_chat(user, message)
/datum/emote/flip
key = "flip"
key_third_person = "flips"
+1 -1
View File
@@ -42,7 +42,7 @@
cooldown = 6 SECONDS
/datum/emote/living/carbon/crack/can_run_emote(mob/living/carbon/user, status_check = TRUE , intentional)
if(user.usable_hands < 2)
if(!iscarbon(user) || user.usable_hands < 2)
return FALSE
return ..()
/datum/emote/living/carbon/moan
+3 -31
View File
@@ -455,35 +455,7 @@
/datum/emote/living/custom/replace_pronoun(mob/user, message)
return message
/datum/emote/living/help
key = "help"
/datum/emote/living/help/run_emote(mob/user, params, type_override, intentional)
var/list/keys = list()
var/list/message = list("Available emotes, you can use them with say \"*emote\": ")
for(var/key in GLOB.emote_list)
for(var/datum/emote/P in GLOB.emote_list[key])
if(P.key in keys)
continue
if(P.can_run_emote(user, status_check = FALSE , intentional = TRUE))
keys += P.key
keys = sortList(keys)
for(var/emote in keys)
if(LAZYLEN(message) > 1)
message += ", [emote]"
else
message += "[emote]"
message += "."
message = jointext(message, "")
to_chat(user, message)
/datum/emote/beep
/datum/emote/living/beep
key = "beep"
key_third_person = "beeps"
message = "beeps."
@@ -492,13 +464,13 @@
mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon)
emote_type = EMOTE_AUDIBLE
/datum/emote/inhale
/datum/emote/living/inhale
key = "inhale"
key_third_person = "inhales"
message = "breathes in."
emote_type = EMOTE_AUDIBLE
/datum/emote/exhale
/datum/emote/living/exhale
key = "exhale"
key_third_person = "exhales"
message = "breathes out."