From ead6e898a3536f56ddb3ec933e9d0e66e602182a Mon Sep 17 00:00:00 2001 From: Daylight Date: Sun, 20 Sep 2020 19:51:00 +0300 Subject: [PATCH] Makes emotes that require air gasps when you have 35+ oxygen damage (#13347) * Makes emotes that require air gasps when you have 40+ oxy damage * Update emote.dm * Update emote.dm * Makes code less copypasta * You can no longer scream 20 times a second. Also explains why this code needs 3 switches * Whitespace change --- code/modules/mob/living/carbon/human/emote.dm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 2fefc6b7c74..87a327f3427 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -30,8 +30,15 @@ //handle_emote_CD() located in [code\modules\mob\emote.dm] var/on_CD = FALSE act = lowertext(act) - switch(act) - //Cooldown-inducing emotes + + switch(act) //This switch makes sure you have air in your lungs before you scream + if("growl", "growls", "howl", "howls", "hiss", "hisses", "scream", "screams", "sneeze", "sneezes") + if(getOxyLoss() > 35) //no screaming if you don't have enough breath to scream + on_CD = handle_emote_CD() + emote("gasp") + return + + switch(act) //This switch adds cooldowns to some emotes if("ping", "pings", "buzz", "buzzes", "beep", "beeps", "yes", "no", "buzz2") var/found_machine_head = FALSE if(ismachineperson(src)) //Only Machines can beep, ping, and buzz, yes, no, and make a silly sad trombone noise. @@ -44,7 +51,7 @@ found_machine_head = TRUE if(!found_machine_head) //Everyone else fails, skip the emote attempt - return //Everyone else fails, skip the emote attempt + return //Everyone else fails, skip the emote attempt if("drone","drones","hum","hums","rumble","rumbles") if(isdrask(src)) //Only Drask can make whale noises on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm @@ -133,7 +140,7 @@ if(!force && on_CD == 1) // Check if we need to suppress the emote attempt. return // Suppress emote, you're still cooling off. - switch(act) + switch(act) //This is for actually making the emotes happen if("me") //OKAY SO RANT TIME, THIS FUCKING HAS TO BE HERE OR A SHITLOAD OF THINGS BREAK return custom_emote(m_type, message) //DO YOU KNOW WHY SHIT BREAKS? BECAUSE SO MUCH OLDCODE CALLS mob.emote("me",1,"whatever_the_fuck_it_wants_to_emote") //WHO THE FUCK THOUGHT THAT WAS A GOOD FUCKING IDEA!?!?