another candle!

This commit is contained in:
2015-07-27 23:40:08 -07:00
parent 3148689156
commit 7c962bdd32
15 changed files with 78 additions and 6 deletions

View File

@@ -70,7 +70,17 @@
(Thread/sleep 500)
(actions/play-animation entities :ego :reach-stop :stop? false)
(actions/play-animation entities :stash :close :stop? false)
(actions/talk entities :ego "That trapdoor closes as soon as I let the lever go!"))))
(actions/talk entities :ego "That trapdoor closes as soon as I let the lever go!"))
(= (get-in @entities [:state :time]) :night)
(do
(actions/walk-to entities :ego [48 36] :face :left)
(actions/talk entities :ego "Looks like a candle to me."))
:else
(do
(actions/walk-to entities :ego [48 36] :face :left)
(actions/do-dialogue entities :ego "Just a candle."
:ego "It's just not lit during the day."))))
(defn try-to-go-in-stash [entities]
(when (get-in @entities [:room :entities :rope])
@@ -92,7 +102,9 @@
guard-talk (animation 0.2 (for [i [0 0 0 0 1 0 0 1]] (aget guard-sheet 0 i)))
guard-sleep (utils/make-anim "outside-jail/guard-sleep.png" [43 67] 0.1 (range 4))
open-stash (utils/make-anim "outside-jail/open-stash.png" [58 41] 0.075 (reverse (range 5)))
close-stash (utils/make-anim "outside-jail/open-stash.png" [58 41] 0.075 (range 5))]
close-stash (utils/make-anim "outside-jail/open-stash.png" [58 41] 0.075 (range 5))
candle-flame (utils/make-anim "outside-jail/candle.png" [20 25] 0.075 (range 4))
candle-aura (utils/make-anim (texture "outside-jail/candle-aura2.png") [135 135] 0.3 [0 1 2 1] )]
(rooms/make :music {:day :town-1 :night :night}
:interactions {:down-dir {:box [30 0 227 20]
:script (actions/get-script entities
@@ -159,7 +171,7 @@
(actions/give entities :broken-clock)
(actions/walk-straight-to entities :ego [170 71]))
:sword (actions/get-script entities (actions/talk entities :ego "I can just use the axe."))}}
:lever {:box [10 72 17 85]
:lever {:box [3 72 20 90]
:script (actions/get-script entities
(interact-with-lever entities))
:scripts {:rope (actions/get-script entities
@@ -167,7 +179,15 @@
(actions/walk-to entities :ego [48 36] :face :left)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :rope)
(actions/add-entity entities :rope (get-in @entities [:room :rope]))))}}
(actions/add-entity entities :rope (get-in @entities [:room :rope]))))
:recipe (actions/get-script entities
(actions/walk-to entities :ego [48 36] :face :left)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :recipe)
(actions/give entities :ash)
(actions/talk entities :ego "It burned up into ash."))
:default (actions/get-script entities
(actions/talk entities :ego "Why would I want to burn that?"))}}
:end-of-rope {:box [177 101 185 108]
:script (actions/get-script entities (try-to-go-in-stash entities))}
:fountain {:box [150 126 193 147]
@@ -193,6 +213,15 @@
:width 10
:height 10
:talk-color (color 0.9 0.3 0.9 1.0)}
:candle-flame (assoc (animation->texture screen candle-flame)
:origin-x 8 :origin-y 11
:x 14 :y 82
:baseline 1
:night-profile :none
:anim candle-flame
:anim-start 0)
:candle-aura (assoc (animation->texture screen candle-aura) :x 14 :y 82 :baseline 240
:additive? true :origin-x 67 :origin-y 67 :scale-x 1 :scale-y 1 :opacity 0.5 :anim candle-aura :anim-start 0 :night-profile :none)
:fountain-particle (assoc (doto (particle-effect "outside-jail/fountain")
(particle-effect! :reset)
(particle-effect! :start))
@@ -257,7 +286,7 @@
(assoc-in entities [:room :fountain-sound :id] (sound! (get-in entities [:room :fountain-sound :sound]) :loop (fountain-vol entities)))
(if (= :night (get-in entities [:state :time]))
(make-night entities)
entities)
(update-in entities [:room :entities] dissoc :candle-aura :candle-flame))
(if (get-in entities [:state :dropped-ball?])
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
(update-in entities [:room :entities] dissoc :bent-bar-window )))))))