Goon dropping

This commit is contained in:
Bryce Covert
2015-07-30 09:14:36 -07:00
parent fffe494308
commit 4ba5457d2e
2 changed files with 20 additions and 11 deletions

View File

@@ -338,7 +338,7 @@
(defn get-text-duration [text]
(max 1.5 (* (count (s/split text #" ")) 0.5)))
(defn talk [entities target-id text & {:keys [stop? animate? anim]}]
(defn talk [entities target-id text & {:keys [stop? animate? anim wait] :or {wait true}}]
(let [initial-time (atom nil)
stop? (if (nil? stop?) true stop?)
animate? (if (nil? animate?) true animate?)]
@@ -371,15 +371,20 @@
(continue [this screen entities] entities)
(done? [this screen entities]
(> (- (:total-time screen)
@initial-time)
(get-text-duration text)))
(if wait
(> (- (:total-time screen)
@initial-time)
(get-text-duration text))
true))
(terminate [this screen entities]
(screen! dialogue/talking-screen :stop-talk :target-id target-id)
(if stop?
(stop screen entities target-id)
entities))
(if wait
(do
(screen! dialogue/talking-screen :stop-talk :target-id target-id)
(if stop?
(stop screen entities target-id)
entities))
entities))
(can-skip? [this screen entities]
true))))