diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index 3f693c72..5cb050af 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -164,7 +164,7 @@ (defn make [screen] (let [shopkeep-sheet (texture! (utils/get-texture "inside-antique/shopkeep-talk.png") :split 18 21) - shopkeep-stand (animation 0.1 (for [i (flatten [(repeat 30 0) 1 (repeat 50 0) 1 0 1 0 1])] + shopkeep-stand (animation 0.1 (for [i (flatten [(repeat 30 0) 1 (repeat 50 0) 1 0 1 0])] (aget shopkeep-sheet 0 i))) shopkeep-talk (animation 0.15 (for [i [0 2 0 2 0 3 1 0]] (aget shopkeep-sheet 0 i))) @@ -282,6 +282,10 @@ :sigh shopkeep-sigh :anim-merges {shopkeep-sigh {:origin-x 9} :default {:origin-x 9}} + :anim-sound-frames {shopkeep-stand {31 [:blink 0.5 1.5] + 81 [:blink 0.5 1.5] + 83 [:blink 0.5 1.5]} + shopkeep-talk {6 [:blink 0.5 1.5]}} :script (actions/get-script entities (do-antique-dialogue entities)) :scripts #(condp = % :teddy (actions/get-script entities diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index a1df8b90..afad2260 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -606,7 +606,11 @@ :talk game-player-talk-up} :get-to-work game-player-get-to-work :pause-from-work game-player-pause-from-work - :anim-sound-frames {game-player-stand-up {11 [:blink 0.3] } + :anim-sound-frames {game-player-stand-up {11 [:blink 0.3 1.1] } + game-player-talk-up {11 [:blink 0.3 1.1] + 22 [:blink 0.3 1.1] + 24 [:blink 0.3 1.1] + 27 [:blink 0.3 1.1]} game-player-stand-down {1 [:writing-sound 0.07]}} :flex game-player-flex)} :monocle (rooms/make-entity :monocle (assoc (animation->texture screen monocle) diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 46e9514e..506ed59c 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -278,7 +278,7 @@ (let [peddler-sheet (texture! (utils/get-texture "outside-castle/peddler-talk.png" ) :split 18 36) peddler-talk (animation 0.18 (for [i (flatten [2 3 2 3 2 3 6 1 0 1 0 1 0 1 0 1 2 3 2 3 2 3 6 4 5 4 5 4 5 4 5])] (aget peddler-sheet 0 i))) - peddler-stand (animation 0.2 (for [i (flatten [(repeat 8 0) 6 (repeat 8 0) 6 (repeat 5 0) 4 5 4 5 4 5])] + peddler-stand (animation 0.2 (for [i (flatten [(repeat 8 0) 6 (repeat 15 0) 6 (repeat 5 0) 4 5 4 5 4 5 (repeat 10 0)] )] (aget peddler-sheet 0 i))) balloon-sheet (texture! (utils/get-texture "outside-castle/balloons.png") :split 20 36) balloon-stand (animation 0.25 (for [i [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2]] @@ -334,8 +334,12 @@ (assoc (utils/get-texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 69)]} :entities {:peddler (actions/start-animation screen (assoc (utils/get-texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil - :anim-sound-frames {peddler-stand {23 [:scratch 0.25]} - peddler-talk {23 [:scratch 0.25]}} + :anim-sound-frames {peddler-stand {8 [:blink 0.3 0.8] + 24 [:blink 0.3 0.8] + 30 [:scratch 0.15]} + peddler-talk {23 [:scratch 0.15] + 6 [:blink 0.3 0.8] + 22 [:blink 0.3 0.8]}} :scratch (utils/load-sound "outside-castle/scratch.ogg") :talk peddler-talk :stand peddler-stand :talk-color (color 1.0 0.9 0.4 1.0) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index a54f3ccf..dc3a79a4 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -817,14 +817,16 @@ void main() (defn play-sound-if-necessary [screen entities target {:keys [previous-frame-index current-frame-index anim-sound-frames anim x y] :as e}] (if (and (not= previous-frame-index current-frame-index) ((set (keys anim-sound-frames)) anim)) - (if-let [[snd vol-scale] (get-in anim-sound-frames [anim current-frame-index])] + (if-let [[snd vol-scale pitch] (get-in anim-sound-frames [anim current-frame-index])] (let [snd (if (fn? snd) (snd entities) snd)] (utils/play-sound! screen entities (or (snd e) (snd (:sounds entities))) (utils/sourced-volume-fn target vol-scale [x y]) - (utils/get-sound-pan x))) + (utils/get-sound-pan x) + :once + pitch)) entities) entities)) @@ -1014,7 +1016,7 @@ void main() :closing? {:object nil :value false} - :sounds {:blink (utils/load-sound "blink-other.ogg") + :sounds {:blink (utils/load-sound "ego/blink2.ogg") :object nil} :fade {:object nil :opacity 0.0} diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 3d38bd7c..d5813428 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -428,10 +428,13 @@ (play-sound! screen entities snd volume-fn pan :once)) ([screen entities snd volume-fn pan type] + (play-sound! screen entities snd volume-fn pan :once 1.0)) + + ([screen entities snd volume-fn pan type pitch] (let [vol (volume-fn entities) sound-id (if (= :once type) - (sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) 1.0 pan) - (sound! snd :loop (scale-vol-from-fade entities (current-sound-volume vol)) 1.0 pan)) ] + (sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan ) + (sound! snd :loop (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan )) ] (update-in entities [:current-sounds :value] conj {:id sound-id :sound snd