//This only assumes that the mob has a body and face with at least one mouth.
//Things like airguitar can be done without arms, and the flap thing makes so little sense it's a keeper.
//Intended to be called by a higher up emote proc if the requested emote isn't in the custom emotes.
/mob/living/emote(act, m_type=1, message = null)
if(stat)
return
var/param = null
if (findtext(act, "-", 1, null)) //Removes dashes for npcs "EMOTE-PLAYERNAME" or something like that, I ain't no AI coder. It's not for players. -Sum99
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
switch(act)//Hello, how would you like to order? Alphabetically!
if ("aflap")
if (!src.restrained())
message = "[src] flaps its wings ANGRILY!"
m_type = 2
if ("blush","blushes")
message = "[src] blushes."
m_type = 1
if ("bow","bows")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "[src] bows to [param]."
else
message = "[src] bows."
m_type = 1
if ("burp","burps")
message = "[src] burps."
m_type = 2
if ("choke","chokes")
message = "[src] chokes!"
m_type = 2
if ("chuckle","chuckles")
message = "[src] chuckles."
m_type = 2
if ("collapse","collapses")
Paralyse(2)
message = "[src] collapses!"
m_type = 2
if ("cough","coughs")
message = "[src] coughs!"
m_type = 2
if ("dance","dances")
if (!src.restrained())
message = "[src] dances around happily."
m_type = 1
if ("deathgasp","deathgasps")
message = "[src] seizes up and falls limp, its eyes dead and lifeless..."
m_type = 1
if ("drool","drools")
message = "[src] drools."
m_type = 1
if ("faint","faints")
message = "[src] faints."
if(sleeping)
return //Can't faint while asleep
SetSleeping(10) //Short-short nap
m_type = 1
if ("flap","flaps")
if (!src.restrained())
message = "[src] flaps its wings."
m_type = 2
if ("flip","flips")
if (!restrained() || !resting || !sleeping)
src.SpinAnimation(7,1)
m_type = 2
if ("frown","frowns")
message = "[src] frowns."
m_type = 1
if ("gasp","gasps")
message = "[src] gasps!"
m_type = 2
if ("giggle","giggles")
message = "[src] giggles."
m_type = 2
if ("glare","glares")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "[src] glares at [param]."
else
message = "[src] glares."
if ("grin","grins")
message = "[src] grins."
m_type = 1
if ("jump","jumps")
message = "[src] jumps!"
m_type = 1
if ("laugh","laughs")
message = "[src] laughs."
m_type = 2
if ("look","looks")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "[src] looks at [param]."
else
message = "[src] looks."
m_type = 1
if ("me")
if(jobban_isbanned(src, "emote"))
src << "You cannot send custom emotes (banned)"
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if(!(message))
return
else
message = "[src] [message]"
if ("nod","nods")
message = "[src] nods."
m_type = 1
if ("point","points")
if (!src.restrained())
var/atom/M = null
if (param)
for (var/atom/A as mob|obj|turf in view())
if (param == A.name)
M = A
break
if (!M)
message = "[src] points."
else
pointed(M)
m_type = 1
if ("scream","screams")
message = "[src] screams!"
m_type = 2
if ("shake","shakes")
message = "[src] shakes its head."
m_type = 1
if ("sigh","sighs")
message = "[src] sighs."
m_type = 2
if ("sit","sits")
message = "[src] sits down."
m_type = 1
if ("smile","smiles")
message = "[src] smiles."
m_type = 1
if ("sneeze","sneezes")
message = "[src] sneezes."
m_type = 2
if ("sniff","sniffs")
message = "[src] sniffs."
m_type = 2
if ("snore","snores")
message = "[src] snores."
m_type = 2
if ("stare","stares")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "[src] stares at [param]."
else
message = "[src] stares."
if ("sulk","sulks")
message = "[src] sulks down sadly."
m_type = 1
if ("sway","sways")
message = "[src] sways around dizzily."
m_type = 1
if ("tremble","trembles")
message = "[src] trembles in fear!"
m_type = 1
if ("twitch","twitches")
message = "[src] twitches violently."
m_type = 1
if ("twitch_s")
message = "[src] twitches."
m_type = 1
if ("wave","waves")
message = "[src] waves."
m_type = 1
if ("whimper","whimpers")
message = "[src] whimpers."
m_type = 2
if ("yawn","yawns")
message = "[src] yawns."
m_type = 2
if ("help")
src << "Help for emotes. You can use these emotes with say \"*emote\":\n\naflap, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, giggle, glare-(none)/mob, grin, jump, laugh, look, me, nod, point-atom, scream, shake, sigh, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tremble, twitch, twitch_s, wave, whimper, yawn"
else
src << "Unusable emote '[act]'. Say *help for a list."
if (message)
log_emote("[name]/[key] : [message]")
//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 dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers and new players
var/T = get_turf(src)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T,null)))
M.show_message(message)
if (m_type & 1)
visible_message(message)
else if (m_type & 2)
audible_message(message)