other minor tweaks.

This commit is contained in:
Bryce Covert
2015-10-07 18:49:22 -07:00
parent c00492eee1
commit c22094a76d
2 changed files with 16 additions and 14 deletions

View File

@@ -513,22 +513,24 @@
(skip-type [this screen entities] (skip-type [this screen entities]
:none))) :none)))
(defn play-sound [entities sound-file] (defn play-sound
(let [m (music sound-file)] ([entities sound-file vol]
(run-action entities (let [s (sound sound-file)]
(begin [this screen entities] (run-action entities
(music! m :play) (begin [this screen entities]
entities) (utils/play-sound! screen entities s (constantly vol)))
(continue [this screen entities] entities) (continue [this screen entities] entities)
(done? [this screen entities] (done? [this screen entities]
(not (music! m :is-playing))) (not (seq (filter
#(= s (:sound %))
(get-in entities [:current-sounds :value])))))
(terminate [this screen entities] (terminate [this screen entities]
entities) entities)
(skip-type [this screen entities] (skip-type [this screen entities]
:none)))) :none)))))
(defn give [entities item] (defn give [entities item]
(run-action entities (run-action entities

View File

@@ -75,7 +75,7 @@
(actions/play-animation entities :ego :start-squat :stop? false) (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 "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/talk entities :ego "It looks like he's opening his Magi-safe." :animate? false :stop? false)
(actions/play-sound entities "safe-sound.ogg") (actions/play-sound entities "safe-sound.ogg" 0.1)
(actions/talk entities :ego "So that's the code to his safe..." :animate? false :stop? 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/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.")) (actions/talk entities :ego "A lot of good it'll do me to know his password while he's still there."))