From 1b487edc2bc2462b410ae26223fbcf5b95605d04 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Fri, 3 Oct 2014 21:11:14 -0700 Subject: [PATCH] cleaning up dialogue a bit. --- desktop/src-common/advent/actions.clj | 3 +- .../advent/screens/rooms/outside_castle.clj | 29 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 09a4a271..781499fe 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -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)))) diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 9c26ad1c..501fc791 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -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