Adds *crack, an audible emote that lets you crack your knuckles. (#19529)

* Adds knuckle cracking sfx

* Add cracks for IPCs too

* Matt code suggestions

* review 2

* Fix species limitations, add diona sfx
This commit is contained in:
Luc
2022-11-02 23:00:46 -05:00
committed by GitHub
parent 8ea4da61f3
commit c5bc28f41f
5 changed files with 53 additions and 3 deletions
+11 -3
View File
@@ -57,7 +57,9 @@
/// Types that can use this emote regardless of their state.
var/list/mob_type_ignore_stat_typecache
/// Species types which the emote will be exclusively available to. Should be subclasses of /datum/species
var/species_type_whitelist_typecache
var/list/species_type_whitelist_typecache
/// Species types which the emote will be exclusively not available to. Should be subclasses of /datum/species
var/list/species_type_blacklist_typecache
/// If we get a target, how do we want to treat it?
var/target_behavior = EMOTE_TARGET_BHVR_USE_PARAMS_ANYWAY
/// If our target behavior isn't to ignore, what should we look for with targets?
@@ -120,6 +122,7 @@
mob_type_blacklist_typecache = typecacheof(mob_type_blacklist_typecache)
mob_type_ignore_stat_typecache = typecacheof(mob_type_ignore_stat_typecache)
species_type_whitelist_typecache = typecacheof(species_type_whitelist_typecache)
species_type_blacklist_typecache = typecacheof(species_type_blacklist_typecache)
/datum/emote/Destroy(force)
if(force)
@@ -480,8 +483,13 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(species_type_whitelist_typecache && H.dna && !is_type_in_typecache(H.dna.species, species_type_whitelist_typecache))
return FALSE
if(H.dna)
// Since the typecaches might be null as a valid option, it looks like we do need to check that these exist first.
if(species_type_whitelist_typecache && !is_type_in_typecache(H.dna.species, species_type_whitelist_typecache))
return FALSE
if(species_type_blacklist_typecache && is_type_in_typecache(H.dna.species, species_type_blacklist_typecache))
return FALSE
if(intentional && only_unintentional)
return FALSE
@@ -37,6 +37,17 @@
emote_type = EMOTE_VISIBLE
hands_use_check = TRUE
/datum/emote/living/carbon/human/crack
key = "crack"
key_third_person = "cracks"
message = "cracks their knuckles."
emote_type = EMOTE_AUDIBLE | EMOTE_SOUND
// knuckles.ogg by CGEffex. Shortened and cut.
// https://freesound.org/people/CGEffex/sounds/93981/
sound = "sound/effects/mob_effects/knuckles.ogg"
// These species all have overrides, see below
species_type_blacklist_typecache = list(/datum/species/slime, /datum/species/machine, /datum/species/plasmaman, /datum/species/skeleton, /datum/species/diona)
/datum/emote/living/carbon/human/cry
key = "cry"
key_third_person = "cries"
@@ -690,3 +701,34 @@
message = "rattles their bones."
message_param = "rattles their bones at %t."
species_type_whitelist_typecache = list(/datum/species/skeleton, /datum/species/plasmaman)
/datum/emote/living/carbon/human/crack/slime
message = "squishes their knuckles!"
sound = "sound/effects/slime_squish.ogg"
species_type_whitelist_typecache = list(/datum/species/slime)
species_type_blacklist_typecache = null
/datum/emote/living/carbon/human/crack/machine
message = "cracks their actuators!"
sound = "sound/effects/mob_effects/ipc_crunch.ogg"
species_type_whitelist_typecache = list(/datum/species/machine)
species_type_blacklist_typecache = null
/datum/emote/living/carbon/human/crack/diona
message = "cracks a twig!"
sound = "sound/effects/mob_effects/diona_crunch.ogg"
species_type_whitelist_typecache = list(/datum/species/diona)
species_type_blacklist_typecache = null
volume = 85 // the sound effect is a bit quiet
/datum/emote/living/carbon/human/crack/skelly
message = "cracks something!" // placeholder
species_type_whitelist_typecache = list(/datum/species/skeleton, /datum/species/plasmaman)
species_type_blacklist_typecache = null
/datum/emote/living/carbon/human/crack/skelly/run_emote(mob/user, params, type_override, intentional)
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/bodypart = pick(H.bodyparts)
message = "cracks their [bodypart.name]!"
. = ..()