diff --git a/desktop/resources/outside-jail/background-dark.png b/desktop/resources/outside-jail/background-dark.png index a17982e4..3b7fe069 100644 Binary files a/desktop/resources/outside-jail/background-dark.png and b/desktop/resources/outside-jail/background-dark.png differ diff --git a/desktop/resources/outside-jail/closed-stash.png b/desktop/resources/outside-jail/closed-stash.png new file mode 100644 index 00000000..ff8799af Binary files /dev/null and b/desktop/resources/outside-jail/closed-stash.png differ diff --git a/desktop/resources/outside-jail/open-stash.png b/desktop/resources/outside-jail/open-stash.png new file mode 100644 index 00000000..1369c725 Binary files /dev/null and b/desktop/resources/outside-jail/open-stash.png differ diff --git a/desktop/src-common/advent/screens/rooms/outside_jail.clj b/desktop/src-common/advent/screens/rooms/outside_jail.clj index 006e4166..3995d180 100644 --- a/desktop/src-common/advent/screens/rooms/outside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/outside_jail.clj @@ -26,7 +26,8 @@ (-> entities (assoc-in [:room :entities :guard] (get-in entities [:room :guard])) add-spear-if-necessary - add-watch-if-necessary)) + add-watch-if-necessary + (assoc-in [:room :entities :stash] (get-in entities [:room :stash])))) (defn search-guard [entities] (actions/walk-to entities :ego [121 75] :face :left) @@ -50,7 +51,9 @@ guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87) guard-stand (animation 0.1 [(aget guard-sheet 0 0)]) 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))] + guard-sleep (utils/make-anim "outside-jail/guard-sleep.png" [43 67] 0.1 (range 4)) + open-stash (animation 0.1 [(texture "outside-jail/closed-stash.png") (texture "outside-jail/open-stash.png")]) + close-stash (animation 0.1 [(texture "outside-jail/open-stash.png") (texture "outside-jail/closed-stash.png")])] (rooms/make :music {:day :town-1 :night :night} :interactions {:down-dir {:box [30 0 227 20] :script (actions/get-script entities @@ -107,7 +110,17 @@ (actions/talk entities :ego "It's split right down the middle!") (actions/play-animation entities :ego :reach) (actions/remove-entity entities :watch) - (actions/give entities :broken-watch)))}}} + (actions/give entities :broken-watch)))}} + :lever {:box [10 72 17 85] + :script (actions/get-script entities + (when (get-in @entities [:state :knows-about-stash?]) + (actions/walk-to entities :ego [48 36] :face :left) + (actions/play-animation entities :ego :reach-start :stop? false) + (actions/play-animation entities :stash :open :stop? false) + (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!")))}} :layers {:day [(assoc (texture "outside-jail/background.png") :x 0 :y 0 :baseline 0)] :night [(assoc (texture "outside-jail/background-dark.png") :x 0 :y 0 :baseline 0)]} :entities {:fountain (assoc (animation->texture screen fountain) @@ -125,14 +138,13 @@ (actions/play-animation entities :ego :reach) (actions/remove-item entities :flask-2) (actions/give entities :flask-water) - (actions/talk entities :ego "Filled with water, just as Gandarf wanted."))}) + (actions/talk entities :ego "Filled up with water, just as Gandarf wanted."))}) :warden {:object nil :x 36 :y 86 :width 10 :height 10 - :talk-color (color 0.9 0.3 0.9 1.0)} - } + :talk-color (color 0.9 0.3 0.9 1.0)}} :guard (rooms/make-entity :guard (assoc (animation->texture screen guard-stand) :x 70 :y 55 :baseline 185 :stand guard-stand @@ -148,7 +160,13 @@ (actions/walk-to entities :ego [189 65] :face :right) (actions/play-animation entities :ego :reach) (actions/remove-entity entities :watch) - (actions/give entities :watch)))) + (actions/give entities :watch)))) + + :stash (rooms/make-entity :stash (assoc (texture "outside-jail/closed-stash.png") + :x 197 :y 94 :baseline 146 + :open open-stash + :close close-stash)) + :collision "outside-jail/collision.png" :scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3) :start-pos [145 15] diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index ddfc0f15..6dab5059 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -150,6 +150,10 @@ (texture (aget squat-sheet 0 i)))) reach-anim (animation 0.1 (for [i [0 1 2 3 3 3 3 3 3 2 1 0]] (texture (aget reach-sheet 0 i)))) + reach-start (animation 0.1 (for [i [0 1 2 3 ]] + (texture (aget reach-sheet 0 i)))) + reach-stop (animation 0.1 (for [i [3 2 1 0]] + (texture (aget reach-sheet 0 i)))) cat-toy-anim (animation 0.1 (for [i [0 0 1 1 2 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 2 1 1 0 0]] (texture (aget cat-toy-sheet 0 i)))) cat-toy-first-half (animation 0.1 (for [i [0 0 1 1 2 2 3]] @@ -187,6 +191,8 @@ :grow-talk grow-talk :reach-up reach-up :reach-down reach-down + :reach-start reach-start + :reach-stop reach-stop [:fire 1] fire-1-anim [:fire 2] fire-2-anim [:fire 3] fire-3-anim @@ -207,6 +213,8 @@ :grow-talk (utils/flip grow-talk) :reach-up (utils/flip reach-up) :reach-down (utils/flip reach-down) + :reach-start (utils/flip reach-start) + :reach-stop (utils/flip reach-stop) [:fire 1] (utils/flip fire-1-anim) [:fire 2] (utils/flip fire-2-anim) [:fire 3] (utils/flip fire-3-anim)