diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 0b75b294..4f1ee414 100644 Binary files a/desktop/resources/cursor.png and b/desktop/resources/cursor.png differ diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index 33ba9ffa..9ffff160 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -121,4 +121,6 @@ :monocle {:name "Monocle" :value :monocle :cursor :monocle} :feather {:name "Feather" :value :feather :cursor :feather :scripts {:flask-flies-ash (make-finished-component)}} :spell-component {:name "Spell component" :value :spell-component :cursor :spell-component} - :money {:name "Money" :value :money :cursor :money}}) + :money {:name "Money" :value :money :cursor :money} + :watch {:name "Watch" :value :watch :cursor :watch} + :broken-watch {:name "Halved watch" :value :broken-watch :cursor :broken-watch}}) diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 97e1244d..4c4e1616 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -152,13 +152,19 @@ (defn add-monocle-if-necessary [entities] (if (and (not (actions/has-obtained? entities :monocle)) (get-in entities [:state :talked-to-owl?])) - (update-in entities [:room :entities] #(assoc % :monocle (doto (get-in entities [:room :monocle]) println))) + (update-in entities [:room :entities] #(assoc % :monocle (get-in entities [:room :monocle]))) + entities)) + +(defn add-watch-if-necessary [entities] + (if (not (actions/has-obtained? entities :watch)) + (update-in entities [:room :entities] #(assoc % :watch (get-in entities [:room :watch]))) entities)) (defn make-night [entities] (-> entities (update-in [:room :entities] #(dissoc % :game-player)) - add-monocle-if-necessary)) + add-monocle-if-necessary + add-watch-if-necessary)) (defn make [screen] (let [game-player-talk-sheet (texture! (texture "inside-castle/game-player-talk.png") :split 40 44) @@ -343,6 +349,21 @@ (actions/remove-entity entities :monocle) (actions/give entities :monocle) (actions/talk entities :ego "It looks like a monocle."))})) + :watch (rooms/make-entity :watch (assoc (texture "inside-castle/watch.png") + :x 282 :y 62 :baseline 140 + :script (actions/get-script entities + + (actions/talk entities :ego "There's something on that chair.") + (actions/walk-to entities :ego [265 90] :face :right) + (actions/walk-straight-to entities :ego [303 80]) + (actions/walk-straight-to entities :ego [302 48]) + (actions/play-animation entities :ego :squat) + (actions/remove-entity entities :watch) + (actions/give entities :watch) + (actions/do-dialogue entities :ego "It's a watch." + :ego "Brian O'Brainy must have left it behind.") + (actions/walk-straight-to entities :ego [303 80]) + (actions/walk-straight-to entities :ego [265 90])))) :collision "inside-castle/collision.png" :scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00) :apply-state (fn [entities] diff --git a/desktop/src-common/advent/screens/rooms/outside_jail.clj b/desktop/src-common/advent/screens/rooms/outside_jail.clj index 7193c4b0..006e4166 100644 --- a/desktop/src-common/advent/screens/rooms/outside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/outside_jail.clj @@ -15,10 +15,18 @@ (assoc-in entities [:room :entities :spear] (get-in entities [:room :spear])) entities)) +(defn add-watch-if-necessary [entities] + (if (and (not (actions/has-obtained? entities :broken-watch)) + (not (actions/has-item? entities :watch)) + (actions/has-obtained? entities :watch)) + (assoc-in entities [:room :entities :watch] (get-in entities [:room :watch])) + entities)) + (defn make-night [entities] (-> entities (assoc-in [:room :entities :guard] (get-in entities [:room :guard])) - add-spear-if-necessary)) + add-spear-if-necessary + add-watch-if-necessary)) (defn search-guard [entities] (actions/walk-to entities :ego [121 75] :face :left) @@ -81,7 +89,25 @@ :ego "That's Captain McHulk's house!" :ego "He's the mightiest knight in all of Remington." :ego "If only I could be as strong as him one day." - ))}} + ))} + :stump {:box [205 68 251 89] + :script (actions/get-script entities + (actions/do-dialogue entities :ego "It's a stump.")) + :scripts {:watch (actions/get-script entities + (actions/walk-to entities :ego [189 65] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-item entities :watch) + (actions/add-entity entities :watch (get-in @entities [:room :watch]))) + :sword (actions/get-script entities + (when (get-in @entities [:room :entities :watch]) + (actions/walk-to entities :ego [129 65] :face :right) + (actions/talk entities :ego "I'll take a big swing!") + (actions/walk-straight-to entities :ego [189 65] :face :right :speed 3.5) + (actions/play-animation entities :ego :swing) + (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)))}}} :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) @@ -105,7 +131,8 @@ :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 @@ -115,6 +142,13 @@ :spear (rooms/make-entity :spear (assoc (texture "outside-jail/spear.png") :x 60 :y 65 :baseline 180 :script (actions/get-script entities (grab-spear entities)))) + :watch (rooms/make-entity :watch (assoc (texture "inside-castle/watch.png") + :x 217 :y 83 :baseline 160 + :script (actions/get-script entities + (actions/walk-to entities :ego [189 65] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :watch) + (actions/give entities :watch)))) :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/utils.clj b/desktop/src-common/advent/utils.clj index ef22a30c..eac82432 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 :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money]) +(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 :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :watch :broken-watch]) (defn cursor [filename which] (let [scale 2