-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revive Lesser Drone and Facehugger temporary communication restrictio…
…ns (#5688) # About the pull request This PR revives and expands #5352. By expand I mean that in addition to a 3 minute restriction for say and hivemind speak, custom emotes and pointing are also restricted during the 3 minute window. Past that I did some additional refactoring. # Explain why it's good for the game As a ghost role, this acts as a measure to mechanically limit the communication of meta info to other members in the hive. For now the restriction is only 3 minutes. # Testing Photographs and Procedure <details> <summary>Screenshots & Videos</summary> ![image](https://github.com/cmss13-devs/cmss13/assets/76988376/fd64c2f4-9142-4fe1-9953-b29c480c17ee) </details> # Changelog :cl: Zonespace Drathek balance: Lesser drones and Facehuggers cannot speak, custom emote, or point for 3 minutes after spawning /:cl: --------- Co-authored-by: John Doe <[email protected]>
- Loading branch information
1 parent
fe2f2b8
commit f0251fe
Showing
9 changed files
with
154 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/datum/component/temporary_mute | ||
dupe_mode = COMPONENT_DUPE_UNIQUE | ||
/// A message to tell the user when they attempt to speak, if any | ||
var/on_speak_message = "" | ||
/// A message to tell the user when they attempt to emote, if any | ||
var/on_emote_message = "" | ||
/// A message to tell the user when they become no longer mute, if any | ||
var/on_unmute_message = "" | ||
/// How long after the component's initialization it should be deleted. -1 means it will never delete | ||
var/time_until_unmute = 3 MINUTES | ||
|
||
/datum/component/temporary_mute/Initialize(on_speak_message = "", on_emote_message = "", on_unmute_message = "", time_until_unmute = 3 MINUTES) | ||
. = ..() | ||
if(!ismob(parent)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
src.on_speak_message = on_speak_message | ||
src.on_emote_message = on_emote_message | ||
src.on_unmute_message = on_unmute_message | ||
src.time_until_unmute = time_until_unmute | ||
if(time_until_unmute != -1) | ||
QDEL_IN(src, time_until_unmute) | ||
|
||
/datum/component/temporary_mute/RegisterWithParent() | ||
..() | ||
RegisterSignal(parent, COMSIG_LIVING_SPEAK, PROC_REF(on_speak)) | ||
RegisterSignal(parent, COMSIG_XENO_TRY_HIVEMIND_TALK, PROC_REF(on_hivemind)) | ||
RegisterSignal(parent, COMSIG_MOB_TRY_EMOTE, PROC_REF(on_emote)) | ||
RegisterSignal(parent, COMSIG_MOB_TRY_POINT, PROC_REF(on_point)) | ||
|
||
/datum/component/temporary_mute/UnregisterFromParent() | ||
..() | ||
if(parent) | ||
UnregisterSignal(parent, COMSIG_LIVING_SPEAK) | ||
UnregisterSignal(parent, COMSIG_XENO_TRY_HIVEMIND_TALK) | ||
UnregisterSignal(parent, COMSIG_MOB_TRY_EMOTE) | ||
UnregisterSignal(parent, COMSIG_MOB_TRY_POINT) | ||
if(on_unmute_message) | ||
to_chat(parent, SPAN_NOTICE(on_unmute_message)) | ||
|
||
/datum/component/temporary_mute/proc/on_speak( | ||
mob/user, | ||
message, | ||
datum/language/speaking = null, | ||
verb = "says", | ||
alt_name = "", | ||
italics = FALSE, | ||
message_range = GLOB.world_view_size, | ||
sound/speech_sound, | ||
sound_vol, | ||
nolog = FALSE, | ||
message_mode = null | ||
) | ||
SIGNAL_HANDLER | ||
|
||
if(!nolog) | ||
log_say("[user.name != "Unknown" ? user.name : "([user.real_name])"] attempted to say the following before their spawn mute ended: [message] (CKEY: [user.key]) (JOB: [user.job])") | ||
if(on_speak_message) | ||
to_chat(parent, SPAN_BOLDNOTICE(on_speak_message)) | ||
return COMPONENT_OVERRIDE_SPEAK | ||
|
||
/datum/component/temporary_mute/proc/on_hivemind(mob/user, message) | ||
SIGNAL_HANDLER | ||
|
||
log_say("[user.name != "Unknown" ? user.name : "([user.real_name])"] attempted to hivemind the following before their spawn mute ended: [message] (CKEY: [user.key]) (JOB: [user.job])") | ||
if(on_speak_message) | ||
to_chat(parent, SPAN_BOLDNOTICE(on_speak_message)) | ||
return COMPONENT_OVERRIDE_HIVEMIND_TALK | ||
|
||
/datum/component/temporary_mute/proc/on_emote(mob/user, datum/emote/current_emote, act, m_type, param, intentional) | ||
SIGNAL_HANDLER | ||
|
||
// Allow involuntary emotes or non-custom emotes | ||
if(!intentional) | ||
return | ||
if(!param && !istype(current_emote, /datum/emote/custom)) | ||
return | ||
|
||
log_say("[user.name != "Unknown" ? user.name : "([user.real_name])"] attempted to emote the following before their spawn mute ended: [param] (CKEY: [user.key]) (JOB: [user.job])") | ||
if(on_emote_message) | ||
to_chat(parent, SPAN_BOLDNOTICE(on_emote_message)) | ||
return COMPONENT_OVERRIDE_EMOTE | ||
|
||
/datum/component/temporary_mute/proc/on_point(mob/user, atom/target) | ||
SIGNAL_HANDLER | ||
|
||
log_say("[user.name != "Unknown" ? user.name : "([user.real_name])"] attempted to point at the following before their spawn mute ended: [target] (CKEY: [user.key]) (JOB: [user.job])") | ||
if(on_emote_message) | ||
to_chat(parent, SPAN_BOLDNOTICE(on_emote_message)) | ||
return COMPONENT_OVERRIDE_POINT |
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