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

Lesser drones and facehuggers cannot speak for 3 minutes after spawning #5352

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 45 additions & 0 deletions code/datums/components/temporary_mute.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/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 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 = 5 MINUTES

/datum/component/temporary_mute/Initialize(on_speak_message = "", on_unmute_message = "", time_until_unmute = 5 MINUTES)
. = ..()
if(!ismob(parent))
return COMPONENT_INCOMPATIBLE

src.on_speak_message = on_speak_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))

/datum/component/temporary_mute/UnregisterFromParent()
..()
if(parent)
to_chat(parent, SPAN_NOTICE(on_unmute_message))
UnregisterSignal(parent, COMSIG_LIVING_SPEAK)

/datum/component/temporary_mute/proc/on_speak(
Zonespace27 marked this conversation as resolved.
Show resolved Hide resolved
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
)
to_chat(parent, SPAN_BOLDNOTICE(on_speak_message))
Zonespace27 marked this conversation as resolved.
Show resolved Hide resolved
return COMPONENT_OVERRIDE_SPEAK
9 changes: 9 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@
weed_food_states = list("Facehugger_1","Facehugger_2","Facehugger_3")
weed_food_states_flipped = list("Facehugger_1","Facehugger_2","Facehugger_3")

/mob/living/carbon/xenomorph/facehugger/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, hivenumber)
Zonespace27 marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
AddComponent(\
/datum/component/temporary_mute,\
"We aren't old enough to vocalize anything yet.",\
"We feel old enough to be able to vocalize and speak to the hivemind.",\
3 MINUTES,\
)

/mob/living/carbon/xenomorph/facehugger/initialize_pass_flags(datum/pass_flags_container/PF)
..()
if (PF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
weed_food_states = list("Lesser_Drone_1","Lesser_Drone_2","Lesser_Drone_3")
weed_food_states_flipped = list("Lesser_Drone_1","Lesser_Drone_2","Lesser_Drone_3")

/mob/living/carbon/xenomorph/lesser_drone/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, hivenumber)
Zonespace27 marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
AddComponent(\
/datum/component/temporary_mute,\
"We aren't old enough to vocalize anything yet.",\
"We feel old enough to be able to vocalize and speak to the hivemind.",\
3 MINUTES,\
)

/mob/living/carbon/xenomorph/lesser_drone/age_xeno()
if(stat == DEAD || !caste || QDELETED(src) || !client)
return
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
#include "code\datums\components\overlay_lighting.dm"
#include "code\datums\components\rename.dm"
#include "code\datums\components\speed_modifier.dm"
#include "code\datums\components\temporary_mute.dm"
#include "code\datums\components\toxin_buildup.dm"
#include "code\datums\components\tutorial_status.dm"
#include "code\datums\components\weed_damage_reduction.dm"
Expand Down
Loading