diff --git a/desktop/src-common/advent/screens/rooms/inside_stash.clj b/desktop/src-common/advent/screens/rooms/inside_stash.clj index 144d53d9..1ef2bc59 100644 --- a/desktop/src-common/advent/screens/rooms/inside_stash.clj +++ b/desktop/src-common/advent/screens/rooms/inside_stash.clj @@ -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)