From 023874885f968e737f1d1f05f04ac8347cb1f908 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 15 Jun 2016 18:06:43 -0700 Subject: [PATCH] tweaks. --- desktop/src-common/advent/actions.clj | 78 ++++++++++--------- .../advent/screens/rooms/behind_house.clj | 4 +- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index a4441357..d3bd0342 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -985,39 +985,45 @@ (skip-type [this screen entities] :none)))) -(defn play-safe [entities] - (let [safe-song-anim (utils/make-anim-seq "safe-song/safe-song" [100 35] 0.05 (flatten - [ - [1 2 3] - (repeat 2 [ - [5 6 7 8 8 7 6 6 6 6 6] - (map (partial + 4) [5 6 7 8 8 7 6 6 6 6 6]) - (map (partial + 8) [5 6 7 8 8 7 6 6 6 6 6]) - (map (partial + 12) [5 6 7 8 8 7 6 6 6 6 6]) - 18 18 18 18 - (map (partial + 16) [5 6 7 8 8 7 6 6 6 6 6]) - (repeat 45 22)]) - - [22 22 22 22 22 22 22 22 26 27 28 28 28 28 28 28 28 28 28 28 28 28 28 28] - - ]))] - (wait entities 200) - (begin-animation entities :ego :whistle) - (wait entities 400) - (add-entity entities :safe-song - (rooms/make-entity :safe-song - (assoc (utils/get-texture "safe-song/safe-song-1") - :x 130 - :y 120 - :baseline 241 - :night-profile :none - :anim nil - :anim-start 0 - :play safe-song-anim))) - - (begin-animation entities :safe-song :play) - (wait entities 100) - (play-sound entities "safe-sound.ogg" 0.1 false) - (wait entities 10800) - (remove-entity entities :safe-song) - (do-stop entities :ego))) +(defn play-safe + ([entities] + (play-safe entities true)) + ([entities whistle?] + (let [safe-song-anim (utils/make-anim-seq "safe-song/safe-song" [100 35] 0.05 + (flatten + [ + [1 2 3] + (repeat 2 [ + [5 6 7 8 8 7 6 6 6 6 6] + (map (partial + 4) [5 6 7 8 8 7 6 6 6 6 6]) + (map (partial + 8) [5 6 7 8 8 7 6 6 6 6 6]) + (map (partial + 12) [5 6 7 8 8 7 6 6 6 6 6]) + 18 18 18 18 + (map (partial + 16) [5 6 7 8 8 7 6 6 6 6 6]) + (repeat 45 22)]) + + [22 22 22 22 22 22 22 22 26 27 28 28 28 28 28 28 28 28 28 28 28 28 28 28] + + ]))] + (when whistle? + (wait entities 200) + (begin-animation entities :ego :whistle)) + (wait entities 400) + (add-entity entities :safe-song + (rooms/make-entity :safe-song + (assoc (utils/get-texture "safe-song/safe-song-1") + :x 130 + :y 120 + :baseline 241 + :night-profile :none + :anim nil + :anim-start 0 + :play safe-song-anim))) + + (begin-animation entities :safe-song :play) + (wait entities 100) + (play-sound entities "safe-sound.ogg" 0.1 false) + (wait entities 10800) + (remove-entity entities :safe-song) + (when whistle? + (do-stop entities :ego))))) diff --git a/desktop/src-common/advent/screens/rooms/behind_house.clj b/desktop/src-common/advent/screens/rooms/behind_house.clj index 378b9ebe..979e1411 100644 --- a/desktop/src-common/advent/screens/rooms/behind_house.clj +++ b/desktop/src-common/advent/screens/rooms/behind_house.clj @@ -92,7 +92,7 @@ (actions/play-animation entities :ego :start-squat :stop? false) (actions/talk entities :ego "I can see Gandarf the wizard inside." :animate? false :stop? false) (actions/talk entities :ego "It looks like he's opening his Magi-safe." :animate? false :stop? false) - (actions/play-sound entities "safe-sound.ogg" 0.1) + (actions/play-safe entities false) (actions/talk entities :ego "So that's the code to his safe..." :animate? false :stop? false) (actions/play-animation entities :ego :end-squat) (actions/talk entities :ego "A lot of good it'll do me to know his password while he's still there.") @@ -106,7 +106,7 @@ (actions/talk entities :ego "I'll give it another listen.") (actions/play-animation entities :ego :start-squat :stop? false) (actions/talk entities :ego "It looks like Gandarf's opening his Magi-safe." :animate? false :stop? false) - (actions/play-sound entities "safe-sound.ogg" 0.1) + (actions/play-safe entities false) (actions/play-animation entities :ego :end-squat) (actions/talk entities :ego "Ugh! Now I've got it stuck in my head!") (increment-safe-listens entities)