Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows anybody with a synthetic voice box to use silicon emotes #1784

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/modules/mob/living/silicon/robot/emote.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/datum/emote/silicon
mob_type_allowed_typecache = list(/mob/living/silicon, /mob/living/simple_animal/bot)
// MONKESTATION REMOVAL - Replaced with `/datum/emote/silicon/can_run_emote()`, which is used to
// enable silicon emotes for users with synthetic voice boxes.
//mob_type_allowed_typecache = list(/mob/living/silicon, /mob/living/simple_animal/bot)
emote_type = EMOTE_AUDIBLE

/datum/emote/silicon/boop
Expand Down
15 changes: 15 additions & 0 deletions monkestation/code/modules/mob/living/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,18 @@
return TRUE
else
return FALSE

// The below function replaces the `/datum/emote/silicon/mob_type_allowed_typecache` variable. If
// you remove this function, be sure to replace the above variable.
/datum/emote/silicon/can_run_emote(mob/user, status_check, intentional)
// Silicons and simple bots can always use silicon emotes, assuming nothing else is wrong
if(issilicon(user) || isbot(user))
return ..()

// Allow users with synthetic voice boxes to use silicon emotes as well, because a synthetic
// voice box is more akin to a speaker than a human larynx.
var/tongue = user.get_organ_slot(ORGAN_SLOT_TONGUE)
if(istype(tongue, /obj/item/organ/internal/tongue/synth))
return ..()

return FALSE
Loading