better brian interactions.

This commit is contained in:
Bryce Covert
2015-08-07 09:41:07 -07:00
parent 1b8ffafc10
commit 18538c4d3b
2 changed files with 64 additions and 11 deletions

View File

@@ -38,3 +38,7 @@ gang dude should pop the georgia dream
you can drink the strength potion while in blood clots hand you can drink the strength potion while in blood clots hand
Add color text for wrong interactions Add color text for wrong interactions
z order pot in antique
can return items at antique

View File

@@ -115,16 +115,55 @@
(defn walk-to-player [entities] (defn walk-to-player [entities]
(actions/walk-to entities :ego [210 73] :face :right)) (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] (defn do-game-player-dialogue [entities]
(walk-to-player entities) (walk-to-player entities)
(actions/do-dialogue entities :ego "You there!") (actions/do-dialogue entities :ego "You there!")
(actions/talk entities :game-player "What is it? I'm busy!" :anim :talk-down) (actions/talk entities :game-player "What is it? I'm busy!" :anim :talk-down)
(Thread/sleep 200) (Thread/sleep 200)
(actions/play-animation entities :game-player :pause-from-work :stop? false) (brian-pause-from-work entities)
(actions/do-stop entities :game-player :face :right)
(actions/talk entities :game-player "Oh, it's you Tick.") (actions/talk entities :game-player "Oh, it's you Tick.")
(actions/present-choices entities (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 % {:run #(actions/respond entities %
:game-player "It's the Sword of Blergh. " :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!" :game-player "There's a prophecy that says that whoever pulls it will be a great knight!"
@@ -167,8 +206,8 @@
"Nevermind." "Nevermind."
{:run #(actions/respond entities % :game-player "See you around.")}]}) {:run #(actions/respond entities % :game-player "See you around.")}]})
(actions/play-animation entities :game-player :get-to-work :stop? false) (brian-get-to-work entities)
(actions/do-stop entities :game-player :face :left)) )
(defn walk-to-blergh [entities] (defn walk-to-blergh [entities]
(actions/walk-to entities :ego [85 145] :face :right) (actions/walk-to entities :ego [85 145] :face :right)
@@ -439,9 +478,12 @@
:script (actions/get-script entities :script (actions/get-script entities
(walk-to-player entities) (walk-to-player entities)
(if (= nil (get-in @entities [:state :current-riddle])) (if (= nil (get-in @entities [:state :current-riddle]))
(let [{:keys [run choices]} (nice-trophy-dialogue entities)] (do
(run "Nice trophy.") (brian-pause-from-work entities)
(actions/present-choices entities {:choices choices})) (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?" (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.")))) :game-player "If you want my trophy, you'll have to help me with my riddles."))))
:books (assoc (texture "inside-castle/books.png") :books (assoc (texture "inside-castle/books.png")
@@ -458,30 +500,36 @@
(walk-to-player entities) (walk-to-player entities)
(if (= :wool (get-in @entities [:state :current-riddle])) (if (= :wool (get-in @entities [:state :current-riddle]))
(do (actions/play-animation entities :ego :idea) (do (actions/play-animation entities :ego :idea)
(brian-pause-from-work entities)
(actions/update-state entities (fn [s] (assoc s :current-riddle :balloon))) (actions/update-state entities (fn [s] (assoc s :current-riddle :balloon)))
(actions/remove-item entities :wool) (actions/remove-item entities :wool)
(actions/do-dialogue entities (actions/do-dialogue entities
:ego "Wool is white as snow, but it keeps you warm." :ego "Wool is white as snow, but it keeps you warm."
:game-player "Good job, Tick! Now for your second riddle:" :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.'" :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."))) (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")))
:balloon (actions/get-script entities :balloon (actions/get-script entities
(walk-to-player entities) (walk-to-player entities)
(if (= :balloon (get-in @entities [:state :current-riddle])) (if (= :balloon (get-in @entities [:state :current-riddle]))
(do (actions/play-animation entities :ego :idea) (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/update-state entities (fn [s] (assoc s :current-riddle :frog-legs)))
(actions/remove-item entities :balloon) (actions/remove-item entities :balloon)
(actions/do-dialogue entities (actions/do-dialogue entities
:ego "A balloon is light as a feather." :ego "A balloon is light as a feather."
:game-player "That's right, Tick! Now for your third riddle:" :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.'" :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."))) (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")))
:frog-legs (actions/get-script entities :frog-legs (actions/get-script entities
(walk-to-player entities) (walk-to-player entities)
(if (= :frog-legs (get-in @entities [:state :current-riddle])) (if (= :frog-legs (get-in @entities [:state :current-riddle]))
(do (actions/play-animation entities :ego :idea) (do (actions/play-animation entities :ego :idea)
(brian-pause-from-work entities)
(actions/update-state entities (fn [s] (assoc s :current-riddle :done))) (actions/update-state entities (fn [s] (assoc s :current-riddle :done)))
(actions/remove-item entities :frog-legs) (actions/remove-item entities :frog-legs)
@@ -495,7 +543,8 @@
(actions/remove-entity entities :trophy) (actions/remove-entity entities :trophy)
(actions/glad entities) (actions/glad entities)
(actions/talk entities :ego "Thanks!")) (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 :trophy (actions/get-script entities
(walk-to-player entities) (walk-to-player entities)
(actions/talk entities :game-player "You can keep the trophy. You've earned it.")) (actions/talk entities :game-player "You can keep the trophy. You've earned it."))