diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 0f63380b..95d8609f 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 c35f1a21..15d23a5c 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -49,5 +49,6 @@ (def frog-legs {:name "Frog legs" :value :frog-legs :cursor :frog-legs}) (def stool {:name "Stool" :value :stool :cursor :stool}) (def teddy {:name "Teddy Bear" :value :teddy :cursor :teddy}) +(def portrait {:name "Portrait" :value :portrait :cursor :portrait}) diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index 7a4bccdb..066eb481 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -88,16 +88,26 @@ :script (actions/get-script entities (actions/walk-to entities :ego [222 3]) (actions/transition-background entities :inside-castle [182 90]))} - :portrait {:box [109 120 125 140] - :script (actions/get-script entities - (actions/talk entities :ego "It's a portrait, labeled 'Herb.'") - (actions/update-state entities (fn [state] (update-in state [:clues] #(conj % :name)) )))}} + :window {:box [212 130 256 180] + :script (actions/get-script entities + (actions/talk entities :ego "It's a nice, big window.")) + :scripts {:portrait (actions/get-script entities + (actions/play-animation entities :ego :reach) + (actions/talk entities :ego "The portrait says 'Herb' on the back.") + (actions/update-state entities (fn [state] (update-in state [:clues] #(conj % :name)) )))}}} :layers [(assoc (texture "inside-antique/background.png") :x 0 :y 0 :baseline 0)] :entities {:shopkeep (actions/start-animation screen (assoc (animation->texture screen shopkeep-stand) :x 137 :y 128 :baseline 112 :stand shopkeep-stand :talk shopkeep-talk :script (actions/get-script entities (do-antique-dialogue entities)) ) - :stand)} + :stand) + :portrait (assoc (texture "inside-antique/portrait.png") + :x 109 + :y 120 + :script (actions/get-script entities + (actions/talk entities :ego "It's a portrait. There's something on the back but I can't read it.") + (actions/remove-entity entities :portrait) + (actions/give entities items/portrait)))} :collision "inside-antique/collision.png" :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)))) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 084ee7e5..d9142614 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -11,7 +11,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 :stool :stick :cat-toy :balloon :frog-legs :teddy]) +(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :stool :stick :cat-toy :balloon :frog-legs :teddy :portrait]) (defn cursor [filename which] (let [scale 2