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

[MIRROR] Wearing Hailer gives unique death SFX #335

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions code/modules/clothing/masks/_masks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/voice_override
/// If set to true, activates the radio effect on TTS. Used for sec hailers, but other masks can utilize it for their own vocal effect.
var/use_radio_beeps_tts = FALSE
/// The unique sound effect of dying while wearing this
var/unique_death

/obj/item/clothing/mask/attack_self(mob/user)
if((clothing_flags & VOICEBOX_TOGGLABLE))
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/masks/hailer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ GLOBAL_LIST_INIT(hailer_phrases, list(
visor_flags_cover = MASKCOVERSMOUTH
tint = 0
has_fov = FALSE
unique_death = 'sound/voice/sec_death.ogg'
COOLDOWN_DECLARE(hailer_cooldown)
///Decides the phrases available for use; defines used are the last index of a category of available phrases
var/aggressiveness = AGGR_BAD_COP
Expand Down
11 changes: 8 additions & 3 deletions code/modules/mob/living/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@
message_animal_or_basic = custom_message
. = ..()
message_animal_or_basic = initial(message_animal_or_basic)
if(. && user.death_sound)
if(!user.can_speak() || user.oxyloss >= 50)
return //stop the sound if oxyloss too high/cant speak
if(!. && !user.can_speak() || user.getOxyLoss() >= 50)
return //stop the sound if oxyloss too high/cant speak
var/mob/living/carbon/carbon_user = user
// For masks that give unique death sounds
if(istype(carbon_user) && isclothing(carbon_user.wear_mask) && carbon_user.wear_mask.unique_death)
playsound(carbon_user, carbon_user.wear_mask.unique_death, 200, TRUE, TRUE)
return
if(user.death_sound)
playsound(user, user.death_sound, 200, TRUE, TRUE)

/datum/emote/living/drool
Expand Down
Binary file added sound/voice/sec_death.ogg
Binary file not shown.
Loading