owl puking, lol.

This commit is contained in:
2014-12-28 14:53:58 -08:00
parent 06312fbbdc
commit 37c047709d
4 changed files with 98 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -14,5 +14,25 @@
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

View File

@@ -101,8 +101,62 @@
(defn talk-to-owl [entities]
(actions/walk-to entities :ego [141 54] :face :right)
(actions/do-dialogue entities :ego "Hello there little owl."
:owl "You talking to me?"))
(if (get-in @entities [:state :talked-to-owl?])
(do (actions/do-dialogue entities :ego "Hello again."
:owl "Have you found my glass monocle!?"
:owl "I'll have no relief of this nausea until you do.")
(actions/play-animation entities :owl :puke))
(do (actions/do-dialogue entities :ego "Hello there little owl."
:owl "Who you calling little?"
:ego "Wow! You can talk?"
:owl "Of course I can!"
:ego "But none of the other animals so far in this game have talked!"
:owl "Have you ever thought that maybe you're not that enjoyable to talk with?"
:ego "I guess not."
:owl "Naw, I'm just pulling your leg."
:owl "I'm an owl, and owls are wise.")
(actions/present-choices entities {:choices ["Can you help me in my quest?"
{:run #(actions/respond entities %
:owl "Of course I can help you in your quest."
:owl "I know just what you need."
:owl "But I'm also in trouble of my own.")
:choices ["What kind of trouble?"
{:run #(do (actions/respond entities %
:owl "You see, we owls have very strong vision."
:owl "I was born with a birth defect, and only one of my eyes is good."
:owl "I dropped my monocle somewhere around here!"
:owl "Without it, I have severe nausea.")
(actions/play-animation entities :owl :puke)
(actions/do-dialogue entities
:owl "Excuse me."
:owl "I don't suppose you could help me find it?"
:ego "I'll let you know if I find it."))}
"Something else."
{:choices actions/something-else}]}
"Catch any mice tonight?"
{:run #(do (actions/respond entities %
:owl "Nothing at all."
:owl "I'm missing my eyepiece, and without it, I get too much motion sickness."
:owl "I've been sitting here sick ever since I dropped it.")
(actions/play-animation entities :owl :puke)
(actions/do-dialogue entities
:owl "Excuse me."
:owl "Could you help me find it?"
:ego "I'll let you know if I see anything."
:owl "Oh, thank you."))}
"Have you seen Gandarf tonight?"
{:run #(actions/respond entities %
:owl "I don't know him."
:owl "I'm actually just travelling through this land.")
:choices actions/previous-choices}
"Nevermind."
{:run #(do (actions/respond entities %
:owl "Oh, do tell me if you see a glass monocle around."
:owl "I can't see at all without it. On top of that, I have severe nausea!"
:owl "I'll be stranded here for who knows how long without it.")
(actions/play-animation entities :owl :puke))}]})))
(actions/update-state entities #(assoc % :talked-to-owl? true)))
(defn make [screen]
(let [cat-stand-sheet (texture! (texture "cat-tree/cat-stand.png") :split 22 10)
@@ -116,7 +170,8 @@
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])
grandma-kiss (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 8 9 10 9 10 9 10 9 8 0])
owl-stand (utils/make-anim "cat-tree/owl.png" [19 28] 0.2 [0 0 0 0 0 0 0 2])
owl-talk (utils/make-anim "cat-tree/owl.png" [19 28] 0.2 [1 0 1 0 1 0 0 0 2 0])]
owl-talk (utils/make-anim "cat-tree/owl.png" [19 28] 0.2 [1 0 1 0 1 0 0 0 2 0])
owl-puke (utils/make-anim "cat-tree/owl.png" [19 28] 0.10 [0 0 2 2 3 2 2 3 3 2 3 3 3 4 5 6 7 4 4 3 3 2 2 2 2 2])]
(rooms/make :music :town-2
:interactions
{:down-dir {:box [150 0 270 20]
@@ -138,8 +193,7 @@
:script (actions/get-script entities
(when (get-in @entities [:room :entities :ladder])
(actions/talk entities :ego "I'll get down.")
(get-down entities)))}))
)}}
(get-down entities)))})))}}
:grass {:box [26 105 60 160]
:script (actions/get-script entities
(if (not (actions/has-item? entities :grass))
@@ -223,6 +277,7 @@
:x 187 :y 172 :baseline 241
:stand owl-stand
:talk owl-talk
:puke owl-puke
:talk-color (color 0.5 0.5 1.0 1.0)
:anim owl-stand
:anim-start 0

View File

@@ -149,8 +149,16 @@
(str/join " and " (map item->proof missing-items))
".")))))
(defn add-monocle-if-necessary [entities]
(if (and (not (actions/has-obtained? entities :monocle))
(get-in entities [:state :talked-to-owl?]))
(update-in entities [:room :entities] #(assoc % :monocle (doto (get-in entities [:room :monocle]) println)))
entities))
(defn make-night [entities]
(update-in entities [:room :entities] #(dissoc % :game-player)))
(-> entities
(update-in [:room :entities] #(dissoc % :game-player))
add-monocle-if-necessary))
(defn make [screen]
(let [game-player-talk-sheet (texture! (texture "inside-castle/game-player-talk.png") :split 40 44)
@@ -162,7 +170,8 @@
game-player-flex (animation 0.075 (for [i [0 0 4 4 5 5 5 5 5 5 5 6 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 6 5 5 5 5 5 5 5 5 5 5 4 4 0 0 0 0]]
(aget game-player-talk-sheet 0 i)))
trophy (utils/make-anim "inside-castle/trophy.png" [16 16] 0.1 (flatten [(repeat 50 0) 1 2 3 3 3 3 2 1]))
pull-sword-anim (utils/make-anim "inside-castle/pull-sword.png" [95 190] 0.10 (flatten [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 3 2 3 2 3 3 2 3 2 2 3 3 2 3 2 3 2 3 2 3 2 3 2 2 3 3 3 2 3 2 3 3 2 3 2 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]))]
pull-sword-anim (utils/make-anim "inside-castle/pull-sword.png" [95 190] 0.10 (flatten [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 3 2 3 2 3 3 2 3 2 2 3 3 2 3 2 3 2 3 2 3 2 3 2 2 3 3 3 2 3 2 3 3 2 3 2 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]))
monocle (utils/make-anim "inside-castle/monocle.png" [7 7] 0.05 (flatten [(repeat 70 0) 1 2 3 3 3 2 1]))]
(rooms/make :music :town-1
:interactions
{:right-door {:box [286 140 306 160]
@@ -319,6 +328,13 @@
:stand game-player-stand
:flex game-player-flex
:talk game-player-talk)}
:monocle (rooms/make-entity :monocle (assoc (animation->texture screen monocle)
:x 209 :y 160 :baseline 240
:anim monocle
: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!"))))
:collision "inside-castle/collision.png"
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [entities]