-
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] Let's you talk through action figures, plushies, and toy mec…
…hs with `.l` and `.r`. Also a big clean up of `say` because its support for non-mobs was lackluster. (#1320) (#2312) * Let's you talk through action figures, plushies, and toy mechs with `.l` and `.r`. Also a big clean up of `say` because its support for non-mobs was lackluster. (#81848) * Let's you talk through action figures, plushies, and toy mechs with `.l` and `.r`. Also a big clean up of `say` because its support for non-mobs was lackluster. * Modular --------- Co-authored-by: NovaBot <[email protected]> Co-authored-by: MrMelbert <[email protected]> Co-authored-by: Mal <[email protected]>
- Loading branch information
1 parent
e05d4a8
commit f8da6d1
Showing
36 changed files
with
342 additions
and
135 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
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,28 @@ | ||
/** | ||
* Allows people to talk via the item with .l or .r | ||
* | ||
* Be sure to override [/atom/movable/proc/GetVoice] if you want the item's "voice" to not default to itself | ||
*/ | ||
/datum/element/toy_talk | ||
|
||
/datum/element/toy_talk/Attach(datum/target) | ||
. = ..() | ||
if(!isitem(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
|
||
RegisterSignal(target, COMSIG_ITEM_TALK_INTO, PROC_REF(do_talk)) | ||
|
||
/datum/element/toy_talk/Detach(datum/source, ...) | ||
. = ..() | ||
UnregisterSignal(source, COMSIG_ITEM_TALK_INTO) | ||
|
||
/datum/element/toy_talk/proc/do_talk(obj/item/source, mob/speaker, message, channel, list/spans, language, list/message_mods) | ||
SIGNAL_HANDLER | ||
|
||
if(!ismob(speaker) || message_mods[MODE_HEADSET] || message_mods[MODE_RELAY]) | ||
return NONE | ||
|
||
message_mods[MODE_RELAY] = TRUE // Redundant (given NOPASS) but covers our bases | ||
speaker.log_talk(message, LOG_SAY, tag = "toy talk ([source])") | ||
source.say(message, language = language, sanitize = FALSE, message_mods = list(MODE_RELAY = TRUE)) | ||
return NOPASS |
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.