starting dialogue puzzle.

This commit is contained in:
Bryce Covert
2015-09-04 18:00:52 -07:00
parent 7b2ffa7ccc
commit 96c215605b
3 changed files with 70 additions and 4 deletions

View File

@@ -105,7 +105,73 @@
(actions/talk entities :ego "Am I right boys?" :animate? false :stop? false))
(defn listen-to-frankie [entities]
((rand-nth [listen-1 listen-2 listen-3]) entities))
(let [respond (fn [msg]
(actions/talk entities :ego msg :animate? false :stop? false :color (color 0.6 0.2 0.6 1.0))
(Thread/sleep 200))
talk (fn [msg]
(actions/talk entities :ego msg :animate? false :stop? false)
(Thread/sleep 200))]
(talk "Hello?")
(respond "Who said that?!")
(actions/present-choices entities
{:choices ["It's me, Tick!"
{:run #(do
(talk %)
(respond "I don't know where you are, Tick, but leave us alone!"))}
"It's me, Bubba!"
{:run #(do
(talk %)
(respond "Bubba!?")
(respond "What happened to your voice?"))
:choices ["(Higher pitch) I think I'm getting a cold."
{:run (fn [m]
(talk "I think I'm getting a cold.")
(respond "Wait a second...")
(respond "You're not Bubba!")
(respond "Bubba has a deep voice!"))}
"(Same pitch) I think I'm getting a cold."
{:run (fn [m]
(talk "I think I'm getting a cold.")
(respond "Wait a second...")
(respond "I recognize that voice!")
(respond "I don't know where you are, Dipstick, but quit fooling around!"))}
"(Lower pitch) I think I'm getting a cold."
{:run (fn [m]
(talk "I think I'm getting a cold.")
(respond "Sorry to hear that, Bubba.")
(respond "Whaddaya want?"))
:choices ["Where is our tree fort again?"
{:run (fn [m]
(talk m)
(respond "We don't have a tree fort, Bubba!")
(respond "You must be going crazy.")
(respond "Wait a second...")
(respond "You're not Bubba!")
(respond "I don't know who you are, mister, but quit fooling around!"))}
"Where is the secret stash again?"
{:run (fn [m]
(talk m)
(respond "We don't have a tree fort, Bubba!")
(respond "You must be going crazy.")
(respond "Wait a second...")
(respond "You're not Bubba!")
(respond "I don't know who you are, mister, but quit fooling around!"))}
"Maybe we should give Tick his stuff back."
{:run (fn [m]
(talk m)
(respond "Are you crazy!?")
(respond "We hit the jackpot, and you want to return it?!")
(respond "Wait a second...")
(respond "You're not Bubba!")
(respond "I don't know who you are, mister, but quit fooling around!"))}]}]
}
"It's me, Frankie!"
{:run #(do
(talk %)
(respond "Frankie?")
(respond "But, I'm Frankie!")
(respond "Are you my doppleganger?"))}]}))
)
(defn explode [entities]