Skip to content

Commit

Permalink
Merge pull request #252 from Kwask/master
Browse files Browse the repository at this point in the history
Adding animal sounds
  • Loading branch information
Kwask committed Aug 18, 2015
2 parents 729e466 + cef0172 commit b69c001
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 44 deletions.
4 changes: 4 additions & 0 deletions apollo.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1195,12 +1195,16 @@
#include "code\modules\mob\living\carbon\human\species\species.dm"
#include "code\modules\mob\living\carbon\human\species\species_attack.dm"
#include "code\modules\mob\living\carbon\human\species\species_hud.dm"
#include "code\modules\mob\living\carbon\human\species\species_sounds.dm"
#include "code\modules\mob\living\carbon\human\species\outsider\shadow.dm"
#include "code\modules\mob\living\carbon\human\species\outsider\vox.dm"
#include "code\modules\mob\living\carbon\human\species\station\golem.dm"
#include "code\modules\mob\living\carbon\human\species\station\monkey.dm"
#include "code\modules\mob\living\carbon\human\species\station\slime.dm"
#include "code\modules\mob\living\carbon\human\species\station\station.dm"
#include "code\modules\mob\living\carbon\human\species\station\sounds\human.dm"
#include "code\modules\mob\living\carbon\human\species\station\sounds\monkey.dm"
#include "code\modules\mob\living\carbon\human\species\station\sounds\robot.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_embryo.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_facehugger.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_powers.dm"
Expand Down
56 changes: 14 additions & 42 deletions code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,9 @@
m_type = 1
else
if (!muzzled)
var/scream_sound

if( gender == "male" )
scream_sound = pick(\
'sound/voice/cough01_man.ogg',
'sound/voice/cough02_man.ogg',
'sound/voice/cough03_man.ogg')
else if( gender == "female" )
scream_sound = pick(\
'sound/voice/cough01_woman.ogg',
'sound/voice/cough02_woman.ogg',
'sound/voice/cough03_woman.ogg')

playsound(loc, scream_sound, 80, 1)
var/emote_sound = species.voice_sounds.getCough( gender )
if( emote_sound )
playsound(loc, emote_sound, 8, species.mod_sound )

message = "<B>[src]</B> coughs!"
m_type = 2
Expand Down Expand Up @@ -220,21 +209,11 @@
else
if (!muzzled)
message = "<B>[src]</B> gasps!"
var/gasp_sound = null
if( istype( type, /mob/living/silicon ) || get_species() == "Machine" )
gasp_sound = 'sound/voice/rscream1.ogg'
message = "<B>[src]</B> plays gasp.ogg"
else
if( gender == "male" )
gasp_sound = pick(\
'sound/voice/gasp01_male.ogg',
'sound/voice/gasp02_male.ogg' )
else if( gender == "female" )
gasp_sound = pick(\
'sound/voice/gasp01_female.ogg',
'sound/voice/gasp02_female.ogg' )
if( gasp_sound )
playsound(loc, gasp_sound, 50, 1)

var/emote_sound = species.voice_sounds.getGasp( gender )
if( emote_sound )
playsound(loc, emote_sound, 80, species.mod_sound )

m_type = 2
else
message = "<B>[src]</B> makes a weak noise."
Expand Down Expand Up @@ -570,21 +549,14 @@
else
if (!muzzled)
message = "<B>[src]</B> screams!"
var/scream_sound

var/emote_sound = species.voice_sounds.getScream( gender )
if( emote_sound )
playsound(loc, emote_sound, 80, species.mod_sound )

if( istype( type, /mob/living/silicon ) || get_species() == "Machine" )
scream_sound = 'sound/voice/rscream1.ogg'
message = "<B>[src]</B> plays scream.ogg"
else
if( gender == "male" )
scream_sound = pick(\
'sound/voice/mscream1.ogg',
'sound/voice/mscream2.ogg',
'sound/voice/mscream3.ogg')
else if( gender == "female" )
scream_sound = 'sound/voice/wscream1.ogg'

playsound(loc, scream_sound, 80, 1)
message = "<B>[src]</B> plays scream.mp3"

m_type = 2
else
message = "<B>[src]</B> makes a very loud noise."
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
var/secondary_langs = list() // The names of secondary languages that are available to this species.
var/list/speech_sounds // A list of sounds to potentially play when speaking.
var/list/speech_chance // The likelihood of a speech sound playing.
var/datum/species_sounds/voice_sounds = new /datum/species_sounds/human
var/mod_sound = 1 // Should the sounds made by this creature be modulated?

// Combat vars.
var/total_health = 100 // Point at which the mob will enter crit.
Expand Down
30 changes: 30 additions & 0 deletions code/modules/mob/living/carbon/human/species/species_sounds.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/datum/species_sounds
var/list/m_scream = null
var/list/f_scream = null

var/list/m_gasp = null
var/list/f_gasp = null

var/list/m_cough = null
var/list/f_cough = null

/datum/species_sounds/proc/getScream( var/gender = null )
if( gender == FEMALE && f_scream )
return pick( f_scream )

if( m_scream ) // male screams are default, down with the patriarchy
return pick( m_scream )

/datum/species_sounds/proc/getGasp( var/gender = null )
if( gender == FEMALE && f_gasp )
return pick( f_gasp )

if( m_gasp )
return pick( m_gasp )

/datum/species_sounds/proc/getCough( var/gender = null )
if( gender == FEMALE && f_cough )
return pick( f_cough )

if( m_cough )
return pick( m_cough )
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
death_message = "lets out a faint chimper as it collapses and stops moving..."
tail = "chimptail"

voice_sounds = new /datum/species_sounds/monkey
mod_sound = 0

unarmed_types = list(/datum/unarmed_attack/bite, /datum/unarmed_attack/claws)
inherent_verbs = list(/mob/living/proc/ventcrawl)
hud_type = /datum/hud_data/monkey
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/datum/species_sounds/human
m_scream = list( 'sound/voice/mscream1.ogg',
'sound/voice/mscream2.ogg',
'sound/voice/mscream3.ogg' )
f_scream = list( 'sound/voice/fscream1.ogg' )

m_cough = list( 'sound/voice/cough01_man.ogg',
'sound/voice/cough02_man.ogg',
'sound/voice/cough03_man.ogg')
f_cough = list( 'sound/voice/cough01_woman.ogg',
'sound/voice/cough02_woman.ogg',
'sound/voice/cough03_woman.ogg')

m_gasp = list( 'sound/voice/gasp01_male.ogg',
'sound/voice/gasp02_male.ogg' )

f_gasp = list( 'sound/voice/gasp01_female.ogg',
'sound/voice/gasp02_female.ogg' )
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/species_sounds/monkey
m_scream = list( 'sound/voice/monkey/chimpanzee_scream1.ogg' )

m_gasp = list( 'sound/voice/monkey/chimpanzee_chimper1.ogg',
'sound/voice/monkey/chimpanzee_chimper2.ogg',
'sound/voice/monkey/chimpanzee_whimper1.ogg' )
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/datum/species_sounds/robot
m_scream = list( 'sound/voice/rscream1.ogg' )
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
unarmed_types = list(/datum/unarmed_attack/punch)
rarity_value = 2

voice_sounds = new /datum/species_sounds/robot

eyes = "blank_eyes"
brute_mod = 0.75
burn_mod = 1
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/simple_animal/friendly/dog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

speak = list("Woof!", "Bark!")
speak_emote = list("barks", "woofs")
speak_emote_sound = list("barks" = 'sound/voice/dog/bark1.ogg', "woofs" = 'sound/voice/dog/bark2.ogg')
emote_hear = list("barks", "woofs","pants")
emote_hear = list("barks" = 'sound/voice/dog/bark1.ogg', "woofs" = 'sound/voice/dog/bark2.ogg')
emote_see = list("shakes its head", "shivers")
speak_chance = 1
turns_per_move = 10
Expand Down
10 changes: 9 additions & 1 deletion code/modules/mob/living/simple_animal/friendly/farm_animals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
icon_dead = "goat_dead"
speak = list("EHEHEHEHEH","eh?")
speak_emote = list("brays")
speak_emote_sound = list( "brays" = 'sound/voice/goat/bray1.ogg' )
emote_hear = list("brays")
emote_hear_sound = list( "brays" = 'sound/voice/goat/bray1.ogg' )
emote_see = list("shakes its head", "stamps a foot", "glares around")
speak_chance = 1
turns_per_move = 5
Expand Down Expand Up @@ -96,7 +98,9 @@
icon_gib = "cow_gib"
speak = list("moo?","moo","MOOOOOO")
speak_emote = list("moos","moos hauntingly")
emote_hear = list("brays")
speak_emote_sound = list( "moos" = 'sound/voice/cow/moo2.ogg', "moos hauntingly" = 'sound/voice/cow/moo1.ogg' )
emote_hear = list("moos")
emote_hear_sound = list( "moos" = 'sound/voice/cow/moo2.ogg' )
emote_see = list("shakes its head")
speak_chance = 1
turns_per_move = 5
Expand Down Expand Up @@ -158,7 +162,9 @@
icon_gib = "chick_gib"
speak = list("Cherp.","Cherp?","Chirrup.","Cheep!")
speak_emote = list("cheeps")
speak_emote_sound = list( "cheeps" = 'sound/voice/chicken/cheep1.ogg' )
emote_hear = list("cheeps")
emote_hear_sound = list( "cheeps" = 'sound/voice/chicken/cheep1.ogg' )
emote_see = list("pecks at the ground","flaps its tiny wings")
speak_chance = 2
turns_per_move = 2
Expand Down Expand Up @@ -199,7 +205,9 @@ var/global/chicken_count = 0
icon_dead = "chicken_dead"
speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.")
speak_emote = list("clucks","croons")
speak_emote_sound = list( "clucks" = 'sound/voice/chicken/cluck1.ogg', "croons" = 'sound/voice/chicken/croon1.ogg' )
emote_hear = list("clucks")
emote_hear_sound = list( "clucks" = 'sound/voice/chicken/cluck1.ogg' )
emote_see = list("pecks at the ground","flaps its wings viciously")
speak_chance = 2
turns_per_move = 3
Expand Down
13 changes: 12 additions & 1 deletion code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
var/icon_gib = null //We only try to show a gibbing animation if this exists.

var/list/speak = list()
var/list/speak_emote_sound = list()
var/speak_chance = 0
var/list/emote_hear = list() //Hearable emotes
var/list/emote_hear_sound = list() // Accompanying sounds for hearable emotes
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps

var/turns_per_move = 1
Expand Down Expand Up @@ -120,7 +122,12 @@
if(emote_see && randomValue <= emote_see.len)
visible_emote("[pick(emote_see)].")
else
audible_emote("[pick(emote_hear)].")
var/emoted = pick(emote_hear)

audible_emote("[emoted].")
if( emote_hear_sound["[emoted]"] )
playsound(src, emote_hear_sound["[emoted]"], 100)

else
say(pick(speak))
else
Expand Down Expand Up @@ -374,8 +381,12 @@
if(speak_emote.len)
verb = pick(speak_emote)


message = capitalize(trim_left(message))

if( speak_emote_sound["[verb]"] )
playsound(src, speak_emote_sound["[verb]"], 100)

..(message, null, verb, nolog = !ckey) //if the animal has a ckey then it will log the message

/mob/living/simple_animal/put_in_hands(var/obj/item/W) // No hands.
Expand Down
Binary file added sound/voice/chicken/cheep1.ogg
Binary file not shown.
Binary file added sound/voice/chicken/cluck1.ogg
Binary file not shown.
Binary file added sound/voice/chicken/croon1.ogg
Binary file not shown.
Binary file added sound/voice/cow/moo2.ogg
Binary file not shown.
File renamed without changes.
Binary file added sound/voice/goat/bray1.ogg
Binary file not shown.
Binary file modified sound/voice/monkey/chimpanzee_scream1.ogg
Binary file not shown.

0 comments on commit b69c001

Please sign in to comment.