cleaning up dialogue a bit.

This commit is contained in:
2014-10-03 21:11:14 -07:00
parent 098891dd42
commit 1b487edc2b
2 changed files with 17 additions and 15 deletions

View File

@@ -320,7 +320,8 @@
(defn do-dialogue [entities & pairs]
(loop [pairs (partition 2 pairs)]
(let [[[target line]] pairs
result (actions/talk entities target line)]
next-speaker-is-different (not= target (ffirst (next pairs)))
result (talk entities target line :stop? next-speaker-is-different)]
(if (seq (rest pairs))
(recur (rest pairs))
result))))

View File

@@ -34,20 +34,21 @@
:script (actions/get-script
entities
(actions/walk-to entities :ego [191 90])
(actions/talk entities :ego "Hello there, peddler.")
(actions/talk entities :peddler "Good day sir! Care to see any of my wares?" :stop? false)
(actions/talk entities :peddler "I have only the choicest of wares.")
(actions/talk entities :ego "What 'wares' are you selling?")
(actions/talk entities :peddler "I have the choicest of all types of wares..." :stop? false)
(actions/talk entities :peddler "...I'm well stocked on used earplugs..." :stop? false)
(actions/talk entities :peddler "...glass eyes, motivational tapes... " :stop? false)
(actions/talk entities :peddler "...and useful books like this:" :stop? false)
(actions/talk entities :peddler "'Checkers Mastery in Less Than 10 Seconds'")
(actions/talk entities :ego "I sure am interested on that book on checkers.")
(actions/talk entities :peddler "An excellent selection! It is the choicest of checkers book you'll ever find." :stop? false)
(actions/talk entities :peddler "This book will only set you back 75 sheckels.")
(actions/talk entities :ego "But I haven't got any money!")
(actions/talk entities :peddler "Then you won't have the choicest of checkers books."))}}
(actions/do-dialogue entities
:ego "Hello there, peddler."
:peddler "Good day sir! Care to see any of my wares?"
:peddler "I have only the choicest of wares."
:ego "What 'wares' are you selling?"
:peddler "I have the choicest of all types of wares..."
:peddler "...I'm well stocked on used earplugs..."
:peddler "...glass eyes, motivational tapes... "
:peddler "...and useful books like this:"
:peddler "'Checkers Mastery in Less Than 10 Seconds'"
:ego "I sure am interested on that book on checkers."
:peddler "An excellent selection! It is the choicest of checkers book you'll ever find."
:peddler "This book will only set you back 75 sheckels."
:ego "But I haven't got any money!"
:peddler "Then you won't have the choicest of checkers books."))}}
:layers [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)]
:entities {:peddler (actions/start-animation screen
(assoc (texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil