-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Facehuggers dont sleep people + muzzle code exorcism [MDB IG…
…NORE] (#4232) * Facehuggers dont sleep people + muzzle code exorcism * conflicts * re-adds muzzle_ignore, adds it to a few emotes --------- Co-authored-by: NovaBot <[email protected]> Co-authored-by: jimmyl <[email protected]> Co-authored-by: Fluffles <[email protected]>
- Loading branch information
1 parent
84eb872
commit eb495aa
Showing
18 changed files
with
133 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/datum/element/muffles_speech | ||
|
||
/datum/element/muffles_speech/Attach(datum/target) | ||
. = ..() | ||
if(!isitem(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
|
||
RegisterSignal(target, COMSIG_ITEM_EQUIPPED, PROC_REF(equipped)) | ||
RegisterSignal(target, COMSIG_ITEM_DROPPED, PROC_REF(dropped)) | ||
|
||
/datum/element/muffles_speech/Detach(datum/source) | ||
. = ..() | ||
UnregisterSignal(source, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) | ||
|
||
/datum/element/muffles_speech/proc/equipped(obj/item/source, mob/user, slot) | ||
SIGNAL_HANDLER | ||
if(source.slot_flags & slot) | ||
RegisterSignal(user, COMSIG_MOB_SAY, PROC_REF(muzzle_talk)) | ||
RegisterSignal(user, COMSIG_MOB_PRE_EMOTED, PROC_REF(emote_override)) | ||
|
||
/datum/element/muffles_speech/proc/dropped(obj/item/source, mob/user) | ||
SIGNAL_HANDLER | ||
UnregisterSignal(user, list(COMSIG_MOB_PRE_EMOTED, COMSIG_MOB_SAY)) | ||
|
||
/datum/element/muffles_speech/proc/emote_override(mob/living/source, key, params, type_override, intentional, datum/emote/emote) | ||
SIGNAL_HANDLER | ||
// NOVA EDIT ADDITION: muzzle_ignore flag | ||
if(emote.muzzle_ignore) | ||
return NONE | ||
// NOVA EDIT ADDITION END | ||
if(!emote.hands_use_check && (emote.emote_type & EMOTE_AUDIBLE)) | ||
source.audible_message("makes a [pick("strong ", "weak ", "")]noise.", audible_message_flags = EMOTE_MESSAGE|ALWAYS_SHOW_SELF_MESSAGE) | ||
return COMPONENT_CANT_EMOTE | ||
return NONE | ||
|
||
/datum/element/muffles_speech/proc/muzzle_talk(datum/source, list/speech_args) | ||
SIGNAL_HANDLER | ||
|
||
var/spoken_message = speech_args[SPEECH_MESSAGE] | ||
if(spoken_message) | ||
var/list/words = splittext(spoken_message, " ") | ||
var/yell_suffix = copytext(spoken_message, findtext(spoken_message, "!")) | ||
spoken_message = "" | ||
|
||
for(var/ind = 1 to length(words)) | ||
var/new_word = "" | ||
for(var/i = 1 to length(words[ind]) + rand(-1,1)) | ||
new_word += "m" | ||
new_word += "f" | ||
words[ind] = yell_suffix ? uppertext(new_word) : new_word | ||
spoken_message = "[jointext(words, " ")][yell_suffix]" | ||
speech_args[SPEECH_MESSAGE] = spoken_message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.