mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-24 21:57:53 +01:00
Update 1.0
Refactors lists into #defines, promptly cries. This part is agony and still worked on. Simplemobs can play injury sounds as well, selecting a sound based off a global list. Pain emotes occur based on updatehealth(), with respect to silicons and such. Pain emotes also occur at a 60% chance on traumatic shock. Simplemobs can also play death sounds based off the species sounds lists. Add Mouse, Robotic, Spider, None as options to the voice list. Fixes runtime/bug with Silicons (borgs) trying to get species var.
This commit is contained in:
@@ -7,28 +7,57 @@
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
return "You [pick(H.species.pain_verb_1p)] in pain!"
|
||||
else
|
||||
var/mob/living/M = user
|
||||
if(M.pain_emote_1p) // Sanity
|
||||
return "You [pick(M.pain_emote_1p)]!"
|
||||
. = ..()
|
||||
|
||||
/decl/emote/audible/pain/get_emote_message_3p(var/atom/user, var/atom/target, var/extra_params)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
return "[pick(H.species.pain_verb_3p)] in pain!"
|
||||
else
|
||||
var/mob/living/M = user
|
||||
if(M.pain_emote_3p) // Sanity
|
||||
return "[pick(M.pain_emote_3p)]!"
|
||||
. = ..()
|
||||
|
||||
/decl/emote/audible/pain/get_emote_sound(var/atom/user)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.get_gender() == FEMALE)
|
||||
return list(
|
||||
"sound" = H.species.female_pain_sound,
|
||||
"vol" = 60,
|
||||
"exr" = 10,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.get_gender() == FEMALE)
|
||||
return list(
|
||||
"sound" = H.species.female_pain_sound,
|
||||
"vol" = 60,
|
||||
"exr" = 10,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
else
|
||||
return list(
|
||||
"sound" = H.species.male_pain_sound,
|
||||
"vol" = 60,
|
||||
"exr" = 10,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
else
|
||||
return list(
|
||||
"sound" = H.species.male_pain_sound,
|
||||
"vol" = 60,
|
||||
"exr" = 10,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
var/mob/living/M = user
|
||||
if((M.get_gender() == FEMALE) && M.female_pain_sound) // If our mob has custom sounds per-gender defined, most won't.
|
||||
return list(
|
||||
"sound" = M.female_pain_sound,
|
||||
"vol" = 80,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
else if((M.get_gender() == MALE) && M.male_pain_sound) // If our mob has custom sounds per-gender defined, most won't.
|
||||
return list(
|
||||
"sound" = M.male_pain_sound,
|
||||
"vol" = 80,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
else
|
||||
return list(
|
||||
"sound" = M.pain_sound,
|
||||
"vol" = 80,
|
||||
"volchannel" = VOLUME_CHANNEL_INJ_DEATH
|
||||
)
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
var/digi_allowed = FALSE
|
||||
var/vanity_base_fit //when shapeshifting using vanity_copy_to, this allows you to have add something so they can go back to their original species fit
|
||||
|
||||
male_scream_sound = list('modular_chomp/sound/voice/scream/generic/male/male_scream_1.ogg', 'modular_chomp/sound/voice/scream/generic/male/male_scream_2.ogg', 'modular_chomp/sound/voice/scream/generic/male/male_scream_3.ogg', 'modular_chomp/sound/voice/scream/generic/male/male_scream_4.ogg', 'modular_chomp/sound/voice/scream/generic/male/male_scream_5.ogg', 'modular_chomp/sound/voice/scream/generic/male/male_scream_6.ogg')
|
||||
female_scream_sound = list('modular_chomp/sound/voice/scream/generic/female/female_scream_1.ogg', 'modular_chomp/sound/voice/scream/generic/female/female_scream_2.ogg', 'modular_chomp/sound/voice/scream/generic/female/female_scream_3.ogg', 'modular_chomp/sound/voice/scream/generic/female/female_scream_4.ogg', 'modular_chomp/sound/voice/scream/generic/female/female_scream_5.ogg')
|
||||
var/male_gasp_sound = list('modular_chomp/sound/voice/gasp/generic/male/male_gasp1.ogg', 'modular_chomp/sound/voice/gasp/generic/male/male_gasp2.ogg', 'modular_chomp/sound/voice/gasp/generic/male/male_gasp3.ogg')
|
||||
var/female_gasp_sound = list('modular_chomp/sound/voice/gasp/generic/female/female_gasp1.ogg', 'modular_chomp/sound/voice/gasp/generic/female/female_gasp2.ogg')
|
||||
var/male_pain_sound = list('modular_chomp/sound/voice/pain/generic/male/male_pain_1.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_2.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_3.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_4.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_5.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_6.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_7.ogg', 'modular_chomp/sound/voice/pain/generic/male/male_pain_8.ogg')
|
||||
var/female_pain_sound = list('modular_chomp/sound/voice/pain/generic/female/female_pain_1.ogg', 'modular_chomp/sound/voice/pain/generic/female/female_pain_2.ogg', 'modular_chomp/sound/voice/pain/generic/female/female_pain_3.ogg')
|
||||
var/male_death_sound = list('modular_chomp/sound/voice/death/generic/male/male_death_1.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_2.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_3.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_4.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_5.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_6.ogg', 'modular_chomp/sound/voice/death/generic/male/male_death_7.ogg')
|
||||
var/female_death_sound = list('modular_chomp/sound/voice/death/generic/female/female_death_1.ogg', 'modular_chomp/sound/voice/death/generic/female/female_death_2.ogg', 'modular_chomp/sound/voice/death/generic/female/female_death_3.ogg', 'modular_chomp/sound/voice/death/generic/female/female_death_4.ogg', 'modular_chomp/sound/voice/death/generic/female/female_death_5.ogg', 'modular_chomp/sound/voice/death/generic/female/female_death_6.ogg')
|
||||
var/species_sounds
|
||||
|
||||
male_scream_sound = null
|
||||
female_scream_sound = null
|
||||
var/male_gasp_sound = null
|
||||
var/female_gasp_sound = null
|
||||
var/male_pain_sound = null
|
||||
var/female_pain_sound = null
|
||||
var/male_death_sound = null
|
||||
var/female_death_sound = null
|
||||
|
||||
// Handles non-standard eyes when using a species that utilizes a custom base icon set.
|
||||
// Eye data is stored in the head organ, and this needs to be handled specially.
|
||||
@@ -59,3 +61,14 @@
|
||||
for(var/datum/trait/env_trait in env_traits)
|
||||
env_trait.handle_environment_special(H)
|
||||
return
|
||||
|
||||
/datum/species/New()
|
||||
male_scream_sound = get_species_sound(male_generic_sounds["scream"])
|
||||
female_scream_sound = get_species_sound(female_generic_sounds["scream"])
|
||||
male_gasp_sound = get_species_sound(male_generic_sounds["gasp"])
|
||||
female_gasp_sound = get_species_sound(female_generic_sounds["gasp"])
|
||||
male_pain_sound = get_species_sound(male_generic_sounds["pain"])
|
||||
female_pain_sound = get_species_sound(female_generic_sounds["pain"])
|
||||
male_death_sound = get_species_sound(male_generic_sounds["death"])
|
||||
female_death_sound = get_species_sound(female_generic_sounds["death"])
|
||||
..()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/datum/species/proc/copy_species_sounds(var/datum/species/S, var/species_sounds, var/custom_base)
|
||||
switch(species_sounds)
|
||||
get_species_sound(species_sounds)
|
||||
if("Canine")
|
||||
S.male_scream_sound = canine_scream_sounds
|
||||
S.female_scream_sound = canine_scream_sounds
|
||||
@@ -36,8 +37,21 @@
|
||||
S.female_pain_sound = female_generic_pain_sounds
|
||||
S.male_death_sound = male_generic_death_sounds
|
||||
S.female_death_sound = female_generic_death_sounds
|
||||
if("Robotic")
|
||||
S.male_scream_sound = robot_scream_sounds
|
||||
S.female_scream_sound = robot_scream_sounds
|
||||
S.male_gasp_sound = null
|
||||
S.female_gasp_sound = null
|
||||
S.male_pain_sound = robot_pain_sounds
|
||||
S.female_pain_sound = robot_pain_sounds
|
||||
S.male_death_sound = robot_death_sounds
|
||||
S.female_death_sound = robot_death_sounds
|
||||
if("Unset") // If our users haven't set anything, pick the sounds based off our custom base - Vulp gets canine, etc etc.
|
||||
var/datum/species/os = GLOB.all_species[custom_base]
|
||||
var/datum/species/os
|
||||
if(!custom_base) // Safety
|
||||
os = base_species
|
||||
else
|
||||
os = GLOB.all_species[custom_base]
|
||||
S.male_scream_sound = os.male_scream_sound
|
||||
S.female_scream_sound = os.female_scream_sound
|
||||
S.male_gasp_sound = os.male_gasp_sound
|
||||
@@ -46,3 +60,12 @@
|
||||
S.female_pain_sound = os.female_pain_sound
|
||||
S.male_death_sound = os.male_death_sound
|
||||
S.female_death_sound = os.female_death_sound
|
||||
if("None") // If our users intentionally want no sounds
|
||||
S.male_scream_sound = null
|
||||
S.female_scream_sound = null
|
||||
S.male_gasp_sound = null
|
||||
S.female_gasp_sound = null
|
||||
S.male_pain_sound = null
|
||||
S.female_pain_sound = null
|
||||
S.male_death_sound = null
|
||||
S.female_death_sound = null
|
||||
|
||||
@@ -14,4 +14,25 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
|
||||
/mob/living/New(var/newloc)
|
||||
..()
|
||||
verbs |= /mob/living/proc/click_self
|
||||
*/
|
||||
*/
|
||||
|
||||
/mob/living
|
||||
/* TL;DR - the following is a lot of copypasta, but allows us to give simplemobs pain and death sounds.
|
||||
* Different from carbons, where we check species, here we just check on the mob itself.
|
||||
* TBD: Maybe port over from species to mob?
|
||||
*/
|
||||
var/can_pain_emote = TRUE
|
||||
var/pain_sound = null
|
||||
var/female_pain_sound = null
|
||||
var/male_pain_sound = null
|
||||
var/pain_emote_1p = null
|
||||
var/pain_emote_3p = null
|
||||
/* // Not sure if needed, screams aren't a carbon thing rn.
|
||||
var/scream_sound = null
|
||||
var/female_scream_sound = null
|
||||
var/male_scream_sound = null
|
||||
var/scream_emote = null
|
||||
*/
|
||||
var/death_sound = null
|
||||
var/male_death_sound = null
|
||||
var/female_death_sound = null
|
||||
|
||||
Reference in New Issue
Block a user