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-03 00:00:46 -04: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