More emote fixes, universal silicon beeppingbuzz

This commit does the following:
 - Fixes more oddities and standardizes more emote procs
 - All silicons now share beep, ping, and buzz
This commit is contained in:
Tigercat2000
2015-09-19 10:11:42 -07:00
parent bab04c669e
commit 7e522ed730
8 changed files with 154 additions and 313 deletions
@@ -1,139 +1,115 @@
/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act))
// if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
// act = copytext(act,1,length(act)) //seriously who the fuck wrote this
var/muzzled = is_muzzled()
switch(act)
if ("me")
if(silent)
return
if (src.client)
if (client.prefs.muted & MUTE_IC)
src << "\red You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if (stat)
return
if(!(message))
return
return custom_emote(m_type, message)
if ("custom")
return custom_emote(m_type, message)
if("sign")
if (!src.restrained())
message = text("<B>The alien</B> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
m_type = 1
if(!restrained())
var/num = null
if(text2num(param))
num = "the number [text2num(param)]"
if(num)
message = "<B>\The [src]</B> signs [num]."
m_type = 1
if ("burp")
if (!muzzled)
message = "<B>[src]</B> burps."
message = "<B>\The [src]</B> burps."
m_type = 2
if ("deathgasp")
message = "<B>[src]</B> lets out a waning guttural screech, green blood bubbling from its maw..."
message = "<B>\The [src]</B> lets out a waning guttural screech, green blood bubbling from its maw..."
m_type = 2
if("scratch")
if (!src.restrained())
message = "<B>The [src.name]</B> scratches."
message = "<B>\The [src]</B> scratches."
m_type = 1
if("whimper")
if (!muzzled)
message = "<B>The [src.name]</B> whimpers."
message = "<B>\The [src]</B> whimpers."
m_type = 2
if("roar")
if (!muzzled)
message = "<B>The [src.name]</B> roars."
message = "<B>\The [src]</B> roars."
m_type = 2
if("hiss")
if(!muzzled)
message = "<B>The [src.name]</B> hisses."
message = "<B>\The [src]</B> hisses."
m_type = 2
if("tail")
message = "<B>The [src.name]</B> waves its tail."
message = "<B>\The [src]</B> waves its tail."
m_type = 1
if("gasp")
message = "<B>The [src.name]</B> gasps."
message = "<B>\The [src]</B> gasps."
m_type = 2
if("shiver")
message = "<B>The [src.name]</B> shivers."
message = "<B>\The [src]</B> shivers."
m_type = 2
if("drool")
message = "<B>The [src.name]</B> drools."
message = "<B>\The [src]</B> drools."
m_type = 1
if("scretch")
if (!muzzled)
message = "<B>The [src.name]</B> scretches."
message = "<B>\The [src]</B> scretches."
m_type = 2
if("choke")
message = "<B>The [src.name]</B> chokes."
message = "<B>\The [src]</B> chokes."
m_type = 2
if("moan")
message = "<B>The [src.name]</B> moans!"
message = "<B>\The [src]</B> moans!"
m_type = 2
if("nod")
message = "<B>The [src.name]</B> nods its head."
message = "<B>\The [src]</B> nods its head."
m_type = 1
if("sit")
message = "<B>The [src.name]</B> sits down."
message = "<B>\The [src]</B> sits down."
m_type = 1
if("sway")
message = "<B>The [src.name]</B> sways around dizzily."
message = "<B>\The [src]</B> sways around dizzily."
m_type = 1
if("sulk")
message = "<B>The [src.name]</B> sulks down sadly."
message = "<B>\The [src]</B> sulks down sadly."
m_type = 1
if("twitch")
message = "<B>The [src.name]</B> twitches violently."
message = "<B>\The [src]</B> twitches violently."
m_type = 1
if("dance")
if (!src.restrained())
message = "<B>The [src.name]</B> dances around happily."
message = "<B>\The [src]</B> dances around happily."
m_type = 1
if("roll")
if (!src.restrained())
message = "<B>The [src.name]</B> rolls."
message = "<B>\The [src]</B> rolls."
m_type = 1
if("shake")
message = "<B>The [src.name]</B> shakes its head."
message = "<B>\The [src]</B> shakes its head."
m_type = 1
if("gnarl")
if (!muzzled)
message = "<B>The [src.name]</B> gnarls and shows its teeth.."
message = "<B>\The [src]</B> gnarls and shows its teeth.."
m_type = 2
if("jump")
message = "<B>The [src.name]</B> jumps!"
message = "<B>\The [src]</B> jumps!"
m_type = 1
if("collapse")
Paralyse(2)
message = text("<B>[]</B> collapses!", src)
message = "<B>\The [src]</B> collapses!"
m_type = 2
if ("flip")
m_type = 1
message = "<B>[src]</B> does a flip!"
message = "<B>\The [src]</B> does a flip!"
src.SpinAnimation(5,1)
if("help")
src << "burp, flip, deathgasp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper"
else
src << text("Invalid Emote: []", act)
if ((message && src.stat == 0))
log_emote("[name]/[key] : [message]")
if(!stat)
if (act == "roar")
playsound(src.loc, 'sound/voice/hiss5.ogg', 40, 1, 1)
if (act == "deathgasp")
playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
//Foreach goto(703)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
//Foreach goto(746)
return
..(act, m_type, message)
+11 -43
View File
@@ -12,71 +12,39 @@
if(src.stat == DEAD)
return
switch(act)
if ("me")
if(silent)
return
if (src.client)
if (client.prefs.muted & MUTE_IC)
src << "\red You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if (stat)
return
if(!(message))
return
return custom_emote(m_type, message)
if ("custom")
return custom_emote(m_type, message)
if ("alarm")
src << "You sound an alarm."
message = "<B>[src]</B> sounds an alarm."
message = "<B>\The [src]</B> sounds an alarm."
m_type = 2
if ("alert")
src << "You let out a distressed noise."
message = "<B>[src]</B> lets out a distressed noise."
message = "<B>\The [src]</B> lets out a distressed noise."
m_type = 2
if ("notice")
src << "You play a loud tone."
message = "<B>[src]</B> plays a loud tone."
message = "<B>\The [src]</B> plays a loud tone."
m_type = 2
if ("flash")
message = "The lights on <B>[src]</B> flash quickly."
message = "The lights on <B>\the [src]</B> flash quickly."
m_type = 1
if ("blink")
message = "<B>[src]</B> blinks."
message = "<B>\The [src]</B> blinks."
m_type = 1
if ("whistle")
src << "You whistle."
message = "<B>[src]</B> whistles."
message = "<B>\The [src]</B> whistles."
m_type = 2
if ("beep")
src << "You beep."
message = "<B>[src]</B> beeps."
message = "<B>\The [src]</B> beeps."
m_type = 2
if ("boop")
src << "You boop."
message = "<B>[src]</B> boops."
message = "<B>\The [src]</B> boops."
m_type = 2
if ("help")
src << "alarm,alert,notice,flash,blink,whistle,beep,boop"
else
src << "\blue Unusable emote '[act]'. Say *help for a list."
src << "alarm, alert, notice, flash,blink, whistle, beep, boop"
if (message)
log_emote("[name]/[key] : [message]")
for(var/mob/M in dead_mob_list)
if (!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers, and new_players
if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
if (m_type & 1)
for (var/mob/O in viewers(src, null))
O.show_message(message, m_type)
else if (m_type & 2)
for (var/mob/O in hearers(src.loc, null))
O.show_message(message, m_type)
if(message && !stat)
..(act, m_type, message)
+7 -43
View File
@@ -1,6 +1,5 @@
/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
@@ -18,8 +17,7 @@
if (I.implanted)
I.trigger(act, src)
if(src.stat == 2.0 && (act != "deathgasp"))
return
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
@@ -167,37 +165,6 @@
message = "<B>[src]</B> bows."
m_type = 1
if ("custom")
var/input = sanitize(copytext(input("Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
if (!input)
return
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
else if (input2 == "Hearable")
if (src.miming)
return
m_type = 2
else
alert("Unable to use this emote, must be either hearable or visible.")
return
return custom_emote(m_type, message)
if ("me")
if(silent)
return
if (src.client)
if (client.prefs.muted & MUTE_IC)
src << "\red You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if (stat)
return
if(!(message))
return
return custom_emote(m_type, message)
if ("salute")
if (!src.buckled)
var/M = null
@@ -820,7 +787,7 @@
if (message)
if(message) //Humans are special fucking snowflakes and have 735 lines of emotes, they get to handle their own emotes, not call the parent
log_emote("[name]/[key] : [message]")
//Hearing gasp and such every five seconds is not good emotes were not global for a reason.
@@ -832,14 +799,11 @@
if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
if (m_type & 1)
for (var/mob/O in get_mobs_in_view(world.view,src))
O.show_message(message, m_type)
else if (m_type & 2)
for (var/mob/O in (hearers(src.loc, null) | get_mobs_in_view(world.view,src)))
O.show_message(message, m_type)
switch(m_type)
if(1)
visible_message(message)
if(2)
audible_message(message)
/mob/living/carbon/human/verb/pose()
set name = "Set Pose"
+14 -1
View File
@@ -272,10 +272,23 @@ proc/get_radio_key_from_channel(var/channel)
return 1
if(act && type && message) //parent call
log_emote("[name]/[key] : [message]")
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers and new players //who the hell knows why new players are in the dead mob list
if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
switch(type)
if(1) //Visible
visible_message(message)
return 1
if(2) //Audible
audible_message(message)
return 1
return 1
else //everything else failed, emote is probably invalid
if(act == "help") return //except help, because help is handled individually
src << "\blue Unusable emote '[act]'. Say *help for a list."
+78
View File
@@ -0,0 +1,78 @@
/mob/living/silicon/emote(var/act, var/m_type=1, var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act))
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
var/on_CD = 0
switch(act)
//Cooldown-inducing emotes
if("ping","buzz","beep") //halt is exempt because it's used to stop criminal scum //WHOEVER THOUGHT THAT WAS A GOOD IDEA IS GOING TO GET SHOT.
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
//Everything else, including typos of the above emotes
else
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
if(on_CD == 1) // Check if we need to suppress the emote attempt.
return // Suppress emote, you're still cooling off.
//--FalseIncarnate
switch(act)
if("ping")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if("buzz")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if("beep")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> beeps at [param]."
else
message = "<B>[src]</B> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 1
..(act, m_type, message)
+3 -87
View File
@@ -1,90 +1,6 @@
/mob/living/silicon/pai/emote(var/act,var/m_type=1,var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act))
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
var/on_CD = 0
/mob/living/silicon/pai/emote(var/act, var/m_type=1, var/message = null)
switch(act)
//Cooldown-inducing emotes
if("ping","buzz")
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
//Everything else, including typos of the above emotes
else
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
if(on_CD == 1) // Check if we need to suppress the emote attempt.
return // Suppress emote, you're still cooling off.
//--FalseIncarnate
switch(act)
if ("me")
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 (stat)
return
if(!(message))
return
else
return custom_emote(m_type, message)
if ("custom")
return custom_emote(m_type, message)
if("ping")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if("buzz")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if ("help")
src << "ping, \nbuzz."
else
src << "\blue Unusable emote '[act]'. Say *help for a list."
src << "ping, beep, buzz."
if ((message && src.stat == 0))
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
return
..(act, m_type, message)
+3 -78
View File
@@ -1,4 +1,4 @@
/mob/living/silicon/robot/emote(var/act,var/m_type=1,var/message = null)
/mob/living/silicon/robot/emote(var/act, var/m_type=1, var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
@@ -13,7 +13,7 @@
var/on_CD = 0
switch(act)
//Cooldown-inducing emotes
if("ping","buzz","beep","law","flip","halt") //halt is exempt because it's used to stop criminal scum //WHOEVER THOUGHT THAT WAS A GOOD IDEA IS GOING TO GET SHOT.
if("law","flip","halt") //halt is exempt because it's used to stop criminal scum //WHOEVER THOUGHT THAT WAS A GOOD IDEA IS GOING TO GET SHOT.
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
//Everything else, including typos of the above emotes
else
@@ -24,22 +24,6 @@
//--FalseIncarnate
switch(act)
if ("me")
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 (stat)
return
if(!(message))
return
else
return custom_emote(m_type, message)
if ("custom")
return custom_emote(m_type, message)
if ("salute")
if (!src.buckled)
@@ -151,56 +135,6 @@
message = "<B>[src]</B> looks."
m_type = 1
if("beep")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> beeps at [param]."
else
message = "<B>[src]</B> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 1
if("ping")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if("buzz")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if("law")
if (istype(module,/obj/item/weapon/robot_module/security))
@@ -227,14 +161,5 @@
if ("help")
src << "salute, bow-(none)/mob, clap, flap, aflap, twitch, twitch_s, nod, deathgasp, glare-(none)/mob, stare-(none)/mob, look, beep, ping, \nbuzz, law, halt"
else
src << "\blue Unusable emote '[act]'. Say *help for a list."
if ((message && src.stat == 0))
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
return
..(act, m_type, message)