inventory items.

This commit is contained in:
2014-11-10 19:38:59 -08:00
parent b0a9419ae6
commit bbaf3658a7
5 changed files with 20 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -50,5 +50,8 @@
(def stool {:name "Stool" :value :stool :cursor :stool})
(def teddy {:name "Teddy Bear" :value :teddy :cursor :teddy})
(def portrait {:name "Portrait" :value :portrait :cursor :portrait})
(def recipe {:name "Strength potion recipe" :value :recipe :cursor :recipe})
(def glass-eye {:name "Choicest of glass eyes" :value :glass-eye :cursor :glass-eye})
(def motivational-tapes {:name "Choicest motivational tapes" :value :motivational-tapes :cursor :motivational-tapes})
(def used-earplugs {:name "Choicest used earplugs" :value :used-earplugs :cursor :used-earplugs})

View File

@@ -15,8 +15,12 @@
:success (actions/get-script entities
(actions/talk entities :ego "Yes! That worked.")
(actions/play-animation entities :ego :squat)
(actions/give entities items/recipe)
(actions/talk entities :ego "I found a recipe for a strength potion!")
(actions/talk entities :ego "Looks like there's something else in here too...")
(actions/play-animation entities :ego :squat)
(actions/give entities items/frog-legs)
(actions/talk entities :ego "I found some frog legs inside."))
(actions/talk entities :ego "Eww. Frog legs."))
:failure (actions/get-script entities
(actions/talk entities :ego "I don't think that worked...")))
(actions/update-state entities #(assoc % :active? false)))

View File

@@ -69,8 +69,7 @@
:peddler "Well I'm afraid you won't have the choicest of earplugs."
:ego "Can't I give you something else for them?"
:peddler "Well, I am low on choice children's toys."
:peddler "If you can bring me one, and I mean the choicest of toys, I will give you the earplugs."))
:choices actions/previous-choices}
:peddler "If you can bring me one, and I mean the choicest of toys, I will give you the earplugs."))}
"I'm interested in a glass eye."
{:run #(do (actions/update-state entities (fn [state] (assoc state :wants-toy true)))
(actions/respond entities %
@@ -82,8 +81,7 @@
:peddler "Well I'm afraid you won't have the choicest of glass eyes."
:ego "Can't I give you something else for them?"
:peddler "I'll tell you what, I don't have any thing for the kids that come to my stand."
:peddler "If you can bring me the choicest of toys, I will give you the glass eye."))
:choices actions/previous-choices}
:peddler "If you can bring me the choicest of toys, I will give you the glass eye."))}
"I'm interested in the motivational tapes."
{:run #(do (actions/update-state entities (fn [state] (assoc state :wants-toy true)))
(actions/respond entities %
@@ -92,10 +90,9 @@
:peddler "These choicest of motivation tapes will convince you that life isn't so bad."
:peddler "For only 3 easy payments of 29.99 scheckles, they're yours!"
:ego "But I'm broke!"
:peddler "Well I'm afraid you won't have the choicest of glass eyes."
:peddler "Well I'm afraid you won't have the choicest of motivational tapes."
:ego "Is there anything else you'd take instead?"
:peddler "If you can bring me a nice kid's toy, I will give you the tapes."))
:choices actions/previous-choices}
:peddler "If you can bring me a nice kid's toy, I will give you the tapes."))}
"Nevermind." {:run #(actions/respond entities % :peddler "Goodbye, sir.")}]}))
:scripts {:teddy (actions/get-script entities
(actions/remove-item entities items/teddy)
@@ -105,11 +102,14 @@
:peddler "What would you like?")
(actions/present-choices entities
{:choices ["The glass eye."
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go."))}
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go.")
(actions/give entities items/glass-eye))}
"The motivational tapes."
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go."))}
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go.")
(actions/give entities items/motivational-tapes))}
"The used earplugs."
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go."))}]})
{:run #(do (actions/respond entities % :peddler "Of course sir. Here you go.")
(actions/give entities items/used-earplugs))}]})
(actions/talk entities :peddler "And, of course, here is your balloon.")
(actions/give entities items/balloon)
(actions/talk entities :peddler "Thank you for your business!"))}}}

View File

@@ -11,7 +11,7 @@
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
(println (:input-x screen) (:input-y screen) "->" x y)))
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :stool :stick :cat-toy :balloon :frog-legs :teddy :portrait])
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :stool :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs])
(defn cursor [filename which]
(let [scale 2