diff --git a/desktop/.nrepl-port b/desktop/.nrepl-port deleted file mode 100644 index 9463411b..00000000 --- a/desktop/.nrepl-port +++ /dev/null @@ -1 +0,0 @@ -2000 \ No newline at end of file diff --git a/desktop/resources/inside-jail/background.png b/desktop/resources/inside-jail/background.png index 720a320e..261b8f43 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/bars.png b/desktop/resources/inside-jail/bars.png index abebeaa6..5c38df21 100644 Binary files a/desktop/resources/inside-jail/bars.png and b/desktop/resources/inside-jail/bars.png differ diff --git a/desktop/src-common/advent/screens/rooms.clj b/desktop/src-common/advent/screens/rooms.clj index 398bbe9d..176f29cd 100644 --- a/desktop/src-common/advent/screens/rooms.clj +++ b/desktop/src-common/advent/screens/rooms.clj @@ -22,7 +22,8 @@ (if (= :main cursor) (:script spec) (when-let [scripts (:scripts spec)] - (scripts (:value cursor)))))})) + (scripts (:value cursor))))) + :id id})) entities (into {} (for [[id entity] entities] [id (make-entity id entity)]))] (merge params {:collision (advent.pathfind/map-from-resource collision) diff --git a/desktop/src-common/advent/screens/rooms/inside_jail.clj b/desktop/src-common/advent/screens/rooms/inside_jail.clj index 923ac313..3099f43e 100644 --- a/desktop/src-common/advent/screens/rooms/inside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/inside_jail.clj @@ -90,6 +90,10 @@ :ego "Maybe you should give it a rest."))) (actions/update-state entities #(assoc % :hay-searches (inc hay-searches))))) +(defn remove-lock [entities] + (update-in entities [:room :interactions] + (fn [i] (remove #(= :lock (:id %)) i)))) + (defn make [screen] (let [warden-sheet (texture! (texture "inside-jail/warden.png") :split 43 58) warden-talk (animation 0.2 (for [i [1 0 1 0 1 0 1 0 0 0 2 0]] @@ -110,7 +114,10 @@ :scripts {:key (actions/get-script entities (actions/walk-to entities :ego [174 80] :face :right) (actions/play-animation entities :ego :reach) - (actions/talk entities :ego "Yes, that's it!"))}} + (actions/talk entities :ego "Yes, that's it!") + (actions/walk-straight-to entities :moveable-bars [60 77]) + (actions/update-entities entities #(remove-lock %)) + (actions/update-state entities #(assoc % :opened-bars? true)))}} :window {:box [98 110 118 140] :script (actions/get-script entities (actions/walk-to entities :ego [102 88] :face :right) @@ -120,8 +127,7 @@ :ego "I have to find a way out of here!"))} :hay {:box [130 86 177 102] :script (actions/get-script entities - (search-hay entities) - )}} + (search-hay entities))}} :layers [(assoc (texture "inside-jail/background.png") :x 0 :y 0 :baseline 0) (assoc (texture "inside-jail/bars.png") :x 0 :y 0 :baseline 165) (assoc (texture "inside-jail/glow.png") :x 0 :y 0 :baseline 240)] @@ -152,7 +158,9 @@ (actions/walk-to entities :ego [103 83] :face :left) (actions/play-animation entities :ego :squat) (actions/remove-entity entities :ball-n-chain) - (actions/give 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)} :collision "inside-jail/collision.png" :scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5) :start-pos [130 85] @@ -163,4 +171,7 @@ 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?]) + (remove-lock entities) entities))))))