diff --git a/code/modules/mob/living/carbon/human/emote_vr.dm b/code/modules/mob/living/carbon/human/emote_vr.dm index a637dff787..26a2ad2f4c 100644 --- a/code/modules/mob/living/carbon/human/emote_vr.dm +++ b/code/modules/mob/living/carbon/human/emote_vr.dm @@ -17,8 +17,131 @@ message = "mlems [get_visible_gender() == MALE ? "his" : get_visible_gender() == FEMALE ? "her" : "their"] tongue up over [get_visible_gender() == MALE ? "his" : get_visible_gender() == FEMALE ? "her" : "their"] nose. Mlem." m_type = 1 if ("awoo") - message = "awoos loudly. AwoooOOOOoooo!" + var/mob/living/carbon/human/H = src + var/obj/item/organ/external/L = H.get_organ("chest") + var/obj/item/organ/external/R = H.get_organ("head") + var/torso_good = 0 + var/head_good = 0 + if(L && (!(L.status & ORGAN_DESTROYED)) && (!(L.splinted)) && (!(L.status & ORGAN_BROKEN))) + torso_good = 1 + if(R && (!(R.status & ORGAN_DESTROYED)) && (!(R.splinted)) && (!(R.status & ORGAN_BROKEN))) + head_good = 1 + + if(!torso_good && !head_good) + to_chat(usr, "You need an uninjured head and chest to be obnoxious.") //discourage spam by breaking one or both + return + m_type = 2 + message = "lets out an awoo." + playsound(loc, 'sound/voice/awoo.ogg', 50, 1, -1) + + + emoteDanger = min(1+(emoteDanger*2), 100) + var/danger = emoteDanger - 5//Base chance to break something. + var/list/involved_parts = list(BP_HEAD, BP_TORSO) // why there are organ tags and organ names i will never know + for(var/organ_name in involved_parts) + var/obj/item/organ/external/E = get_organ(organ_name) + if(!E || E.is_stump() || E.splinted || (E.status & ORGAN_BROKEN)) + involved_parts -= organ_name + danger += 7 //Add 7% chance for each involved part + + + if(prob(danger)) + spawn(10) //the dreaded spawn + var/breaking = pick(involved_parts) + var/obj/item/organ/external/E = get_organ(breaking) + if(isSynthetic()) + src.Weaken(5) + E.droplimb(1,DROPLIMB_EDGE) + message += " And falls apart!" //might be redundant, havent seen a synth die yet in testing + log_and_message_admins("broke their [breaking] with *awoo and were kicked.", src) + to_chat(usr, "You have been automatically logged out for spamming emotes.") + Logout(src) + else + src.Weaken(5) + if(E.cannot_break) //Prometheans go splat + E.droplimb(0,DROPLIMB_BLUNT) + else + E.fracture() + message += " And breaks something!" + log_and_message_admins("broke their [breaking] with *awoo and were kicked.", src) + to_chat(usr, "You have been automatically logged out for spamming emotes.") + Logout(src) + if ("nya") + var/mob/living/carbon/human/H = src + var/obj/item/organ/external/L = H.get_organ("chest") + var/obj/item/organ/external/R = H.get_organ("head") + var/torso_good = 0 + var/head_good = 0 + if(L && (!(L.status & ORGAN_DESTROYED)) && (!(L.splinted)) && (!(L.status & ORGAN_BROKEN))) + torso_good = 1 + if(R && (!(R.status & ORGAN_DESTROYED)) && (!(R.splinted)) && (!(R.status & ORGAN_BROKEN))) + head_good = 1 +//discourage spam by potentially breaking one or both + if(!torso_good && !head_good) + to_chat(usr, "You need an uninjured head and chest to be obnoxious.") + return + + message = "lets out a nya." + m_type = 2 + playsound(loc, 'sound/voice/nya.ogg', 50, 1, -1) + + + emoteDanger = min(1+(emoteDanger*2), 100) + var/danger = emoteDanger - 5//Base chance to break something. + var/list/involved_parts = list(BP_HEAD, BP_TORSO) // why there are organ tags and organ names i will never know + for(var/organ_name in involved_parts) + var/obj/item/organ/external/E = get_organ(organ_name) + if(!E || E.is_stump() || E.splinted || (E.status & ORGAN_BROKEN)) + involved_parts -= organ_name + danger += 5 //Add 5% chance for each involved part + + + if(prob(danger)) + spawn(10) //the dreaded spawn + var/breaking = pick(involved_parts) + var/obj/item/organ/external/E = get_organ(breaking) + if(isSynthetic()) + src.Weaken(5) + E.droplimb(1,DROPLIMB_EDGE) + message += " And loses their [breaking]!" //redundant unless a non-lethal limb is added to the parts list + log_and_message_admins("broke their [breaking] with *nya and were kicked.", src) + to_chat(usr, "You have been automatically logged out for spamming emotes.") + Logout(src) + else + src.Weaken(5) + if(E.cannot_break) //Prometheans go splat + E.droplimb(0,DROPLIMB_BLUNT) + else + E.fracture() + message += " And breaks something!" + log_and_message_admins("broke their [breaking] with *nya and were kicked.", src) + to_chat(usr, "You have been automatically logged out for spamming emotes.") + Logout(src) + if ("peep") + message = "peeps like a bird." + m_type = 2 + playsound(loc, 'sound/voice/peep.ogg', 50, 1, -1) + if("chirp") + message = "chirps!" + playsound(src.loc, 'sound/misc/nymphchirp.ogg', 50, 0) + m_type = 2 + if ("weh") + message = "lets out a weh." + m_type = 2 + playsound(loc, 'sound/voice/weh.ogg', 50, 1, -1) + if ("merp") + message = "lets out a merp." + m_type = 2 + playsound(loc, 'sound/voice/merp.ogg', 50, 1, -1) + if ("bark") + message = "lets out a bark." + m_type = 2 + playsound(loc, 'sound/voice/bark2.ogg', 50, 1, -1) + if ("his") + message = "lets out a hiss." + m_type = 2 + playsound(loc, 'sound/voice/hiss.ogg', 50, 1, -1) if ("nsay") nsay() return TRUE diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index dae0723fd4..f368f3e70f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -20,6 +20,9 @@ var/active_regen = FALSE //Used for the regenerate proc in human_powers.dm var/active_regen_delay = 300 + var/emoteDanger = 1 // What the current danger for spamming emotes is - shared between different types of emotes to keep people from just + // flip/snap/flip/snap. Decays at a rate of 1 per second to a minimum of 1. + /mob/living/carbon/human/Initialize(mapload, var/new_species = null) if(!dna) dna = new /datum/dna(null) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 2ff9409007..71c41a73c5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -37,6 +37,8 @@ set invisibility = 0 set background = BACKGROUND_ENABLED + var/timeSinceLastTick = world.time - lastLifeProc //Used to curb emote spam + if (transforming) return @@ -95,6 +97,10 @@ pulse = handle_pulse() + //Used to determine if someone should get ass blasted for awoo'ing + emoteDanger = max(0, emoteDanger - (timeSinceLastTick / 10)) + + /mob/living/carbon/human/proc/handle_some_updates() if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle return 0 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 8e3b9fb9a4..4feb886920 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -68,4 +68,6 @@ var/looking_elsewhere = FALSE //If the mob's view has been relocated to somewhere else, like via a camera or with binocs - var/image/selected_image = null // Used for buildmode AI control stuff. \ No newline at end of file + var/image/selected_image = null // Used for buildmode AI control stuff. + + var/lastLifeProc = 0 // Wallclock time of the last time this mob had life() called on them (at finish), used for tying variables to wallclock rather than tickcount \ No newline at end of file diff --git a/sound/voice/awoo.ogg b/sound/voice/awoo.ogg new file mode 100644 index 0000000000..1cbdbc01df Binary files /dev/null and b/sound/voice/awoo.ogg differ diff --git a/sound/voice/bark2.ogg b/sound/voice/bark2.ogg new file mode 100644 index 0000000000..dab73c4743 Binary files /dev/null and b/sound/voice/bark2.ogg differ diff --git a/sound/voice/hiss.ogg b/sound/voice/hiss.ogg new file mode 100644 index 0000000000..cd9fa22c37 Binary files /dev/null and b/sound/voice/hiss.ogg differ diff --git a/sound/voice/merp.ogg b/sound/voice/merp.ogg new file mode 100644 index 0000000000..b40b7a365b Binary files /dev/null and b/sound/voice/merp.ogg differ diff --git a/sound/voice/nya.ogg b/sound/voice/nya.ogg new file mode 100644 index 0000000000..1ca8cc08ea Binary files /dev/null and b/sound/voice/nya.ogg differ diff --git a/sound/voice/peep.ogg b/sound/voice/peep.ogg new file mode 100644 index 0000000000..b687300677 Binary files /dev/null and b/sound/voice/peep.ogg differ diff --git a/sound/voice/weh.ogg b/sound/voice/weh.ogg new file mode 100644 index 0000000000..9867651bc2 Binary files /dev/null and b/sound/voice/weh.ogg differ