From 18538c4d3bd13d3784dfd68eee2a5275ff65c37a Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Fri, 7 Aug 2015 09:41:07 -0700 Subject: [PATCH] better brian interactions. --- desktop/gametodos.txt | 4 ++ .../advent/screens/rooms/inside_castle.clj | 71 ++++++++++++++++--- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/desktop/gametodos.txt b/desktop/gametodos.txt index 495216f4..a44922f8 100644 --- a/desktop/gametodos.txt +++ b/desktop/gametodos.txt @@ -38,3 +38,7 @@ gang dude should pop the georgia dream you can drink the strength potion while in blood clots hand Add color text for wrong interactions + + +z order pot in antique +can return items at antique diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 44f5e4ce..feb5661a 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -115,16 +115,55 @@ (defn walk-to-player [entities] (actions/walk-to entities :ego [210 73] :face :right)) +(defn brian-pause-from-work [entities] + (actions/play-animation entities :game-player :pause-from-work :stop? false) + (actions/do-stop entities :game-player :face :right)) + +(defn brian-get-to-work [entities] + (actions/play-animation entities :game-player :get-to-work :stop? false) + (actions/do-stop entities :game-player :face :left)) + (defn do-game-player-dialogue [entities] (walk-to-player entities) (actions/do-dialogue entities :ego "You there!") (actions/talk entities :game-player "What is it? I'm busy!" :anim :talk-down) (Thread/sleep 200) - (actions/play-animation entities :game-player :pause-from-work :stop? false) - (actions/do-stop entities :game-player :face :right) + (brian-pause-from-work entities) (actions/talk entities :game-player "Oh, it's you Tick.") (actions/present-choices entities - {:choices ["Do you know anything about the sword in the stone up there?" + {:choices ["Whatcha doing?" + {:run #(actions/respond entities % + :game-player "I'm writing articles in the fields of mathematics, biology..." + :game-player "... astronomy, physics, archeology ..." + :game-player "... paleontology, engineering, history ..." + :game-player "... anthropology, chemistry, quantum mechanics ..." + :game-player "... literature, physiology, and ...") + :choices ["... and girls?" + {:run #(actions/respond entities % + :game-player "No, of course not." + :game-player "I'm a boy of the books." + :game-player "I have no time for dating or love.") + :choices actions/previous-choices} + "... and knightology?" + {:run #(actions/respond entities % + :game-player "The study of knights?" + :game-player "That area of research hasn't been founded yet." + :ego "Well I can be your first subject!" + :game-player "I'm far too busy." + :game-player "Plus, you're not even a knight!") + :choices actions/previous-choices} + "... and magic?" + {:run #(actions/respond entities % + :game-player "Magic?" + :game-player "Ha!" + :game-player "My research will put magic into its rightful place:" + :game-player "My history books.") + :choices actions/previous-choices} + "... and what?" + {:run #(actions/respond entities % :game-player "Choreography.") + :choices actions/something-else} + ]} + "Do you know anything about the sword in the stone up there?" {:run #(actions/respond entities % :game-player "It's the Sword of Blergh. " :game-player "There's a prophecy that says that whoever pulls it will be a great knight!" @@ -167,8 +206,8 @@ "Nevermind." {:run #(actions/respond entities % :game-player "See you around.")}]}) - (actions/play-animation entities :game-player :get-to-work :stop? false) - (actions/do-stop entities :game-player :face :left)) + (brian-get-to-work entities) + ) (defn walk-to-blergh [entities] (actions/walk-to entities :ego [85 145] :face :right) @@ -439,9 +478,12 @@ :script (actions/get-script entities (walk-to-player entities) (if (= nil (get-in @entities [:state :current-riddle])) - (let [{:keys [run choices]} (nice-trophy-dialogue entities)] - (run "Nice trophy.") - (actions/present-choices entities {:choices choices})) + (do + (brian-pause-from-work entities) + (let [{:keys [run choices]} (nice-trophy-dialogue entities)] + (run "Nice trophy.") + (actions/present-choices entities {:choices choices})) + (brian-get-to-work entities)) (actions/do-dialogue entities :ego "Can't you give me your trophy of wisdom?" :game-player "If you want my trophy, you'll have to help me with my riddles.")))) :books (assoc (texture "inside-castle/books.png") @@ -458,30 +500,36 @@ (walk-to-player entities) (if (= :wool (get-in @entities [:state :current-riddle])) (do (actions/play-animation entities :ego :idea) + (brian-pause-from-work entities) (actions/update-state entities (fn [s] (assoc s :current-riddle :balloon))) (actions/remove-item entities :wool) (actions/do-dialogue entities :ego "Wool is white as snow, but it keeps you warm." :game-player "Good job, Tick! Now for your second riddle:" :game-player "'Filled with air, light as a feather,\nIf you want to keep it, best have a tether.'" - :ego "Okay. Be back soon.")) + :ego "Okay. Be back soon.") + (brian-get-to-work entities)) (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))) :balloon (actions/get-script entities (walk-to-player entities) (if (= :balloon (get-in @entities [:state :current-riddle])) (do (actions/play-animation entities :ego :idea) + (brian-pause-from-work entities) (actions/update-state entities (fn [s] (assoc s :current-riddle :frog-legs))) (actions/remove-item entities :balloon) (actions/do-dialogue entities :ego "A balloon is light as a feather." :game-player "That's right, Tick! Now for your third riddle:" :game-player "'Hippity-hop, I'd jump so high,\nWithout these springs, can't harm a fly.'" - :ego "Okay. Be back soon.")) + :ego "Okay. Be back soon.") + (brian-get-to-work entities)) (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))) :frog-legs (actions/get-script entities (walk-to-player entities) + (if (= :frog-legs (get-in @entities [:state :current-riddle])) (do (actions/play-animation entities :ego :idea) + (brian-pause-from-work entities) (actions/update-state entities (fn [s] (assoc s :current-riddle :done))) (actions/remove-item entities :frog-legs) @@ -495,7 +543,8 @@ (actions/remove-entity entities :trophy) (actions/glad entities) (actions/talk entities :ego "Thanks!")) - (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))) + (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")) + (brian-get-to-work entities)) :trophy (actions/get-script entities (walk-to-player entities) (actions/talk entities :game-player "You can keep the trophy. You've earned it."))