can mix potion.

This commit is contained in:
2014-12-28 16:06:14 -08:00
parent 5ffc811dc0
commit 8c3c605bc3
6 changed files with 45 additions and 7 deletions

View File

@@ -55,6 +55,14 @@
(actions/give entities :flask-flies-ash)
(actions/talk entities :ego "Now it's got the fountain water, flies, and the ashes in it.")))
(defn make-finished-component []
(actions/get-script entities
(actions/remove-item entities :flask-flies-ash)
(actions/remove-item entities :feather)
(actions/play-animation entities :ego :reach)
(actions/give entities :spell-component)
(actions/talk entities :ego "It looks like it's ready!")))
(def items
{:wool {:name "Wool" :value :wool :cursor :wool :scripts {:stick make-cat-toy}}
:mushrooms {:name "Mushrooms" :value :mushrooms :cursor :mushrooms
@@ -103,9 +111,12 @@
:flask-water {:name "Water from fountain" :value :flask-water :cursor :flask :scripts {:ash (make-water-and-ash) :flies (make-water-and-flies)}}
:flask-water-ash {:name "Water and ashes" :value :flask-water-ash :cursor :flask-with-contents :scripts {:flies (make-flies-ash)}}
:flask-water-flies {:name "Water and flies" :value :flask-water-flies :cursor :flask-with-contents :scripts {:ash (make-flies-ash)}}
:flask-flies-ash {:name "Water, flies, and ash" :value :flask-flies-ash :cursor :flask-with-contents}
:flask-flies-ash {:name "Water, flies, and ash" :value :flask-flies-ash :cursor :flask-with-contents :scripts {:feather (make-finished-component)}}
:note-1 {:name "Note from Gandarf" :value :note-1 :cursor :note-1}
:ash {:name "Ashes" :value :ash :cursor :ash :scripts {:flask-water (make-water-and-ash) :flask-water-flies (make-flies-ash)}}
:sack-lunch {:name "Sack lunch" :value :sack-lunch :cursor :sack-lunch}
:flies {:name "Flies" :value :flies :cursor :flies :scripts {:flask-water (make-water-and-flies) :flask-water-ash (make-flies-ash)}}
:spear {:name "Spear" :value :spear :cursor :spear}})
:spear {:name "Spear" :value :spear :cursor :spear}
:monocle {:name "Monocle" :value :monocle :cursor :monocle}
:feather {:name "Feather" :value :feather :cursor :feather :scripts {:flask-flies-ash (make-finished-component)}}
:spell-component {:name "Spell component" :value :spell-component :cursor :spell-component}})

View File

@@ -158,6 +158,18 @@
(actions/play-animation entities :owl :puke))}]})))
(actions/update-state entities #(assoc % :talked-to-owl? true)))
(defn give-monocle [entities]
(actions/walk-to entities :ego [141 54] :face :right)
(actions/talk entities :ego "Is this your monocle?")
(actions/play-animation entities :owl :puke)
(actions/remove-entity entities :monocle)
(actions/do-dialogue entities
:owl "It is!"
:owl "Thank you!"
:owl "And now, I will help you on your quest."
:owl "This is for you.")
(actions/give entities :feather))
(defn make [screen]
(let [cat-stand-sheet (texture! (texture "cat-tree/cat-stand.png") :split 22 10)
cat-stand (animation 0.15 (for [i (flatten [(repeat 10 0) 1 1 (repeat 10 0) 2 3 4 3 0 0 2 3 4 3 (repeat 10 0) 1 1 (repeat 10 0) 5 5 6 6 7 (repeat 10 [7 8]) 6 5 0])]
@@ -281,7 +293,10 @@
:talk-color (color 0.5 0.5 1.0 1.0)
:anim owl-stand
:anim-start 0
:script (actions/get-script entities (talk-to-owl entities))))
:script (actions/get-script entities (talk-to-owl entities))
:scripts #(condp = %
:monocle (actions/get-script entities (give-monocle entities))
nil)))
:collision "cat-tree/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
:apply-state (fn [entities]

View File

@@ -334,7 +334,15 @@
:anim-start 0
:script (actions/get-script entities
(actions/walk-to entities :ego [213 87] :face :left)
(actions/talk entities :ego "There's something up there on the roof!"))))
(actions/talk entities :ego "There's something up there on the roof!"))
:scripts {:spear (actions/get-script entities
(actions/walk-to entities :ego [213 87] :face :left)
(actions/talk entities :ego "Maybe I can reach it with this.")
(actions/play-animation entities :ego :spear)
(actions/talk entities :ego "Got it!")
(actions/remove-entity entities :monocle)
(actions/give entities :monocle)
(actions/talk entities :ego "It looks like a monocle."))}))
:collision "inside-castle/collision.png"
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [entities]

View File

@@ -163,6 +163,8 @@
swing (utils/make-anim "ego/swing.png" [36 36] 0.05 (flatten [[0 0 0 1 2 3 3 3 3 ]]))
grow-talk (utils/make-anim "ego/grow-talk.png" [18 36] 0.2 (range 2))
get-sick (animation 0.3 (map (partial get [(aget talk-sheet 0 0 ) (texture "ego/get-sick.png")]) [0 1 1 1 1 1 1 1 1 1 1 1]) )
spear (utils/make-anim "ego/spear.png" [18 100] 0.2 [0 1 2 3 2 3 2 3 2 3 2 1 0])
ego {:right {:walk walk-right
:stand stand-anim
:talk talk-anim
@@ -180,7 +182,8 @@
:grow-talk grow-talk
[:fire 1] fire-1-anim
[:fire 2] fire-2-anim
[:fire 3] fire-3-anim}
[:fire 3] fire-3-anim
:spear spear}
:left {:walk (utils/flip walk-right)
:stand (utils/flip stand-anim)
:talk (utils/flip talk-anim)
@@ -197,7 +200,8 @@
:grow-talk (utils/flip grow-talk)
[:fire 1] (utils/flip fire-1-anim)
[:fire 2] (utils/flip fire-2-anim)
[:fire 3] (utils/flip fire-3-anim)}
[:fire 3] (utils/flip fire-3-anim)
:spear (utils/flip spear)}
:baseline (- 240 (last start-pos))
:facing :right
:origin-x 9

View File

@@ -14,7 +14,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 :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear])
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component])
(defn cursor [filename which]
(let [scale 2