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

@@ -106,6 +106,14 @@
:peddler "Remember - I have a one-day special going."
:peddler "Every purchase comes with a free balloon!")))
(defn walk-to-peddler [entities]
(actions/walk-to entities :ego [191 90] :face :left))
(defn no-returns [entities]
(walk-to-peddler entities)
(actions/do-dialogue entities :ego "Can I return this?"
:peddler "Sorry, no refunds."))
(defn do-peddler-dialogue [entities]
(cond (actions/has-obtained? entities :balloon) (do-completed-peddler-conversation entities)
(get-in @entities [:state :wants-toy]) (do-wants-toy-conversation entities)
@@ -161,11 +169,21 @@
:peddler {:box [110 90 128 146]
:script (actions/get-script
entities
(actions/walk-to entities :ego [191 90] :face :left)
(walk-to-peddler entities)
(do-peddler-dialogue entities))
:scripts {:teddy (actions/get-script entities
(actions/walk-to entities :ego [191 90] :face :left)
(give-teddy entities))}}}
:scripts #(condp = %
:teddy (actions/get-script entities
(walk-to-peddler entities)
(give-teddy entities))
:glass-eye (actions/get-script entities (no-returns entities))
:motivational-tapes (actions/get-script entities (no-returns entities))
:used-earplugs (actions/get-script entities (no-returns entities))
:balloon (actions/get-script entities (no-returns entities))
(actions/get-script entities
(walk-to-peddler entities)
(actions/do-dialogue entities
:ego "Are you interested in this?"
:peddler "No, I have no use for it.")))}}
:layers [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)]
:entities {:peddler (actions/start-animation screen
(assoc (texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil
@@ -179,15 +197,22 @@
(actions/walk-to entities :ego [168 150] :face :right)
(actions/do-dialogue entities
:ego "It's Angus, Remington's buff bull."
:ego "He's used in all of the town's rodeos."
:ego "Farmer Doug feeds him an exclusive wild high-protein grass diet to keep him in tip top shape."
:ego "He looks mean, I'd rather not pet him."))
:scripts {:grass (actions/get-script entities
(actions/walk-to entities :ego [168 150] :face :right)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :grass)
(actions/talk entities :ego "Eww! He slobbered on my hand.")
(actions/give entities :slobber))}
)
:scripts #(condp = %
:grass (actions/get-script entities
(actions/walk-to entities :ego [168 150] :face :right)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :grass)
(actions/talk entities :ego "Eww! He slobbered on my hand.")
(actions/give entities :slobber))
:carrot (actions/get-script entities
(actions/walk-to entities :ego [168 150] :face :right)
(actions/do-dialogue entities
:ego "I don't thing Angus is interested."
:ego "Farmer Doug only feeds him a wild high-protein grass."))
nil))
:stand)
:balloons (actions/start-animation screen
(assoc (animation->texture screen balloon-stand)