wrong interaction tweak.

This commit is contained in:
Bryce Covert
2015-11-27 19:16:12 -08:00
parent f174ff6837
commit d50acf3205

View File

@@ -21,6 +21,16 @@
(actions/update-state entities #(assoc % :broke-lock? true))
(actions/talk entities :ego "Got it!"))))
(defn unlock-chest [entities]
(if (get-in @entities [:state :broke-lock?])
(do
(actions/talk entities :ego "I already bust it open."))
(do
(actions/talk entities :ego "It's worth a shot...")
(actions/walk-straight-to entities :ego [152 95] :face :right)
(actions/play-animation entities :ego :reach)
(actions/do-dialogue entities :ego "Nope."))))
(defn explore-chest [entities]
(cond
(actions/has-item? entities :slingshot)
@@ -78,7 +88,9 @@
:script (actions/get-script entities (explore-chest entities))
:scripts {:sword (actions/get-script entities (actions/talk entities :ego "There's not enough room to swing my sword here."))
:crowbar (actions/get-script entities
(bust-chest entities))}}}
(bust-chest entities))
:key (actions/get-script entities
(unlock-chest entities))}}}
:layers [(assoc (utils/get-texture "inside-stash/background.png") :x 0 :y 0 :baseline 0 :night-profile :none)]
:entities {:lid (assoc (utils/get-texture "inside-stash/lid.png")
:x 156 :y 116 :baseline 125 :night-profile :none)