Emotes now shatter 80% less immersions (#31240)

* Emote Checks by Default

* Removes emote argument

* More emote fixes

* Overhauled emote check

* Closed Spans
This commit is contained in:
Robustin
2017-10-05 16:10:47 -04:00
committed by CitadelStationBot
parent cf37555c4d
commit c8e5928517
2 changed files with 24 additions and 17 deletions
+6 -5
View File
@@ -42,7 +42,7 @@
I.trigger(key, L)
if(!msg)
return FALSE
return
user.log_message(msg, INDIVIDUAL_EMOTE_LOG)
msg = "<b>[user]</b> " + msg
@@ -91,21 +91,22 @@
/datum/emote/proc/select_param(mob/user, params)
return replacetext(message_param, "%t", params)
/datum/emote/proc/can_run_emote(mob/user, help_check)
/datum/emote/proc/can_run_emote(mob/user, status_check = TRUE)
. = TRUE
if(!is_type_in_typecache(user, mob_type_allowed_typecache))
return FALSE
if(is_type_in_typecache(user, mob_type_blacklist_typecache))
return FALSE
if(!help_check)
if(status_check)
if(user.stat > stat_allowed || (user.status_flags & FAKEDEATH))
to_chat(user, "<span class='notice'>You cannot [key] while unconscious.</span>")
return FALSE
if(restraint_check && user.restrained())
if(restraint_check && (user.restrained() || user.buckled))
to_chat(user, "<span class='notice'>You cannot [key] while restrained.</span>")
return FALSE
if(user.reagents && user.reagents.has_reagent("mimesbane"))
return FALSE
/datum/emote/sound
var/sound //Sound to play when emote is called
var/vary = FALSE //used for the honk borg emote
+18 -12
View File
@@ -29,6 +29,7 @@
key_third_person = "bows"
message = "bows."
message_param = "bows to %t."
restraint_check = TRUE
/datum/emote/living/burp
key = "burp"
@@ -119,6 +120,7 @@
key = "flap"
key_third_person = "flaps"
message = "flaps their wings."
restraint_check = TRUE
var/wing_time = 20
/datum/emote/living/flap/run_emote(mob/user, params)
@@ -138,6 +140,7 @@
key = "aflap"
key_third_person = "aflaps"
message = "flaps their wings ANGRILY!"
restraint_check = TRUE
wing_time = 10
/datum/emote/living/flip
@@ -147,7 +150,7 @@
/datum/emote/living/flip/run_emote(mob/user, params)
. = ..()
if(!.)
if(.)
user.SpinAnimation(7,1)
/datum/emote/living/frown
@@ -454,7 +457,7 @@
if(e in keys)
continue
E = emote_list[e]
if(E.can_run_emote(user, TRUE))
if(E.can_run_emote(user, status_check = FALSE))
keys += E.key
keys = sortList(keys)
@@ -481,18 +484,21 @@
/datum/emote/living/spin
key = "spin"
key_third_person = "spins"
restraint_check = TRUE
/datum/emote/living/spin/run_emote(mob/user)
user.spin(20, 1)
if(iscyborg(user))
var/mob/living/silicon/robot/R = user
if(R.buckled_mobs)
for(var/mob/M in R.buckled_mobs)
if(R.riding_datum)
R.riding_datum.force_dismount(M)
else
R.unbuckle_all_mobs()
..()
. = ..()
if(.)
user.spin(20, 1)
if(iscyborg(user))
var/mob/living/silicon/robot/R = user
if(R.buckled_mobs)
for(var/mob/M in R.buckled_mobs)
if(R.riding_datum)
R.riding_datum.force_dismount(M)
else
R.unbuckle_all_mobs()
/datum/emote/living/circle
key = "circle"