diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 7bd248ba..51cd1a7e 100644 Binary files a/desktop/resources/cursor.png and b/desktop/resources/cursor.png differ diff --git a/desktop/resources/inside-cafeteria/ladder-guard.png b/desktop/resources/inside-cafeteria/ladder-guard.png index 413c53ae..bb9139da 100644 Binary files a/desktop/resources/inside-cafeteria/ladder-guard.png and b/desktop/resources/inside-cafeteria/ladder-guard.png differ diff --git a/desktop/resources/inside-jail/background.png b/desktop/resources/inside-jail/background.png index 261b8f43..064e486e 100644 Binary files a/desktop/resources/inside-jail/background.png and b/desktop/resources/inside-jail/background.png differ diff --git a/desktop/resources/inside-jail/crowbar.png b/desktop/resources/inside-jail/crowbar.png new file mode 100644 index 00000000..f50354da Binary files /dev/null and b/desktop/resources/inside-jail/crowbar.png differ diff --git a/desktop/resources/inside-jail/window-bent.png b/desktop/resources/inside-jail/window-bent.png new file mode 100644 index 00000000..9ff97cf7 Binary files /dev/null and b/desktop/resources/inside-jail/window-bent.png differ diff --git a/desktop/resources/inside-jail/window.png b/desktop/resources/inside-jail/window.png new file mode 100644 index 00000000..04d79b9c Binary files /dev/null and b/desktop/resources/inside-jail/window.png differ diff --git a/desktop/resources/outside-jail/guard-sleep.png b/desktop/resources/outside-jail/guard-sleep.png new file mode 100644 index 00000000..70f524a7 Binary files /dev/null and b/desktop/resources/outside-jail/guard-sleep.png differ diff --git a/desktop/resources/outside-jail/guard-sleep.pxa/0.pxi b/desktop/resources/outside-jail/guard-sleep.pxa/0.pxi new file mode 100644 index 00000000..642d5d5a Binary files /dev/null and b/desktop/resources/outside-jail/guard-sleep.pxa/0.pxi differ diff --git a/desktop/resources/outside-jail/guard-sleep.pxa/1.pxi b/desktop/resources/outside-jail/guard-sleep.pxa/1.pxi new file mode 100644 index 00000000..a95790c4 Binary files /dev/null and b/desktop/resources/outside-jail/guard-sleep.pxa/1.pxi differ diff --git a/desktop/resources/outside-jail/guard-sleep.pxa/2.pxi b/desktop/resources/outside-jail/guard-sleep.pxa/2.pxi new file mode 100644 index 00000000..5151f777 Binary files /dev/null and b/desktop/resources/outside-jail/guard-sleep.pxa/2.pxi differ diff --git a/desktop/resources/outside-jail/guard-sleep.pxa/3.pxi b/desktop/resources/outside-jail/guard-sleep.pxa/3.pxi new file mode 100644 index 00000000..b40cb319 Binary files /dev/null and b/desktop/resources/outside-jail/guard-sleep.pxa/3.pxi differ diff --git a/desktop/resources/outside-jail/guard-sleep.pxa/CelData.plist b/desktop/resources/outside-jail/guard-sleep.pxa/CelData.plist new file mode 100644 index 00000000..f0b74d60 --- /dev/null +++ b/desktop/resources/outside-jail/guard-sleep.pxa/CelData.plist @@ -0,0 +1,22 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index e0c1b9b0..591bbdc0 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -114,4 +114,5 @@ :ball-n-chain {:name "Ball-n-chain" :value :ball-n-chain :cursor :ball-n-chain} :key {:name "Jail key" :value :key :cursor :key} :rope {:name "Rope" :value :rope :cursor :rope} + :crowbar {:name "Crowbar" :value :crowbar :cursor :crowbar} }) diff --git a/desktop/src-common/advent/screens/rooms/inside_jail.clj b/desktop/src-common/advent/screens/rooms/inside_jail.clj index ebbf1164..324a0637 100644 --- a/desktop/src-common/advent/screens/rooms/inside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/inside_jail.clj @@ -21,7 +21,7 @@ (actions/walk-to entities :ego [174 80] :face :right) (actions/play-animation entities :ego :reach) (actions/talk entities :ego "Yes, that's it!") - (actions/walk-straight-to entities :moveable-bars [60 77]) + (actions/walk-straight-to entities :moveable-bars [65 77]) (actions/update-entities entities #(remove-lock %)) (actions/update-state entities #(assoc % :opened-bars? true))) @@ -191,7 +191,34 @@ (actions/do-dialogue entities :ego "What a peaceful night." :ego "Oh my sweet Georgia McGorgeous. How will I ever save you now?" - :ego "I have to find a way out of here!"))} + :ego "I have to find a way out of here!")) + :scripts {:crowbar (actions/get-script entities + (if (get-in @entities [:state :bent-bars?]) + (actions/do-dialogue entities :ego "They're bent as far as they can go.") + (do (actions/walk-to entities :ego [102 88] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :closed-window) + (actions/update-state entities #(assoc % :bent-bars? true)) + (actions/do-dialogue entities :ego "Now we're getting somewhere.")))) + :ball-n-chain (actions/get-script entities (if (get-in @entities [:state :bent-bars?]) + (do (actions/walk-to entities :ego [102 88] :face :right) + (actions/play-animation entities :ego :reach) + (actions/update-state entities #(assoc % :dropped-ball? true)) + (actions/do-dialogue entities :ego "Geronimo!!" + :ego "*crash*!") + (actions/remove-item entities :ball-n-chain)) + (actions/do-dialogue entities :ego "I don't know what to do with that."))) + :sword (actions/get-script entities (actions/talk entities :ego "I wouldn't want to accidentally break the Sword of Blergh.")) + :rope (actions/get-script entities (if (get-in @entities [:state :bent-bars?]) + (do (actions/walk-to entities :ego [102 88] :face :right) + (actions/do-dialogue entities :ego "Here goes.") + (actions/play-animation entities :ego :reach) + (actions/do-dialogue entities + :ego "Uh oh. There's a guard right beneath the window." + :ego "I had better not, or else I'd get caught.")) + (actions/do-dialogue entities :ego "Good thinking." + :ego "But I can't fit out that window." + :ego "And the bars are made of steel!")))}} :hay {:box [130 86 177 102] :script (actions/get-script entities (search-hay entities))} @@ -258,7 +285,19 @@ (actions/remove-entity entities :ball-n-chain) (actions/give entities :ball-n-chain))) :moveable-bars (assoc (texture "inside-jail/moveable-bars.png") - :x 132 :y 77 :baseline 163)} + :x 132 :y 77 :baseline 163) + :crowbar (assoc (texture "inside-jail/crowbar.png") + :x 304 :y 65 :baseline 175 + :script (actions/get-script entities + (if (get-in @entities [:state :opened-bars?]) + (do (actions/walk-to entities :ego [295 55] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :crowbar ) + (actions/give entities :crowbar) + (actions/talk entities :ego "It's a crowbar.")) + (actions/talk entities :ego "I can't reach it.")))) + :closed-window (assoc (texture "inside-jail/window.png") + :x 99 :y 111 :baseline 128)} :collision "inside-jail/collision-locked.png" :collision-free (advent.pathfind/map-from-resource "inside-jail/collision-free.png") :scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5) @@ -268,11 +307,17 @@ (if (actions/has-obtained? entities :ball-n-chain) (update-in entities [:room :entities] #(dissoc % :ball-n-chain)) entities) + (if (actions/has-obtained? entities :crowbar) + (update-in entities [:room :entities] #(dissoc % :crowbar)) + entities) (if (get-in entities [:state :warden-sleeping?]) (update-in entities [:room :entities :warden] #(actions/start-animation % :sleep)) entities) (if (get-in entities [:state :opened-bars?]) (update-in (remove-lock entities) [:room :entities :moveable-bars] - #(assoc % :x 60 :y 77)) + #(assoc % :x 65 :y 77)) + entities) + (if (get-in entities [:state :bent-bars?]) + (update-in entities [:room :entities] #(dissoc % :closed-window)) entities)))))) diff --git a/desktop/src-common/advent/screens/rooms/outside_jail.clj b/desktop/src-common/advent/screens/rooms/outside_jail.clj index 0da4eecf..b17d3d41 100644 --- a/desktop/src-common/advent/screens/rooms/outside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/outside_jail.clj @@ -14,7 +14,8 @@ (let [fountain (utils/make-anim "outside-jail/fountain.png" [42 50] 0.2 (range 3)) 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-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))] (rooms/make :music :town-2 :interactions {:down-dir {:box [30 0 227 20] :script (actions/get-script entities @@ -70,7 +71,10 @@ :height 10 :talk-color (color 0.9 0.3 0.9 1.0)}} :guard (assoc (animation->texture screen guard-stand) - :x 70 :y 55 :baseline 185) + :x 70 :y 55 :baseline 185 + :stand guard-stand + :talk guard-talk + :sleep guard-sleep) :collision "outside-jail/collision.png" :scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3) :start-pos [145 15] @@ -78,4 +82,7 @@ (as-> entities entities (if (= :night (get-in entities [:state :time])) (assoc-in entities [:room :entities :guard] (get-in entities [:room :guard])) + entities) + (if (get-in entities [:state :dropped-ball?]) + (update-in entities [:room :entities :guard] #(actions/start-animation % :sleep)) entities)))))) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 635c3df4..cb6b96cb 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -14,7 +14,7 @@ (let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})] (println (:input-x screen) (:input-y screen) "->" x y))) -(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope]) +(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar]) (defn cursor [filename which] (let [scale 2