diff --git a/code/datums/emote.dm b/code/datums/emote.dm index d4a7663ee76..9d6b7a7e175 100644 --- a/code/datums/emote.dm +++ b/code/datums/emote.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/human_emote.dm b/code/modules/mob/living/carbon/human/human_emote.dm index 344aafb872d..5265acdf07d 100644 --- a/code/modules/mob/living/carbon/human/human_emote.dm +++ b/code/modules/mob/living/carbon/human/human_emote.dm @@ -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]!" + . = ..() + diff --git a/sound/effects/mob_effects/diona_crunch.ogg b/sound/effects/mob_effects/diona_crunch.ogg new file mode 100644 index 00000000000..1cfea3c022d Binary files /dev/null and b/sound/effects/mob_effects/diona_crunch.ogg differ diff --git a/sound/effects/mob_effects/ipc_crunch.ogg b/sound/effects/mob_effects/ipc_crunch.ogg new file mode 100644 index 00000000000..225efd5ba60 Binary files /dev/null and b/sound/effects/mob_effects/ipc_crunch.ogg differ diff --git a/sound/effects/mob_effects/knuckles.ogg b/sound/effects/mob_effects/knuckles.ogg new file mode 100644 index 00000000000..b61a50fb613 Binary files /dev/null and b/sound/effects/mob_effects/knuckles.ogg differ