From 1af249754e297f67b8ded3beebdff2e24611b569 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 11 Nov 2015 21:39:15 -0800 Subject: [PATCH] enabled sounds. --- desktop/src-common/advent/screens/rooms/cat_tree.clj | 2 ++ .../src-common/advent/screens/rooms/outside_house.clj | 3 ++- desktop/src-common/advent/screens/rooms/space.clj | 6 +++++- desktop/src-common/advent/screens/scene.clj | 11 +++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index bef2ecd5..6cfadfc1 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -385,7 +385,9 @@ :anim owl-stand :anim-start 0 :night-profile :none + :puke-sound (utils/load-sound "cat-tree/owl-puke.ogg") :script (actions/get-script entities (talk-to-owl entities)) + :anim-sound-frames {owl-puke {9 [:puke-sound (constantly 0.6)]}} :scripts #(condp = % :monocle (actions/get-script entities (give-monocle entities)) (actions/get-script entities diff --git a/desktop/src-common/advent/screens/rooms/outside_house.clj b/desktop/src-common/advent/screens/rooms/outside_house.clj index cc5db889..883ca536 100644 --- a/desktop/src-common/advent/screens/rooms/outside_house.clj +++ b/desktop/src-common/advent/screens/rooms/outside_house.clj @@ -136,7 +136,8 @@ :bloodclot-head "Any final words before I destroy you again?") (actions/play-animation entities :ego :scared :continue? true) (Thread/sleep 500) - (actions/walk-straight-to entities :ego [35 45] :override-dir :right :speed 3.0)))) + (actions/walk-straight-to entities :ego [35 45] :override-dir :right :speed 3.0)) + (actions/talk entities :ego "I don't think it's ready yet."))) :broken-clock (actions/get-script entities (if (actions/has-item? entities :note-2) (do diff --git a/desktop/src-common/advent/screens/rooms/space.clj b/desktop/src-common/advent/screens/rooms/space.clj index e3b710d8..e93c1a60 100644 --- a/desktop/src-common/advent/screens/rooms/space.clj +++ b/desktop/src-common/advent/screens/rooms/space.clj @@ -185,7 +185,7 @@ bloodclot-head-stand-anim (utils/make-anim-seq "space/bloodclot-head-talk" [82 75] 0.05 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 4 3]) bloodclot-head-shoot-anim (utils/make-anim-seq "space/bloodclot-head-talk" [82 75] 0.05 [8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 10 11 10 11 10 11 10 11 10 11 10 11]) bloodclot-head-keep-shoot-anim (utils/make-anim-seq "space/bloodclot-head-talk" [82 75] 0.05 [12 13]) - blergh-stand-anim (utils/make-anim "space/bloodclot-stand.png" [106 165] 0.75 [0 1]) + blergh-stand-anim (utils/make-anim "space/bloodclot-stand.png" [106 165] 0.9 [0 1]) bloodclot-explode (utils/make-anim-seq "space/bloodclot-explode" [106 165] 0.075 [0 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 4 4 4 4 5 5 5 5 5 4 4 4 4 5 5 4 4 4 4 5 5 5 4 5 5 5 5 5 5 5 5 6 5 5 5 5 6 6 5 5 5 5 5 5 5 6 6 6 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 7 6 7 7 5 6 6 6 6 6 7 7 7 7 6 6 6 6 6 6 6 6 6 6 7 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 10 11 12 13 14 15 16 17 18 19]) bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7]) effect (particle-effect "particles/appear") @@ -232,6 +232,10 @@ :bloodclot (assoc (animation->texture screen blergh-stand-anim) :x 180 :y 50 :baseline 190 :stand blergh-stand-anim + :inhale-sound (utils/load-sound "space/bloodclot-inhale.ogg") + :exhale-sound (utils/load-sound "space/bloodclot-exhale.ogg") + :anim-sound-frames {blergh-stand-anim {0 [:inhale-sound (constantly 0.3)] + 1 [:exhale-sound (constantly 0.3)]}} :opacity 0.0 :anim blergh-stand-anim :anim-start 0 diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 89b7cca9..5bec70b6 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -711,7 +711,7 @@ void main () 110 [:blink 0.15] 143 [:blink 0.15] 176 [:blink 0.15] - 200 [:scratch-sound 0.2] + 200 [:scratch-sound 0.15] } (get-in ego [:right :stand]) {11 [:blink 0.15] @@ -720,7 +720,7 @@ void main () 110 [:blink 0.15] 143 [:blink 0.15] 176 [:blink 0.15] - 200 [:scratch-sound 0.2] + 200 [:scratch-sound 0.15] } (get-in ego [:left :sigh]) {3 [:sigh-sound 0.4]} (get-in ego [:right :sigh]) {3 [:sigh-sound 0.4]} @@ -870,10 +870,13 @@ void main () (if-let [[snd vol-scale pitch] (get-in anim-sound-frames [anim current-frame-index])] (let [snd (if (fn? snd) (snd entities) - snd)] + snd) + vol-scale (if (fn? vol-scale) + vol-scale + (utils/sourced-volume-fn target vol-scale [x y]))] (utils/play-sound! screen entities (or (snd e) snd) - (utils/sourced-volume-fn target vol-scale [x y]) + vol-scale (utils/get-sound-pan x) :once pitch))