From a661426343bac85392b29fd255dc03ccafb521f6 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Tue, 5 May 2015 17:33:32 -0700 Subject: [PATCH] working on making it better for conversation. --- .../src-common/advent/screens/rooms/dream.clj | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/desktop/src-common/advent/screens/rooms/dream.clj b/desktop/src-common/advent/screens/rooms/dream.clj index c6ec98ff..7ec3e52b 100644 --- a/desktop/src-common/advent/screens/rooms/dream.clj +++ b/desktop/src-common/advent/screens/rooms/dream.clj @@ -104,9 +104,10 @@ :ego "'You'll smell like a hog,\nwith stench like a fog,'" :ego "'So with you, no girl will flirt.'") (actions/play-animation entities :ego :sigh) - (actions/talk entities :ego "So can I at least slay ghouls with this broom?") - (actions/stop-walking entities :ego :face :left) + (when-not (get-in @entities [:room :entities :fairy-godfather :distracted?]) + (actions/talk entities :ego "So can I at least slay ghouls with this broom?") + (actions/stop-walking entities :ego :face :left) (actions/do-dialogue entities :fairy-godfather "Not quite, young Tick." :fairy-godfather "This weapon is used to fight a more persistent foe." :fairy-godfather "Dust and grime!" @@ -235,12 +236,30 @@ entities)) nil) +(defn distract [entities message subject] + (actions/respond entities message + :fairy-godfather (str "A " subject "!? Where?") + :ego "Err..." + :ego "Umm..." + ) + (actions/play-animation entities :ego :idea) + (actions/do-dialogue entities + :ego "On that island over there!" + :ego (str "Yes, that's it! There's a " subject " on that island!") + :fairy-godfather "Let me go check it out.") + (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] dissoc :path))) + (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :distracted? true))) + (actions/walk-straight-to entities :fairy-godfather [211 210] )) + (defn talk-to-fairy [entities] (do (actions/do-dialogue entities :fairy-godfather "Young Tick, you must choose your destiny!") (actions/present-choices entities {:choices ["What if I don't like any of these choices?" {:run #(do (actions/respond entities % - :fairy-godfather "Tough luck")) + :fairy-godfather "Who wouldn't want to be a grave digger or janitor?" + :fairy-godfather "That's the problem with kids these days." + :fairy-godfather "Always complaining about what they can't have." + :fairy-godfather "You need an attitude adjustment, mister.")) :choices actions/previous-choices} "Look out!" @@ -249,12 +268,11 @@ :ego "Err... Um..." :ego "I saw a, um...")) :choices ["... a dragon!" - {:run #(do (actions/respond entities % - :ego "Yes, that's it! A dragon!" - :fairy-godfather "Over there on that island!?!") - (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] dissoc :path))) - (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :distracted? true))) - (actions/walk-straight-to entities :fairy-godfather [211 210] ))}] } + {:run #(distract entities % "dragon")} + "... a flying zebra!" + {:run #(distract entities % "flying zebra")} + "... a fairy godfather-eating plant!" + {:run #(distract entities % "fairy godfather-eating plant")}] } "Nevermind." {:run #(actions/respond entities % :fairy-godfather "Don't worry, Tick.")}]}))) @@ -302,7 +320,7 @@ :ego "I can't bring myself to do it." :ego "That sounds horrible!" :ego "Plus, how can I ever win the heart of my true love, Georgia McGorgeous?"))}}} - :timers {:return [30.0 30.0 return-from-island]} + :timers {:return [15.0 15.0 return-from-island]} :layers [(assoc (texture "dream/clouds1.png") :x -10 :y 0 :baseline -1 :parallax 0.2 :scale-x 1.1 :scale-y 1.1) (assoc (texture "dream/island.png") :x 180 :y 180 :baseline 0 :parallax 0.3 :scale-x 1.1 :scale-y 1.1) (assoc (texture "dream/cliff.png") :x 50 :y 133 :baseline 1 :parallax 0.6 :scale-x 1.2 :scale-y 1.2)