Skip to content

Commit

Permalink
Add TRAIT_TEMPORARILY_ MUTED to check if we send a hive message on death
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Feb 18, 2024
1 parent 3d4ac1c commit 5e090de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@
#define TRAIT_DAZED "dazed"
/// Apply this to identify a mob as merged with weeds
#define TRAIT_MERGED_WITH_WEEDS "merged_with_weeds"
/// Apply this to identify a mob as temporarily muted
#define TRAIT_TEMPORARILY_MUTED "temporarily_muted"

// SPECIES TRAITS
/// Knowledge of Yautja technology
Expand Down Expand Up @@ -422,6 +424,8 @@ GLOBAL_LIST(trait_name_map)
///Status trait coming from ability
#define TRAIT_SOURCE_ABILITY(ability) "t_s_ability_[ability]"
#define TRAIT_SOURCE_LIMB(limb) "t_s_limb_[limb]"
///Status trait coming from temporary_mute
#define TRAIT_SOURCE_TEMPORARY_MUTE "t_s_temporary_mute"
///Status trait forced by the xeno action charge
#define TRAIT_SOURCE_XENO_ACTION_CHARGE "t_s_xeno_action_charge"
///Status trait coming from a xeno nest
Expand Down
2 changes: 2 additions & 0 deletions code/datums/components/temporary_mute.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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))
ADD_TRAIT(parent, TRAIT_TEMPORARILY_MUTED, TRAIT_SOURCE_TEMPORARY_MUTE)

/datum/component/temporary_mute/UnregisterFromParent()
..()
Expand All @@ -37,6 +38,7 @@
UnregisterSignal(parent, COMSIG_MOB_TRY_POINT)
if(on_unmute_message)
to_chat(parent, SPAN_NOTICE(on_unmute_message))
REMOVE_TRAIT(parent, TRAIT_TEMPORARILY_MUTED, TRAIT_SOURCE_TEMPORARY_MUTE)

/datum/component/temporary_mute/proc/on_speak(
mob/user,
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
playsound(loc, prob(50) == 1 ? 'sound/voice/alien_death.ogg' : 'sound/voice/alien_death2.ogg', 25, 1)
var/area/A = get_area(src)
if(hive && hive.living_xeno_queen)
xeno_message("Hive: [src] has <b>died</b>[A? " at [sanitize_area(A.name)]":""]! [banished ? "They were banished from the hive." : ""]", death_fontsize, hivenumber)
if(!HAS_TRAIT(src, TRAIT_TEMPORARILY_MUTED))
xeno_message("Hive: [src] has <b>died</b>[A? " at [sanitize_area(A.name)]":""]! [banished ? "They were banished from the hive." : ""]", death_fontsize, hivenumber)

if(hive && IS_XENO_LEADER(src)) //Strip them from the Xeno leader list, if they are indexed in here
hive.remove_hive_leader(src)
Expand Down

0 comments on commit 5e090de

Please sign in to comment.