Skip to content

Commit

Permalink
Added animal sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwask committed Aug 18, 2015
1 parent cea6e90 commit cef0172
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 2 deletions.
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.
Binary file added sound/voice/goat/bray1.ogg
Binary file not shown.

0 comments on commit cef0172

Please sign in to comment.