inventory item for song.
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
(actions/walk-to entities :ego [158 110]))
|
||||
:cursor :left})
|
||||
|
||||
(defn increment-safe-listens [entities]
|
||||
(actions/update-state entities
|
||||
(fn [state] (assoc state :safe-listen-count (inc (:safe-listen-count state 0))))))
|
||||
|
||||
(defn make [screen]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:name "Behind house"
|
||||
@@ -62,10 +66,10 @@
|
||||
(assoc (utils/get-texture "behindhouse/fgleft.png") :x -10 :y 0 :baseline 240 :parallax 1.5)
|
||||
(assoc (utils/get-texture "behindhouse/fg2.png") :x (- 320 122) :y 0 :baseline 240 :parallax 1.5)]
|
||||
:night [(assoc (utils/get-texture "behindhouse/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "behindhouse/house.png") :x 0 :y 0 :baseline 122)
|
||||
(assoc (utils/get-texture "behindhouse/brush.png") :x 0 :y 0 :baseline 240)
|
||||
(assoc (utils/get-texture "behindhouse/fgleft.png") :x -10 :y 0 :baseline 240 :parallax 1.5)
|
||||
(assoc (utils/get-texture "behindhouse/fg2.png") :x (- 320 122) :y 0 :baseline 240 :parallax 1.5)]}
|
||||
(assoc (utils/get-texture "behindhouse/house.png") :x 0 :y 0 :baseline 122)
|
||||
(assoc (utils/get-texture "behindhouse/brush.png") :x 0 :y 0 :baseline 240)
|
||||
(assoc (utils/get-texture "behindhouse/fgleft.png") :x -10 :y 0 :baseline 240 :parallax 1.5)
|
||||
(assoc (utils/get-texture "behindhouse/fg2.png") :x (- 320 122) :y 0 :baseline 240 :parallax 1.5)]}
|
||||
:entities {:stick (assoc (utils/get-texture "behindhouse/stick.png")
|
||||
:x 26 :y 80 :baseline 160
|
||||
:script (actions/get-script entities
|
||||
@@ -74,13 +78,16 @@
|
||||
(actions/remove-entity entities :stick)
|
||||
(actions/give entities :stick)
|
||||
(actions/talk entities :ego "This stick might be useful.")))
|
||||
|
||||
:peeling (assoc (utils/get-texture "behindhouse/house-cover.png")
|
||||
:x 60 :y 92 :baseline 148
|
||||
:script (actions/get-script entities
|
||||
(cond (= :night (get-in @entities [:state :time]))
|
||||
(actions/talk entities :ego "The house is empty right now.")
|
||||
|
||||
(get-in @entities [:state :opened-crack?])
|
||||
(and (get-in @entities [:state :opened-crack?])
|
||||
(= 0 (get-in @entities [:state :safe-listen-count] 0)))
|
||||
|
||||
(do (actions/walk-to entities :ego [70 80])
|
||||
(actions/play-animation entities :ego :start-squat :stop? false)
|
||||
(actions/talk entities :ego "I can see Gandarf the wizard inside." :animate? false :stop? false)
|
||||
@@ -90,7 +97,23 @@
|
||||
(actions/play-animation entities :ego :end-squat)
|
||||
(actions/talk entities :ego "A lot of good it'll do me to know his password while he's still there.")
|
||||
(steam/set-achievement "SAFE_AND_SOUND")
|
||||
)
|
||||
(increment-safe-listens entities))
|
||||
|
||||
(and (get-in @entities [:state :opened-crack?])
|
||||
(= 1 (get-in @entities [:state :safe-listen-count] 0)))
|
||||
|
||||
(do (actions/walk-to entities :ego [70 80])
|
||||
(actions/talk entities :ego "I'll give it another listen.")
|
||||
(actions/play-animation entities :ego :start-squat :stop? false)
|
||||
(actions/talk entities :ego "It looks like Gandarf's opening his Magi-safe." :animate? false :stop? false)
|
||||
(actions/play-sound entities "safe-sound.ogg" 0.1)
|
||||
(actions/play-animation entities :ego :end-squat)
|
||||
(actions/talk entities :ego "Ugh! Now I've got it stuck in my head!")
|
||||
(increment-safe-listens entities)
|
||||
(actions/give entities :tune))
|
||||
|
||||
(get-in @entities [:state :opened-crack?])
|
||||
(actions/talk entities :ego "I've got the tune stuck in my head already.")
|
||||
|
||||
:else
|
||||
(do (actions/walk-to entities :ego [80 80] :face :left)
|
||||
|
||||
Reference in New Issue
Block a user