expanding dialogue.

This commit is contained in:
2014-12-17 12:49:14 -08:00
parent 3c9e00a494
commit 2fcbe26ea2
4 changed files with 118 additions and 79 deletions

View File

@@ -208,44 +208,51 @@
:game-player (assoc (texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191
`:talk-color (color 1.0 0.3 0.2 1.0)
:script (actions/get-script entities (do-game-player-dialogue entities))
:scripts {:wool (actions/get-script entities
(walk-to-player entities)
(if (= :wool (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :balloon))
(actions/remove-item entities :wool)
(actions/do-dialogue entities
:game-player "That's right! 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."))
(actions/talk entities :ego "He doesn't need it.")))
:balloon (actions/get-script entities
(walk-to-player entities)
(if (= :balloon (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :frog-legs))
(actions/remove-item entities :balloon)
(actions/do-dialogue entities
:game-player "That's right! 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."))
(actions/talk entities :ego "He doesn't need it.")))
:frog-legs (actions/get-script entities
(walk-to-player entities)
(if (= :frog-legs (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :done))
(actions/remove-item entities :frog-legs)
(actions/do-dialogue entities
:game-player "Wow! That's right!"
:game-player "You, sir, have proven yourself worthy of my trophy."
:game-player "Even I, Brian O'Brainy, am impressed with your wisdom."
:game-player "Take it, and go in wisdom.")
(actions/give entities :trophy)
(actions/remove-entity entities :trophy)
(actions/talk entities :ego "Thanks!"))
(actions/talk entities :ego "He doesn't need it.")))
:trophy (actions/get-script entities
:scripts #(condp = %
:wool (actions/get-script entities
(walk-to-player entities)
(actions/talk entities :game-player "You can keep the trophy. You've earned it."))}
(if (= :wool (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities (fn [s] (assoc s :current-riddle :balloon)))
(actions/remove-item entities :wool)
(actions/do-dialogue entities
:game-player "That's right! 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."))
(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/update-state entities (fn [s] (assoc s :current-riddle :frog-legs)))
(actions/remove-item entities :balloon)
(actions/do-dialogue entities
:game-player "That's right! 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."))
(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/update-state entities (fn [s] (assoc s :current-riddle :done)))
(actions/remove-item entities :frog-legs)
(actions/do-dialogue entities
:game-player "Wow! That's right!"
:game-player "You, sir, have proven yourself worthy of my trophy."
:game-player "Even I, Brian O'Brainy, am impressed with your wisdom."
:game-player "Take it, and go in wisdom.")
(actions/give entities :trophy)
(actions/remove-entity entities :trophy)
(actions/talk entities :ego "Thanks!"))
(actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")))
:trophy (actions/get-script entities
(walk-to-player entities)
(actions/talk entities :game-player "You can keep the trophy. You've earned it."))
(actions/get-script entities
(walk-to-player entities)
(condp = (get-in @entities [:state :current-riddle])
:done (actions/do-dialogue entities :game-player "I've gotten all the help I need with riddles today.")
nil (actions/do-dialogue entities :game-player "Why are you offering me this?")
(actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))))
:anim game-player-stand
:anim-start 0
:stand game-player-stand